Thursday, 5 September 2013

SpringWS - Logging SoapRequest and SoapResponse in a table

SpringWS - Logging SoapRequest and SoapResponse in a table

I have a SpringWS inplementation with below enpoint implementation
@PayloadRoot(namespace="http://college.com/schema/get_XML_Request/v2",localPart="get_XML_Request")
@ResponsePayload
public JAXBElement<GetStudentResponseType>
handleStudentXML(@RequestPayload JAXBElement<GetStudentXMLRequestType>
SoapRequest)throws Exception
{
String xmlResponse = "";
com.college.get_student_xml_response.v2.ObjectFactory
objectFactory = new
com.company.schema.get_student_xml_response.v2.ObjectFactory();
com.college.schema.get_student_xml_response.v2.GetResponseType
resType = objectFactory.createGetResponseType();
return objectFactory.createGetStudentResponse(resType);
}
Here my objective is to log the request which coming to my webservice and
response which the web service sent back in a table. Is it possible to get
the SoapRequest/Soapresponse (In Soapformat) from the above method as a
String.Here am able to get the payload, but i need to log with entire
SoapRequest(with soapenvelope,body) Please anyone advice on this.

No comments:

Post a Comment