SOAP messages logging for dummies RRS feed

  • Question

  • User-591144721 posted


    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

    Kind regards



    Monday, November 11, 2013 3:04 AM


  • User-484054684 posted

    Hi Steen,

    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.

    Reference: http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer(v=vs.110).aspx

    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]




    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 11, 2013 7:42 AM

All replies