0
votes

Getting following error after hosting WCF Service in IIS.

HTTP Error 500.0 - Internal Server Error. The page cannot be displayed because an internal server error has occurred.

Module IsapiModule
Notification ExecuteRequestHandler
Handler svc-ISAPI-4.0_32bit
Error Code 0x00000000

It is HTTPS having a secure certificate WCF Service. Please help me to solve this problem.

1
Enable tracing for WCF (which will usually generate an extremely detailed file), check the Windows event log, etc. I doubt anyone will be able to help you based on the info provided--a 500 error is extremely generic.Tim Medora

1 Answers

2
votes

It can be caused by many different things. You should try the following solutions:

1 First way

  1. Right click the folder where your site is located: "C:\Users\NAME\SiteName" and select Properties.
  2. Select the Security tab and click on Edit.
  3. Add.. and type in "IIS_IUSRS".

2 Second way

By default, WCF Service OperationContracts can only be invoked using an HTTP POST. When you call open() on the Titanium HTTPClient, are you specifying a GET or POST for HTTP method parameter?

Secondly, since your service binding is using SOAP 1.1, you need to pass a SOAPAction header in your request so that WCF can route the message to the GetData method. If an Action parameter is not specified in the service's OperationContract attribute, the Action should be the method name preceded by the namespace and service contract name (probably http://tempuri.org/IService1/GetData if you're using what the default WCF application created). You'll also need to specify a content-type. So, you'd need to setup your xhr like this prior to calling send:

xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-16'); xhr.setRequestHeader('SOAPAction', '"http://tempuri.org/IService1/GetData"'); xhr.send(s); Also, you can explicitly specify an action for a WCF service operation:

[OperationContract(Action = "MyAction")] string GetData() { // ...snip... }

xhr.setRequestHeader('SOAPAction', '"MyAction"');

And lastly, you can allow service operations to be invoked via an HTTP GET by decorating the method with the [WebGet] attribute. This allows the operation to be called in REST fashion: http://msdn.microsoft.com/en-us/library/system.servicemodel.web.webgetattribute.aspx