e = DOMUtils.getFirstChildElement(e);
assertEquals(new QName(SoapMarshaler.SOAP_11_URI, SoapMarshaler.FAULT), DOMUtil.getQName(e));
}
public void testSoapXml() throws Exception {
ReceiverComponent echo = new ReceiverComponent();
echo.setService(new QName("urn:test", "echo"));
echo.setEndpoint("echo");
container.activateComponent(echo, "echo");
HttpEndpoint ep1 = createInOnlyEndpoint("ep1");
ep1.setTargetService(new QName("urn:test", "echo"));
ep1.setTargetEndpoint("echo");
ep1.setLocationURI("http://localhost:8193/ep1/");
ep1.setRoleAsString("consumer");
ep1.setSoap(false);
HttpEndpoint ep2 = createInOnlyEndpoint("ep2");
ep2.setTargetService(new QName("urn:test", "http"));
ep2.setTargetEndpoint("ep3");
ep2.setLocationURI("http://localhost:8193/ep2/");
ep2.setRoleAsString("consumer");
ep2.setSoap(true);
HttpEndpoint ep3 = createInOnlyEndpoint("ep3");
ep3.setLocationURI("http://localhost:8193/ep1/");
ep3.setRoleAsString("provider");
ep3.setSoap(true);
HttpComponent http = new HttpComponent();
http.setEndpoints(new HttpEndpoint[] {ep1, ep2, ep3});
container.activateComponent(http, "http1");
container.start();
PostMethod method = new PostMethod("http://localhost:8193/ep2/");
method.setRequestEntity(new InputStreamRequestEntity(getClass().getResourceAsStream("request.xml")));
new HttpClient().executeMethod(method);
echo.getMessageList().assertMessagesReceived(1);
List msgs = echo.getMessageList().flushMessages();
NormalizedMessage msg = (NormalizedMessage) msgs.get(0);
SourceTransformer st = new SourceTransformer();
Element e = st.toDOMElement(msg);
String strMsg = DOMUtil.asXML(e);
logger.info(strMsg);