On a recent project, we had a number of ‘challenges’ getting our .net web services consumed by a java-based service. In order to even start debugging we needed to know exactly what was being being sent and received on the wire. The consuming application provided easy access to this information, but we needed a way for the .net developers to know this without loading that up or (worse) using a tool like netmon to inspect the network packets directly. Unable to find any immediate way to record this, I provided one using a SoapExtension. Turns out that this MSDN Online link (now) provides an implementation of what I wanted – it would’ve saved a lot of grief.
known issues
- doesnt work with the autogenerated .net web service testrig (I’ve no idea why not)
- this is only intended to be used in a development environment – applying the attribute will require a recompile
- writing to the file system is a privileged operation – you may need to check your local security settings.
Using it is easy enough; adjust the namespace to suit, then simply apply the attribute with an optional path to the log file.
[WebMethod, SoapTrace("d:soap.log")]
