On receipt of a SOAP request (SOAP-MSG) the SOAP Message Handler created two objects - soapRequestData (which contains the SOAP Request) and an “empty” soapResponseData. Wanted to know what is the reason for this “empty” object? It could have very well made it mandatory for the SOAP Processor or the Target Service to create and return a filled soapResponseData object.
Based on my pure logic, I feel:
When a SOAP Client (say XML Spy) sends a SOAP Request it is waiting for a response.
The SOAP Handler creates two SOAP Objects - soapRequestData and soapResponseData - and passes them to the SOAP Processor. While the soapRequestData contains the actual SOAP Rqst, the soapResponseData is “empty”.
This may be a “fail-safe” way to ensure that a SOAP Response Object is instantiated way before the SOAP Processor starts. This will ensure that even if any exception occurs in the SOAP Processor (before it got instantiated in the SOAP Processor or the target service - if we had to do it) there would be no instance of the SOAP Response Object and no SOAP Response contents that the Client was waiting for.
But, since the SOAP Response Object was instantiated by the SOAP Handler much before passing to the SOAP Processor, any error that occured in the SOAP Processor or the target service will be added to the soapResponseData object and passed as a response to the Client.
Any differences??
Rgds,
Sandeep