For a webservice client in Spring we had to grab the XML being sent to the called system, So we wrote Interceptors that used to grab the XML and we use to log it.
Possibly you can write Interceptors that can grab and give you the request XML before the Unmarshallers deserialize the XML into java objects.
Hope it points to some solution
Joined: Aug 03, 2006
Thanks a lot Vivek for pointing to interceptor. I will be using that to capture the incomig XML.
Also, I have once more doubt. is it possible to send an already created XML file in the response without calling the marshaller to create the XML from the java object. However, the incoming request should go though the normal unmarshalling process. If I don't set the marshaller property in the applicationContext will it work that way?
You can register an EndpointInterceptor with spring-ws and manipulate the response to your liking. I think Spring-WS will try to add SOAP stuff to your XML (as it is SOAP centric implementation), So you will have to use interceptors.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com