How can I get the incoming XML payload as a String parameter in spring ws endpoint method? For e.g. I have the following code, notice that I get the XML as a JDOM Element, which I now need to convert to String manually. It would be nice to know how to get this automatically converted to String.
@PayloadRoot(namespace=HOLIDAY_NAMESPACE_URI, localPart="holidayRequest")
@ResponsePayload
public Element handleHolidayRequest(@RequestPayload Element holidayRequest)
//public Element handleHolidayRequest(@XPathParam("holidayRequest") String holidayRequest)
{
System.out.println("In handleHolidayRequest method with payload: " + holidayRequest);
return getHolidayResponse(HOLIDAY_NAMESPACE);
}
The commented out method signature, is just me trying out XPath, which also did not work in the way I expected.