Search in sources :

Example 86 with WebServiceException

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

Example 87 with WebServiceException

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

Example 88 with WebServiceException

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

Example 89 with WebServiceException

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

Example 90 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();
        helloResult = (HelloResponse) dispatch.invoke(hello);
    // assertEquals(((HelloResponse) result).getExtra(), hello.getExtra());
    // assertEquals(((HelloResponse) result).getArgument(), hello.getArgument());
    } catch (WebServiceException jex) {
        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)386 QName (javax.xml.namespace.QName)49 SOAPFaultException (jakarta.xml.ws.soap.SOAPFaultException)36 SOAPException (jakarta.xml.soap.SOAPException)33 JAXBException (jakarta.xml.bind.JAXBException)30 Node (org.w3c.dom.Node)28 JAXBContext (jakarta.xml.bind.JAXBContext)27 IOException (java.io.IOException)26 SOAPMessage (jakarta.xml.soap.SOAPMessage)25 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 MessageContext (jakarta.xml.ws.handler.MessageContext)17 Map (java.util.Map)17 URL (java.net.URL)16 StreamSource (javax.xml.transform.stream.StreamSource)16 HandlerTracker (fromwsdl.handler.common.HandlerTracker)14 HandlerTracker (handler.handler_processing.common.HandlerTracker)14