Search in sources :

Example 6 with Hello_Service

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

the class SoapMuHeaderTest method testMUHeaderInWSDLDispatchPayloadMode.

/**
 * With Dispatch palyload mode, All MU headers (even described in WSDL binding) are not not understood by default.
 */
public void testMUHeaderInWSDLDispatchPayloadMode() {
    Hello_Service service = new Hello_Service();
    Dispatch<Source> dispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD);
    Source in = null;
    try {
        in = makeStreamSource(payload1);
    } 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