Thanks a bunch, I had to do a similar trick for my own needs, and your decision was the last, I needed to get it to work. I will describe the differences here for reference.
I was working on an endpoint that receives arbitrary XML and returns arbitrary XML. There is no sorting or disassembling as the data is considered huge . The receiving party is documented here .
Simple String container:
package our.site.etc; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name="StringResponse",namespace="http://link.to.our/schemas/service/endpoint/yyyy/mm/dd") public class StringResponse { private String responseData; public StringResponse() { ; } public StringResponse(String data) { this.responseData = data; } public String getResponseData() { return responseData; } public void setResponseData(String data) { this.responseData = data; }
}
Endpoint Method:
@PayloadRoot(localPart = LOCALPART, namespace = NAMESPACE) @ResponsePayload public @ResponseBody StringResponse receiveMessage(MessageContext messageContext) throws Exception { // do our thing: return new StringResponse(super.handleMessage(messageContext)); }
And the last touch was to omit the WSClient part, just to define the jaxb2 marshaller:
<oxm:jaxb2-marshaller id="marshaller"> <oxm:class-to-be-bound name="our.site.etc.StringResponse"/> </oxm:jaxb2-marshaller>
And now my endpoint returns the response string inside CDATA. In practice, it simply transfers data, doing minimal things for this.
user6408185
source share