use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloClientTest method createDispatchJAXB.
private Dispatch createDispatchJAXB() {
try {
JAXBContext context = DispatchHelloClientTest.createJAXBContext();
dispatch = service.createDispatch(portQName, context, Service.Mode.PAYLOAD);
} catch (WebServiceException e) {
e.printStackTrace();
}
return dispatch;
}
use of jakarta.xml.ws.WebServiceException 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.WebServiceException 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.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class DispatchHello method testBadHelloRequestResponseXML.
// no arg- extra
public void testBadHelloRequestResponseXML() throws WebServiceException {
System.err.println("----------------Expected Message ----------------------");
Dispatch dispatch = getDispatchSource();
Source source = null;
Source response = null;
try {
source = makeStreamSource(badhelloMsg);
response = makeStreamSource(helloResponse);
} catch (Exception e) {
System.out.println("Error making msg source exiting");
return;
}
try {
Object result = dispatch.invoke(source);
assertTrue(result == null);
// System.out.println("BadHelloRequestResponseXML FAILED");
} catch (Exception e) {
assertTrue(e instanceof WebServiceException);
System.out.println("BadHelloRequestResponseXML PASSED");
}
System.err.println("----------------END Expected Message ----------------------");
}
use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class DispatchHello method testHelloRequestResponseJAXB.
public void testHelloRequestResponseJAXB() throws Exception {
JAXBContext jc = null;
HelloResponse helloResult = null;
Hello_Type hello = new Hello_Type();
jc = createJAXBContext();
try {
hello.setArgument("foo");
hello.setExtra("Test ");
Dispatch dispatch = getDispatchJAXB();
helloResult = (HelloResponse) dispatch.invoke(hello);
// assertEquals(((HelloResponse) result).getExtra(), hello.getExtra());
// assertEquals(((HelloResponse) result).getArgument(), hello.getArgument());
} catch (WebServiceException jex) {
fail("testHelloRequestResponseJAXB FAILED");
}
}
Aggregations