Search in sources :

Example 1 with Hello_Service

use of client.soap_mu_header.client.Hello_Service in project metro-jax-ws by eclipse-ee4j.

the class SoapMuHeaderTest method testMUHeaderInWSDL.

public void testMUHeaderInWSDL() {
    Hello_Service service = new Hello_Service();
    Hello port = service.getHelloPort();
    Holder<String> extra = new Holder<String>();
    port.hello("extra", extra);
}
Also used : Hello(client.soap_mu_header.client.Hello) Hello_Service(client.soap_mu_header.client.Hello_Service) Holder(jakarta.xml.ws.Holder)

Example 2 with Hello_Service

use of client.soap_mu_header.client.Hello_Service in project metro-jax-ws by eclipse-ee4j.

the class SoapMuHeaderTest method testMUHeaderInWSDLDispatchMessageMode.

/**
 * For Message mode, extra MU headers are ignored for MU processing to let client apps deal with it.
 */
public void testMUHeaderInWSDLDispatchMessageMode() {
    Hello_Service service = new Hello_Service();
    Dispatch<SOAPMessage> dispatch = service.createDispatch(portQName, SOAPMessage.class, Service.Mode.MESSAGE);
    SOAPMessage in = null;
    try {
        in = getSOAPMessage(makeStreamSource(message1));
    } catch (Exception e) {
        fail(e.getMessage());
    }
    SOAPMessage out = dispatch.invoke(in);
}
Also used : Hello_Service(client.soap_mu_header.client.Hello_Service) SOAPMessage(jakarta.xml.soap.SOAPMessage) SOAPFaultException(jakarta.xml.ws.soap.SOAPFaultException)

Example 3 with Hello_Service

use of client.soap_mu_header.client.Hello_Service in project metro-jax-ws by eclipse-ee4j.

the class SoapMuHeaderTest method testMUHeaderNotInWSDL.

public void testMUHeaderNotInWSDL() {
    Hello_Service service = new Hello_Service();
    Hello port = service.getHelloPort();
    Holder<String> extra = new Holder<String>();
    try {
        port.hello("extraMU", extra);
        fail("MU Exception expected");
    } catch (SOAPFaultException e) {
        assertTrue(e.getFault().getFaultCode().endsWith(":MustUnderstand"));
    }
}
Also used : Hello(client.soap_mu_header.client.Hello) Hello_Service(client.soap_mu_header.client.Hello_Service) Holder(jakarta.xml.ws.Holder) SOAPFaultException(jakarta.xml.ws.soap.SOAPFaultException)

Example 4 with Hello_Service

use of client.soap_mu_header.client.Hello_Service in project metro-jax-ws by eclipse-ee4j.

the class SoapMuHeaderTest method testMUHeaderNotInWSDLDispatchMessageMode.

/**
 * For Message mode, extra MU headers are ignored for MU processing to let client apps deal with it.
 */
public void testMUHeaderNotInWSDLDispatchMessageMode() {
    Hello_Service service = new Hello_Service();
    Dispatch<SOAPMessage> dispatch = service.createDispatch(portQName, SOAPMessage.class, Service.Mode.MESSAGE);
    SOAPMessage in = null;
    try {
        in = getSOAPMessage(makeStreamSource(message2));
    } catch (Exception e) {
        fail(e.getMessage());
    }
    SOAPMessage out = dispatch.invoke(in);
}
Also used : Hello_Service(client.soap_mu_header.client.Hello_Service) SOAPMessage(jakarta.xml.soap.SOAPMessage) SOAPFaultException(jakarta.xml.ws.soap.SOAPFaultException)

Example 5 with Hello_Service

use of client.soap_mu_header.client.Hello_Service in project metro-jax-ws by eclipse-ee4j.

the class SoapMuHeaderTest method testMUHeaderNotInWSDLDispatchPayloadMode.

/**
 * With Dispatch palyload mode, All MU headers (even described in WSDL binding) are not not understood by default.
 */
public void testMUHeaderNotInWSDLDispatchPayloadMode() {
    Hello_Service service = new Hello_Service();
    Dispatch<Source> dispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD);
    Source in = null;
    try {
        in = makeStreamSource(payload2);
    } catch (Exception e) {
        fail(e.getMessage());
    }
    try {
        Source out = dispatch.invoke(in);
        fail("MU Exception expected");
    } catch (SOAPFaultException e) {
        assertTrue(e.getFault().getFaultCode().endsWith(":MustUnderstand"));
    }
}
Also used : Hello_Service(client.soap_mu_header.client.Hello_Service) SOAPFaultException(jakarta.xml.ws.soap.SOAPFaultException) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source) SOAPFaultException(jakarta.xml.ws.soap.SOAPFaultException)

Aggregations

Hello_Service (client.soap_mu_header.client.Hello_Service)6 SOAPFaultException (jakarta.xml.ws.soap.SOAPFaultException)5 Hello (client.soap_mu_header.client.Hello)2 SOAPMessage (jakarta.xml.soap.SOAPMessage)2 Holder (jakarta.xml.ws.Holder)2 Source (javax.xml.transform.Source)2 StreamSource (javax.xml.transform.stream.StreamSource)2