web-service – REST webservice does not return XML on IIS 8.0


The webservice in visual studio 2013 works beautifully. I added it to IIS on windows 8.1, and when it comes time to send data via REST, it gives me this error:

The server encountered an error processing the request. See the service's help page to build valid orders for the service.

Method: GET


<?xml version="1.0"?>

    <add name="BD_Super_V8ConnectionString" connectionString="Data Source=NUNO-PC\SQLEXPRESS;Initial Catalog=BD_Super_V8;Integrated Security=True"
      providerName="System.Data.SqlClient" />
    <compilation targetFramework="4.0" />
    <!-- REST -->
      <service name="WcfServicePedido_v7.ServicePedido">
        <endpoint name="RestEndPoint"
                  behaviorConfiguration="restBehavior" />
        <behavior name="restBehavior">
          <webHttp helpEnabled="true"/>
      <!-- REST -->
          <!-- To avoid disclosing metadata information, set the value below to false before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <modules runAllManagedModulesForAllRequests="true"/>
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
    <directoryBrowse enabled="true"/>


Service: [ServiceContract]

public interface IServicePedido
    /// <summary>
    /// Retorna todos os pedidos (JSON)
    /// </summary>
    /// <returns></returns>
    [WebGet(UriTemplate = "maquinas/?volta={volta}",
        RequestFormat = WebMessageFormat.Xml,
        ResponseFormat = WebMessageFormat.Xml)]
    List<VoltaPDA> GetAllMaquinasVolta(int volta);

Apaguei e voltei a publicar o WebService:
Agora dá me este erro:

The server encountered an error processing the request. Please see the
service help page for constructing valid requests to the service.


2014-03-07 10:53:43 ::1 GET /ServicePedido.svc/help - 8095 - ::1
 http://localhost:8095/ServicePedido.svc/maquinas/?volta=1 200 0 0 24


Apparently your WCF runs and the error occurs at runtime. The first step is to try to change the error message to something more specific and thus be able to locate the problem. Make sure you have debugging enabled in the .svc file

<%@ ServiceHost Language="C#" Debug="true" ... %>

Then in the .config file change this option to true

<serviceDebug includeExceptionDetailInFaults="true" />

It may still be necessary to enable wcf tracing to go deeper, here is an article that helps with this: http://msdn.microsoft.com/pt-br/library/ms733025(v=vs.110).aspx

Try the following too:

  • On IIS in Application Pools
  • Select the one your WCF is using
  • Right click and go to Advanced Settings
  • Identity, change to NetworkService
Scroll to Top