log.info(transformer.toString(elem));
} catch (Exception e) {
throw new MessagingException(e);
}
assertEquals(new QName("uri:HelloWorld", "HelloRequest"), DomUtil.getQName(elem));
out.setContent(new StringSource("<HelloResponse xmlns='uri:HelloWorld'>world</HelloResponse>"));
return true;
}
};
mock.setCopyProperties(false);
mock.setService(new QName("urn:test", "echo"));
mock.setEndpoint("endpoint");
container.activateComponent(mock, "mock");
PostMethod post = new PostMethod("http://localhost:8192/ep2/");
post.setRequestEntity(
new StringRequestEntity("<s:Envelope xmlns:s='http://www.w3.org/2003/05/soap-envelope'>"
+ "<s:Header><HelloHeader xmlns='uri:HelloWorld'/></s:Header>"
+ "<s:Body><HelloRequest xmlns='uri:HelloWorld'>world</HelloRequest></s:Body>"
+ "</s:Envelope>"));
new HttpClient().executeMethod(post);
String res = post.getResponseBodyAsString();
log.info(res);
Element elem = transformer.toDOMElement(new StringSource(res));
assertEquals(Soap12.getInstance().getEnvelope(), DomUtil.getQName(elem));
elem = DomUtil.getFirstChildElement(elem);
assertEquals(Soap12.getInstance().getBody(), DomUtil.getQName(elem));
elem = DomUtil.getFirstChildElement(elem);
assertEquals(new QName("uri:HelloWorld", "HelloResponse"), DomUtil.getQName(elem));