Last post Nov 11, 2013 07:42 AM by Siva Krishna Macha
Nov 11, 2013 03:04 AM|srabol|LINK
Does someone knows where there is a 'How to save SOAP request to a file' guide for dummies ?
What I'm looking for is a 'generic' solution that can be added to the following:
1) I have a WSDL file
2) Create proxy class using WSDL
3) add the generic code
4) before the service call is invoked, call a generinc method to save the SOAP message to a file
Sounds 'simple' but i have not been able to find anything like this.
Any help appreciated
Nov 11, 2013 07:23 AM|Siva Krishna Macha|LINK
Option 1: We would need to write the SoapExtensions for this.
Option 2: You could also go with writing HttpModule
Please mark this as answer if this answers your question.
Nov 11, 2013 07:31 AM|srabol|LINK
Sorry, I was not clear enough.
I do not have control over the web service.
I'm using the WSDL to create proxy classes and then call the methods.
Nov 11, 2013 07:42 AM|Siva Krishna Macha|LINK
Yes I got the clarity now. So basically you are consuming the webservice but don't have control of the web service.
However logging of the outgoing requests from your application can be traced out.
1. If you are keen about just the data that you are sending out but not the "same original" xml which includes exact root tags, envelope and namespaces etc that is being sent out - Then, you can just use XmlSerializer to accomplish the task.
2. If you would need to get the same original (exact) xml, then, it may depend based on your application - as each framework has it's own way of enabling the tracing and logging the inbound and outbound xmls.
i.e., if you are calling this webservice from other WCF service, then, WCF service framework will have features to log the xmls.
3. We could go with a custom XmlWriter also and via SoapHttpClientProtocol.. Reference:
http://orbinary.com/blog/2010/01/getting-the-raw-soap-xml-sent-via-soaphttpclientprotocol/ [Also, if we look at the other references in this post from orbinary.com, it looks like, we could also use the SoapExtensions from the client side, as long as we
have the required assembly references added along with the custom extension code to our application and the web.config changes that are required]