I have a WCF self hosted service, which is called by an AJAX JavaScript.
In some cases the response is Bad Request and the response length is 0.
What I’ve done so far:
- Inspecting req/resp with fiddler: Request seems to be OK, and response is http 400 ‘Bad Request’ length is 0, so no info, no stack trace etc.
- Trying to set breakpoint in my service implementation: The service method does not even called
-
Trying to set all exceptions in VS menu Debug/Exceptions: No exceptions fired.
-
Now how to investigate toward?
- Is there any log what self hosted service is writing?
- Any other idea?
You can enable WCF tracing to track that error down. Just add the following snippet to your application configuration file:
This will create a log file containing additional information for every request. You can open the log file with the Service Trace Viewer Tool which provides a nice GUI.