Search in sources :

Example 56 with WebServiceException

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;
}
Also used : WebServiceException(jakarta.xml.ws.WebServiceException) JAXBContext(jakarta.xml.bind.JAXBContext)

Example 57 with WebServiceException

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;
}
Also used : WebServiceException(jakarta.xml.ws.WebServiceException) JAXBContext(jakarta.xml.bind.JAXBContext)

Example 58 with WebServiceException

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");
    }
}
Also used : WebServiceException(jakarta.xml.ws.WebServiceException) JAXBException(jakarta.xml.bind.JAXBException) Dispatch(jakarta.xml.ws.Dispatch) JAXBContext(jakarta.xml.bind.JAXBContext) MalformedURLException(java.net.MalformedURLException) WebServiceException(jakarta.xml.ws.WebServiceException) JAXBException(jakarta.xml.bind.JAXBException) SOAPFaultException(jakarta.xml.ws.soap.SOAPFaultException)

Example 59 with WebServiceException

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 ----------------------");
}
Also used : Dispatch(jakarta.xml.ws.Dispatch) SOAPFaultException(jakarta.xml.ws.soap.SOAPFaultException) Source(javax.xml.transform.Source) MalformedURLException(java.net.MalformedURLException) WebServiceException(jakarta.xml.ws.WebServiceException) JAXBException(jakarta.xml.bind.JAXBException) SOAPFaultException(jakarta.xml.ws.soap.SOAPFaultException)

Example 60 with WebServiceException

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");
    }
}
Also used : WebServiceException(jakarta.xml.ws.WebServiceException) Dispatch(jakarta.xml.ws.Dispatch) JAXBContext(jakarta.xml.bind.JAXBContext)

Aggregations

WebServiceException (jakarta.xml.ws.WebServiceException)396 QName (javax.xml.namespace.QName)50 SOAPFaultException (jakarta.xml.ws.soap.SOAPFaultException)38 SOAPException (jakarta.xml.soap.SOAPException)35 JAXBException (jakarta.xml.bind.JAXBException)30 IOException (java.io.IOException)30 Node (org.w3c.dom.Node)29 JAXBContext (jakarta.xml.bind.JAXBContext)27 SOAPMessage (jakarta.xml.soap.SOAPMessage)26 XMLStreamException (javax.xml.stream.XMLStreamException)25 Source (javax.xml.transform.Source)23 ProtocolException (jakarta.xml.ws.ProtocolException)20 Dispatch (jakarta.xml.ws.Dispatch)19 MalformedURLException (java.net.MalformedURLException)19 URL (java.net.URL)18 Map (java.util.Map)18 MessageContext (jakarta.xml.ws.handler.MessageContext)17 StreamSource (javax.xml.transform.stream.StreamSource)17 HandlerTracker (fromwsdl.handler.common.HandlerTracker)14 HandlerTracker (handler.handler_processing.common.HandlerTracker)14