[SalesForce] How to intercept the SOAP Request/Response Made from Salesforce or received in Salesforce

I am working a salesforce integration project. We are making n number of web service calls to third party services. Now I have to implement a logger , where I need to store the soap request and response in xml format. Most preferable is the same soap request and response xml.

How I can intercept this request and response , in apex problematically ?

Is it the only option left to xml serialize my request and response explicitly ?

Best Answer

When you create a Proxy Class from WSDL to call web service it contain all the code.

If you want to debug log in function you can find that function in your proxy class (Generated from WSDL) and intercept all XML. If you want to do it for all request then you need to study the Proxy class and find best place for your interceptor.

Related Topic