Search in sources :

Example 21 with BindingImpl

use of com.sun.xml.ws.binding.BindingImpl in project metro-jax-ws by eclipse-ee4j.

the class AddNumbersClient method testFaultToRefpsWithWSDL.

// bug RespectBindingFeature will turn off enabled features in the wsdl
// but not features that have been explicitly set by the client
public void testFaultToRefpsWithWSDL() throws Exception {
    try {
        MemberSubmissionAddressingFeature addressingFeature = new MemberSubmissionAddressingFeature(true);
        RespectBindingFeature bindingFeature = new RespectBindingFeature(false);
        WebServiceFeature[] features = new WebServiceFeature[] { addressingFeature, bindingFeature };
        Dispatch dispatch = createDispatchWithWSDL(features);
        BindingImpl binding = (BindingImpl) dispatch.getBinding();
        boolean enabled = AddressingVersion.isEnabled(binding);
        if (enabled) {
            System.out.println("Addressing is Enabled");
        } else {
            System.out.println("Addressing is disabled");
        }
        assertTrue(enabled == true);
        WsaUtils.invoke(dispatch, WsaUtils.FAULT_TO_REFPS_MESSAGE, WsaUtils.S11_NS, WsaUtils.W3C_WSA_NS, getAddress(), W3CAddressingConstants.WSA_ANONYMOUS_ADDRESS, W3CAddressingConstants.WSA_ANONYMOUS_ADDRESS, CORRECT_ACTION);
        fail("SOAPFaultException must be thrown");
    } catch (SOAPFaultException sfe) {
        assertTrue("Got SOAPFaultException", true);
    }
}
Also used : BindingImpl(com.sun.xml.ws.binding.BindingImpl) RespectBindingFeature(jakarta.xml.ws.RespectBindingFeature) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) Dispatch(jakarta.xml.ws.Dispatch) SOAPFaultException(jakarta.xml.ws.soap.SOAPFaultException) MemberSubmissionAddressingFeature(com.sun.xml.ws.developer.MemberSubmissionAddressingFeature)

Aggregations

BindingImpl (com.sun.xml.ws.binding.BindingImpl)21 WebServiceFeature (jakarta.xml.ws.WebServiceFeature)6 HandlerConfiguration (com.sun.xml.ws.client.HandlerConfiguration)5 Dispatch (jakarta.xml.ws.Dispatch)4 SOAPBindingImpl (com.sun.xml.ws.binding.SOAPBindingImpl)3 MemberSubmissionAddressingFeature (com.sun.xml.ws.developer.MemberSubmissionAddressingFeature)3 AddressingFeature (jakarta.xml.ws.soap.AddressingFeature)3 SOAPFaultException (jakarta.xml.ws.soap.SOAPFaultException)3 BindingID (com.sun.xml.ws.api.BindingID)2 ComponentFeature (com.sun.xml.ws.api.ComponentFeature)2 ComponentsFeature (com.sun.xml.ws.api.ComponentsFeature)2 MessageHandler (com.sun.xml.ws.api.handler.MessageHandler)2 Packet (com.sun.xml.ws.api.message.Packet)2 ClientTubeAssemblerContext (com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext)2 WebServiceFeatureList (com.sun.xml.ws.binding.WebServiceFeatureList)2 RespectBindingFeature (jakarta.xml.ws.RespectBindingFeature)2 WebServiceException (jakarta.xml.ws.WebServiceException)2 SOAPHandler (jakarta.xml.ws.handler.soap.SOAPHandler)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 WSBinding (com.sun.xml.ws.api.WSBinding)1