I have a .net web service hosted in IIS 6.0 which periodically fails with http 500 because the client connects to it with data that does not match wsdl.
Things like the presence of an element specified in the method as an int type and an incoming xml element contain a decimal number.
WSDL element definition:
<s: element minOccurs = "1" maxOccurs = "1" form = "unqualified" name = "ItemCount" type = "s: int" />
provided item:
<ItemCount> 1.0 </ItemCount>
This leaves a 500 error in iis logs, but soap return information is not returned or the input that caused the error.
I have currently diagnosed several problems with data obtained by capturing everything using wirehark, but I would like to know about other options that are perhaps less intrusive.
Is there a way to capture sent data that cause 500 errors (hopefully ONLY data capture when 500 happens)? Maybe:
- IIS setup
- Web service setup
- Web service code change
EDIT after testing the response provided by tbreffni
The answer that best corresponded to what I was after tbreffni - there were a few other good answers, but the answer allows you to capture the payload by causing deserialization errors without launching something like a violinist or wirehark.
The information on actually getting the SOAP extension to run is a little light, so I included the steps below that I found necessary:
- Create SOAP extension as .dll according to MSDN article
- Add .dll to bin directory for trace service
- In the tracking service web.config, add the following to the webServices section, replacing SOAPTraceExtension.TraceExtension and SOAPTraceExtension according to your extension.
<WebServices>
<soapExtensionTypes>
<add type = "SOAPTraceExtension.TraceExtension, SOAPTraceExtension" priority = "1" group = "0" />
</soapExtensionTypes>
</WebServices>
source share