O webservice no visual studio 2013 funciona lindamente. Adicionei-o ao IIS do windows 8.1, e ele quando chega altura de enviar os dados via REST, dá-me este erro:
O servidor encontrou um erro ao processar o pedido. Consulte a página de ajuda do serviço para construir pedidos válidos para o serviço.
Metodo: GET
WebConfig:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="BD_Super_V8ConnectionString" connectionString="Data Source=NUNO-PC\SQLEXPRESS;Initial Catalog=BD_Super_V8;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation targetFramework="4.0" />
</system.web>
<system.serviceModel>
<!-- REST -->
<services>
<service name="WcfServicePedido_v7.ServicePedido">
<endpoint name="RestEndPoint"
contract="WcfServicePedido_v7.IServicePedido"
binding="webHttpBinding"
address=""
behaviorConfiguration="restBehavior" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="restBehavior">
<webHttp helpEnabled="true"/>
</behavior>
</endpointBehaviors>
<!-- REST -->
<serviceBehaviors>
<behavior>
<!-- 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"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<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"/>
</system.webServer>
</configuration>
Serviço: [ServiceContract]
public interface IServicePedido
{
/// <summary>
/// Retorna todos os pedidos (JSON)
/// </summary>
/// <returns></returns>
[WebGet(UriTemplate = "maquinas/?volta={volta}",
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml)]
[OperationContract]
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.
LOG FILE:
2014-03-07 10:53:43 ::1 GET /ServicePedido.svc/help - 8095 - ::1
Mozilla/5.0+(Windows+NT+6.3;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/33.0.1750.146+Safari/537.36
http://localhost:8095/ServicePedido.svc/maquinas/?volta=1 200 0 0 24