Actually I ddn't have to write a transport, but still have a problem. I injected a MessageDispatcher into my Mina IoHandler and in the (overridden) messageReceived method I added this code:
Code:
WebServiceMessageFactory webServiceMessageFactory = new PoxMessageFactory();
PoxMessage poxMessage = new PoxMessageImpl(requestPayload);
MessageContext messageContext = new DefaultMessageContext(poxMessage, webServiceMessageFactory);
messageDispatcher.receive(messageContext);
where the PoxMessageImpl is a class I wrote that implements PoxMessage that takes in an xml string:
Code:
public class PoxMessageImpl implements PoxMessage {
private String payload;
public PoxMessageImpl(String payload) {
Validate.notNull(payload, "Payload must not be null");
this.payload = payload;
}
public Result getPayloadResult() {
StringWriter writer = new StringWriter();
writer.write(payload);
return new StreamResult(writer);
}
public Source getPayloadSource() {
StringReader reader = new StringReader(payload);
return new StreamSource(reader);
}
public void writeTo(OutputStream outputStream) throws IOException {
StringReader reader = new StringReader(payload);
IOUtils.copy(reader, outputStream);
}
}
The marshalResponse(responseObject, response) method in AbstractMarshallingPayloadEndpoint (my endpoint extends this class) eventually calls marshaller.marshal(graph, message.getPayloadResult()) in Marshallingutils, however, my PoxMessageImpl getPayloadResult() returns an empty Result, as I not sure what I should be returning here. Though I can see the response object in the "graph" while debugging, currently the payload is coming back empty after this. I'm using the JibxMarshaller.
I can also see the marshalled reesponse xml from the marshalWriter(graph, streamResult.getWriter()); method in the org.springframework.oxm.AbstractMarshaller, but after it returns to the marshal method in MarshallingUtils, the payload of the response message still empty. What's missing here?
Any ideas?
Thanks