InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq.xml");
InputSource inputSource = new InputSource(is);
inputSource.setPublicId(getClass()
.getResource("resources/GreetMeDocLiteralSOAPBodyReq.xml").toString());
inputSource.setSystemId(inputSource.getPublicId());
SAXSource saxSourceReq = new SAXSource(inputSource);
assertNotNull(saxSourceReq);
SAXSource saxSourceResp = disp.invoke(saxSourceReq);
assertNotNull(saxSourceResp);
String expected = "Hello TestSOAPInputMessage";
assertTrue("Expected: " + expected, XMLUtils.toString(saxSourceResp).contains(expected));
// Test oneway
InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq1.xml");
InputSource inputSource1 = new InputSource(is1);
inputSource1.setPublicId(getClass()
.getResource("resources/GreetMeDocLiteralSOAPBodyReq1.xml").toString());
inputSource1.setSystemId(inputSource1.getPublicId());
SAXSource saxSourceReq1 = new SAXSource(inputSource1);
assertNotNull(saxSourceReq1);
disp.invokeOneWay(saxSourceReq1);
// Test async polling
InputStream is2 = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq2.xml");
InputSource inputSource2 = new InputSource(is2);
inputSource2.setPublicId(getClass()
.getResource("resources/GreetMeDocLiteralSOAPBodyReq2.xml").toString());
inputSource2.setSystemId(inputSource2.getPublicId());
SAXSource saxSourceReq2 = new SAXSource(inputSource2);
assertNotNull(saxSourceReq2);
Response<SAXSource> response = disp.invokeAsync(saxSourceReq2);
SAXSource saxSourceResp2 = response.get();
assertNotNull(saxSourceResp2);
String expected2 = "Hello TestSOAPInputMessage2";
assertTrue("Expected: " + expected, XMLUtils.toString(saxSourceResp2).contains(expected2));
// Test async callback
InputStream is3 = getClass().getResourceAsStream("resources/GreetMeDocLiteralSOAPBodyReq3.xml");
InputSource inputSource3 = new InputSource(is3);
inputSource3.setPublicId(getClass()
.getResource("resources/GreetMeDocLiteralSOAPBodyReq3.xml").toString());
inputSource3.setSystemId(inputSource3.getPublicId());
SAXSource saxSourceReq3 = new SAXSource(inputSource3);
assertNotNull(saxSourceReq3);
TestSAXSourceHandler tssh = new TestSAXSourceHandler();
Future<?> fd = disp.invokeAsync(saxSourceReq3, tssh);
assertNotNull(fd);
waitForFuture(fd);
String expected3 = "Hello TestSOAPInputMessage3";
SAXSource saxSourceResp3 = tssh.getSAXSource();
assertNotNull(saxSourceResp3);
assertTrue("Expected: " + expected, XMLUtils.toString(saxSourceResp3).contains(expected3));
}