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:
Trying to set all exceptions in VS menu Debug/Exceptions: No exceptions fired.
Now how to investigate toward?
You can enable WCF tracing to track that error down. Just add the following snippet to your application configuration file:
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Verbose, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "c:\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
</configuration>
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.