Ajax Llamar:500 System.ServiceModel.ServiceActivationException al realizar una llamada Ajax para el servicio WCF resto
$.ajax({
type: "POST",
url: "http://SomeService/ServiceName.svc/GetSearchResults",
data: JSON.stringify({ parameters: serviceParameters }),
contentType: "application/json; charset=utf-8",
dataType: "XML",
success: function (response) {
$("#xmlText").text(response.xml);
},
error: function (msg) {
alert(msg.toString);
}
})
WCF Interfaz:
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFormat.Json,
UriTemplate = "GetSearchResults")]
XElement GetSearchResults(inputParameters parameters);
[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, UriTemplate = "getFile")]
Stream GetFile(DocInfo info);
Web.config:
<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
</serviceHostingEnvironment>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"></standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
El el servicio está alojado en IIS6.
Cuando llamo el servicio me sale el siguiente mensaje de error:
500 System.ServiceModel.ServiceActivationException
puedo llamar al método GetFile
y obtener la secuencia de respuesta pero me sale el mensaje de error al llamar GetSearchResults
.
Cualquier ayuda será apreciada.
Sugeriría que habilite el rastreo (http://msdn.microsoft.com/en-us/library/ms733025.aspx) e inspeccione el registro de seguimiento para conocer el problema exacto al intentar invocar el método GetSearchResults – Rajesh