use of jakarta.xml.ws.Dispatch in project metro-jax-ws by eclipse-ee4j.
the class DispatchHeaderTest method testEchoSource.
public void testEchoSource() throws Exception {
init(endpointAddress, portQName, serviceQName, null);
Source source = makeStreamSource(echoRequest);
Dispatch dispatch = getDispatchSource();
try {
System.err.println("************Expected EXCEPTION***************");
Object result = dispatch.invoke(source);
assertTrue(result == null);
} catch (Exception sfe) {
System.err.println("************End Expected EXCEPTION***************");
assertTrue(sfe instanceof SOAPFaultException);
}
}
use of jakarta.xml.ws.Dispatch in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloClientTest method testNoParamSOAPMessageSource.
public void testNoParamSOAPMessageSource() throws Exception {
Dispatch dispatch = getDispatchSOAPMessageSource();
Source source = makeStreamSource(helloSM);
try {
Object result = dispatch.invoke(null);
assertTrue(result == null);
} catch (Exception e) {
assertTrue(e instanceof WebServiceException);
System.out.println("Exception message " + e.getMessage());
}
}
use of jakarta.xml.ws.Dispatch in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloClientTest method testNOParamSOAPMessage.
public void testNOParamSOAPMessage() throws Exception {
Dispatch dispatch = getDispatchSOAPMessage();
byte[] bytes = helloSM.getBytes();
Source source = makeStreamSource(helloSM);
SOAPMessage message = getSOAPMessage(source);
try {
Object result = dispatch.invoke(null);
assertTrue(result == null);
} catch (Exception e) {
assertTrue(e instanceof WebServiceException);
System.out.println("Exception message " + e.getMessage());
}
}
use of jakarta.xml.ws.Dispatch in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloClientTest method testNoParamHelloRequestResponseJAXBNegative.
// should send empty SOAPBody here - no argument returned or perhaps server side exception
// nillable allowed message
public void testNoParamHelloRequestResponseJAXBNegative() throws Throwable {
JAXBContext jc = null;
HelloRequest hello = null;
HelloResponse helloResult = null;
try {
jc = createJAXBContext();
} catch (Exception jbe) {
fail("Problem creating jaxb context");
}
try {
// no hello args
Dispatch dispatch = getDispatchJAXB();
Object result = dispatch.invoke(null);
assertTrue(result == null);
} catch (Exception e) {
assertTrue(e instanceof SOAPFaultException);
System.out.println("NoParamHelloRequestResponseJAXBNegative PASSED");
}
}
use of jakarta.xml.ws.Dispatch in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloLiteralTest method testHelloRequestResponseSOAPMessage.
public void testHelloRequestResponseSOAPMessage() throws Exception {
Dispatch dispatch = getDispatchSOAPMessage();
byte[] bytes = helloSM.getBytes();
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
Source source = makeStreamSource(helloSM);
SOAPMessage message = getSOAPMessage12(source);
Object result = dispatch.invoke(message);
assertTrue(result instanceof SOAPMessage);
}
Aggregations