use of jakarta.xml.ws.Dispatch in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloLiteralTest method testHelloAsyncPollDoneJAXB.
public void testHelloAsyncPollDoneJAXB() throws Exception {
JAXBContext jc = createJAXBContext();
Hello_Type hello = new Hello_Type();
HelloResponse helloResult = new HelloResponse();
hello.setExtra("Test ");
hello.setArgument("Dispatch ");
Dispatch dispatch = getDispatchJAXB();
Response result = dispatch.invokeAsync(hello);
while (!result.isDone()) {
}
Object obj = result.get();
HelloResponse res = (HelloResponse) obj;
assertEquals(res.getExtra(), hello.getExtra());
assertEquals(res.getArgument(), hello.getArgument());
}
use of jakarta.xml.ws.Dispatch in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloLiteralTest method testVoidOnewayRequestJAXB.
public void testVoidOnewayRequestJAXB() {
JAXBContext jc = null;
VoidTest voidTest = null;
try {
jc = createJAXBContext();
voidTest = new VoidTest();
} catch (Exception jbe) {
jbe.printStackTrace();
}
Dispatch dispatch = getDispatchJAXB();
try {
dispatch.invokeOneWay(voidTest);
} catch (Exception e) {
fail("testVoidOnewayRequestJAXB with exception " + e.getMessage());
}
}
use of jakarta.xml.ws.Dispatch in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloLiteralTest method testVoidOnewayRequestXML.
public void testVoidOnewayRequestXML() {
Dispatch dispatch = getDispatchSource();
Collection<Source> sourceList = makeMsgSource(voidMsg);
for (Iterator iter = sourceList.iterator(); iter.hasNext(); ) {
try {
Object sourceObject = iter.next();
dispatch.invokeOneWay(sourceObject);
} catch (Exception e) {
fail("testVoidOnewayRequestXML with exception " + e.getMessage());
}
}
}
use of jakarta.xml.ws.Dispatch in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloLiteralTest method testHelloOnewayRequestXML.
public void testHelloOnewayRequestXML() {
Dispatch dispatch = getDispatchSource();
Collection<Source> sourceList = makeMsgSource(helloMsg);
for (Iterator iter = sourceList.iterator(); iter.hasNext(); ) {
try {
Object sourceObject = iter.next();
dispatch.invokeOneWay(sourceObject);
} catch (Exception e) {
fail("testHelloOnewayRequestXML with exception " + e.getMessage());
}
}
}
use of jakarta.xml.ws.Dispatch in project metro-jax-ws by eclipse-ee4j.
the class DispatchHeaderTest method testEcho4SOAPMessage.
public void testEcho4SOAPMessage() throws Exception {
init(endpointAddress, portQName, serviceQName, null);
Dispatch dispatch = getDispatchSOAPMessage();
assertTrue(dispatch != null);
assertTrue(dispatch instanceof com.sun.xml.ws.client.dispatch.SOAPMessageDispatch);
// not sure why doing this
byte[] bytes = echo4RequestSM.getBytes();
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
// not sure why doint that above
Source source = makeStreamSource(echo4RequestSM);
SOAPMessage message = getSOAPMessage(source);
Object result = dispatch.invoke(message);
// todo:need to check contents
System.out.println("Printing out received header");
assertTrue(result instanceof SOAPMessage);
((SOAPMessage) result).writeTo(System.out);
}
Aggregations