Search in sources :

Example 1 with BindingImpl

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

the class FeatureListValidatorTest method testAddsAddressing.

public void testAddsAddressing() {
    BindingImpl binding = BindingImpl.create(BindingID.SOAP11_HTTP, new WebServiceFeature[] { new AddsAddressingFeature() });
    assertTrue("AddressingFeature must be enabled because AddsAddressingFeature was passed", binding.isFeatureEnabled(AddressingFeature.class));
}
Also used : BindingImpl(com.sun.xml.ws.binding.BindingImpl) AddressingFeature(jakarta.xml.ws.soap.AddressingFeature)

Example 2 with BindingImpl

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

the class FeatureListValidatorTest method testAddsAddressingAlreadyPresent.

public void testAddsAddressingAlreadyPresent() {
    BindingImpl binding = BindingImpl.create(BindingID.SOAP11_HTTP, new WebServiceFeature[] { new AddsAddressingFeature(), new AddressingFeature() });
    assertTrue("AddressingFeature must be enabled because AddsAddressingFeature was passed", binding.isFeatureEnabled(AddressingFeature.class));
}
Also used : BindingImpl(com.sun.xml.ws.binding.BindingImpl) AddressingFeature(jakarta.xml.ws.soap.AddressingFeature)

Example 3 with BindingImpl

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

the class Stub method createPipeline.

/**
 * Creates a new pipeline for the given port name.
 */
private Tube createPipeline(WSPortInfo portInfo, WSBinding binding) {
    // Check all required WSDL extensions are understood
    checkAllWSDLExtensionsUnderstood(portInfo, binding);
    SEIModel seiModel = null;
    Class sei = null;
    if (portInfo instanceof SEIPortInfo) {
        SEIPortInfo sp = (SEIPortInfo) portInfo;
        seiModel = sp.model;
        sei = sp.sei;
    }
    BindingID bindingId = portInfo.getBindingId();
    TubelineAssembler assembler = TubelineAssemblerFactory.create(Thread.currentThread().getContextClassLoader(), bindingId, owner.getContainer());
    if (assembler == null) {
        // TODO: i18n
        throw new WebServiceException("Unable to process bindingID=" + bindingId);
    }
    return assembler.createClient(new ClientTubeAssemblerContext(portInfo.getEndpointAddress(), portInfo.getPort(), this, binding, owner.getContainer(), ((BindingImpl) binding).createCodec(), seiModel, sei));
}
Also used : SEIModel(com.sun.xml.ws.api.model.SEIModel) BindingImpl(com.sun.xml.ws.binding.BindingImpl) WebServiceException(jakarta.xml.ws.WebServiceException) TubelineAssembler(com.sun.xml.ws.api.pipe.TubelineAssembler) BindingID(com.sun.xml.ws.api.BindingID) ClientTubeAssemblerContext(com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext)

Example 4 with BindingImpl

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

the class WSServiceDelegate method createDispatch.

public <T> Dispatch<T> createDispatch(QName portName, WSEndpointReference wsepr, Class<T> aClass, Service.Mode mode, WebServiceFeatureList features) {
    PortInfo port = safeGetPort(portName);
    ComponentFeature cf = features.get(ComponentFeature.class);
    if (cf != null && !Target.STUB.equals(cf.getTarget())) {
        throw new IllegalArgumentException();
    }
    ComponentsFeature csf = features.get(ComponentsFeature.class);
    if (csf != null) {
        for (ComponentFeature cfi : csf.getComponentFeatures()) {
            if (!Target.STUB.equals(cfi.getTarget()))
                throw new IllegalArgumentException();
        }
    }
    features.addAll(this.features);
    BindingImpl binding = port.createBinding(features, null, null);
    binding.setMode(mode);
    Dispatch<T> dispatch = Stubs.createDispatch(port, this, binding, aClass, mode, wsepr);
    serviceInterceptor.postCreateDispatch((WSBindingProvider) dispatch);
    return dispatch;
}
Also used : BindingImpl(com.sun.xml.ws.binding.BindingImpl) ComponentFeature(com.sun.xml.ws.api.ComponentFeature) ComponentsFeature(com.sun.xml.ws.api.ComponentsFeature)

Example 5 with BindingImpl

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

the class WSServiceDelegate method createEndpointIFBaseProxy.

private <T> T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr, QName portName, Class<T> portInterface, WebServiceFeatureList webServiceFeatures, SEIPortInfo eif) {
    // fail if service doesnt have WSDL
    if (wsdlService == null) {
        throw new WebServiceException(ClientMessages.INVALID_SERVICE_NO_WSDL(serviceName));
    }
    if (wsdlService.get(portName) == null) {
        throw new WebServiceException(ClientMessages.INVALID_PORT_NAME(portName, buildWsdlPortNames()));
    }
    BindingImpl binding = eif.createBinding(webServiceFeatures, portInterface);
    InvocationHandler pis = getStubHandler(binding, eif, epr);
    T proxy = createProxy(portInterface, pis);
    if (serviceInterceptor != null) {
        serviceInterceptor.postCreateProxy((WSBindingProvider) proxy, portInterface);
    }
    return proxy;
}
Also used : BindingImpl(com.sun.xml.ws.binding.BindingImpl) WebServiceException(jakarta.xml.ws.WebServiceException) InvocationHandler(java.lang.reflect.InvocationHandler)

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