use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class DispatchHello method createDispatchJAXBPortsAvailable.
private Dispatch createDispatchJAXBPortsAvailable() {
try {
JAXBContext context = createJAXBContext();
dispatch = serviceWithPorts.createDispatch(portQName, context, Service.Mode.PAYLOAD);
} catch (WebServiceException e) {
fail("Error creating JABDispatch");
}
return dispatch;
}
use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class DispatchHello method createDispatchJAXB.
private Dispatch createDispatchJAXB() {
try {
JAXBContext context = createJAXBContext();
dispatch = service.createDispatch(portQName, context, Service.Mode.PAYLOAD);
} catch (WebServiceException e) {
fail("Error creating JABDispatch");
}
return dispatch;
}
use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class DispatchHello method testNoParamHelloRequestResponseJAXB.
public void testNoParamHelloRequestResponseJAXB() throws Throwable {
JAXBContext jc = null;
Hello_Type hello = null;
HelloResponse helloResult = null;
try {
jc = createJAXBContext();
hello = new Hello_Type();
helloResult = new HelloResponse();
} catch (Exception jbe) {
assertTrue(jbe instanceof JAXBException);
}
try {
// no hello args
Dispatch dispatch = getDispatchJAXB();
Object result = dispatch.invoke(null);
assertTrue(result == null);
// System.out.println("NoParamHelloRequestResponseJAXB FAILED");
} catch (Exception e) {
assertTrue(e instanceof WebServiceException);
System.out.println("NoParamHelloRequestResponseJAXB PASSED");
}
}
use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class DispatchHello method testSQETestXML.
public void testSQETestXML() throws WebServiceException, Exception {
// System.err.println("----------------Expected Message ----------------------");
Dispatch dispatch = getDispatchSource();
Source source = null;
Source response = null;
try {
source = makeStreamSource(sqeTest);
} catch (Exception e) {
System.out.println("Error making msg source exiting");
}
try {
Object result = dispatch.invoke(source);
String xmlResult = sourceToXMLString((Source) result);
System.out.println("Got result : " + xmlResult);
assertTrue(result == null);
System.out.println("sqeXML Passed");
} catch (Exception ex) {
assertTrue(ex instanceof SOAPFaultException);
}
// 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();
Object result = dispatch.invoke(hello);
assertEquals(((HelloResponse) result).getExtra(), hello.getExtra());
assertEquals(((HelloResponse) result).getArgument(), hello.getArgument());
} catch (WebServiceException jex) {
jex.printStackTrace();
fail("testHelloRequestResponseJAXB FAILED");
}
}
Aggregations