type.setString("Foo");
JAXBElement<MyType> element = new JAXBElement<MyType>(new QName("http://springframework.org", "type"), MyType.class, type);
processor.handleReturnValue(messageContext, supportedReturnType, element);
assertTrue("context has no response", messageContext.hasResponse());
AxiomSoapMessage response = (AxiomSoapMessage) messageContext.getResponse();
Transformer transformer = TransformerFactory.newInstance().newTransformer();
StringResult payloadResult = new StringResult();
transformer.transform(response.getPayloadSource(), payloadResult);
assertXMLEqual("<type xmlns='http://springframework.org'><string>Foo</string></type>",
payloadResult.toString());
ByteArrayOutputStream bos = new ByteArrayOutputStream();
response.writeTo(bos);
String messageResult = bos.toString("UTF-8");
assertXMLEqual("<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body>" +
"<type xmlns='http://springframework.org'><string>Foo</string></type>" +
"</soapenv:Body></soapenv:Envelope>", messageResult);