Search in sources :

Example 1 with SOAPBindingImpl

use of org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl in project cxf by apache.

the class JaxWsEndpointImpl method createJaxwsBinding.

final void createJaxwsBinding() {
    if (getBinding() instanceof SoapBinding) {
        jaxwsBinding = new SOAPBindingImpl(getEndpointInfo().getBinding(), this);
        MTOMFeature mtomFeature = getMTOMFeature();
        if (mtomFeature != null && mtomFeature.isEnabled()) {
            ((SOAPBinding) jaxwsBinding).setMTOMEnabled(true);
        }
    } else if (getBinding() instanceof XMLBinding) {
        jaxwsBinding = new HTTPBindingImpl(getEndpointInfo().getBinding(), this);
    } else {
        // REVISIT: Should not get here, though some bindings like JBI
        // did not implement their own Binding type.
        jaxwsBinding = new DefaultBindingImpl(this);
    }
}
Also used : MTOMFeature(javax.xml.ws.soap.MTOMFeature) SOAPBinding(javax.xml.ws.soap.SOAPBinding) DefaultBindingImpl(org.apache.cxf.jaxws.binding.DefaultBindingImpl) SOAPBindingImpl(org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl) XMLBinding(org.apache.cxf.binding.xml.XMLBinding) SoapBinding(org.apache.cxf.binding.soap.SoapBinding) HTTPBindingImpl(org.apache.cxf.jaxws.binding.http.HTTPBindingImpl)

Example 2 with SOAPBindingImpl

use of org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl in project cxf by apache.

the class ClientMtomXopTest method createPort.

private <T> T createPort(QName serviceName, QName portName, Class<T> serviceEndpointInterface, boolean enableMTOM, boolean installInterceptors) throws Exception {
    ReflectionServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
    Bus bus = getStaticBus();
    LoggingFeature lf = new LoggingFeature();
    lf.setPrettyLogging(false);
    lf.setLogBinary(false);
    lf.setLogMultipart(true);
    bus.getFeatures().add(lf);
    serviceFactory.setBus(bus);
    serviceFactory.setServiceName(serviceName);
    serviceFactory.setServiceClass(serviceEndpointInterface);
    serviceFactory.setWsdlURL(ClientMtomXopTest.class.getResource("/wsdl/mtom_xop.wsdl"));
    Service service = serviceFactory.create();
    EndpointInfo ei = service.getEndpointInfo(portName);
    JaxWsEndpointImpl jaxwsEndpoint = new JaxWsEndpointImpl(bus, service, ei);
    SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding(), jaxwsEndpoint);
    jaxWsSoapBinding.setMTOMEnabled(enableMTOM);
    if (installInterceptors) {
        // jaxwsEndpoint.getBinding().getInInterceptors().add(new TestMultipartMessageInterceptor());
        jaxwsEndpoint.getBinding().getOutInterceptors().add(new TestAttachmentOutInterceptor());
    }
    jaxwsEndpoint.getBinding().getInInterceptors().add(new LoggingInInterceptor());
    jaxwsEndpoint.getBinding().getOutInterceptors().add(new LoggingOutInterceptor());
    Client client = new ClientImpl(bus, jaxwsEndpoint);
    InvocationHandler ih = new JaxWsClientProxy(client, jaxwsEndpoint.getJaxwsBinding());
    Object obj = Proxy.newProxyInstance(serviceEndpointInterface.getClassLoader(), new Class[] { serviceEndpointInterface, BindingProvider.class }, ih);
    updateAddressPort(obj, PORT);
    return serviceEndpointInterface.cast(obj);
}
Also used : Bus(org.apache.cxf.Bus) JaxWsServiceFactoryBean(org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean) Service(org.apache.cxf.service.Service) SOAPBinding(javax.xml.ws.soap.SOAPBinding) ClientImpl(org.apache.cxf.endpoint.ClientImpl) InvocationHandler(java.lang.reflect.InvocationHandler) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) JaxWsEndpointImpl(org.apache.cxf.jaxws.support.JaxWsEndpointImpl) JaxWsClientProxy(org.apache.cxf.jaxws.JaxWsClientProxy) LoggingOutInterceptor(org.apache.cxf.ext.logging.LoggingOutInterceptor) LoggingFeature(org.apache.cxf.ext.logging.LoggingFeature) LoggingInInterceptor(org.apache.cxf.ext.logging.LoggingInInterceptor) SOAPBindingImpl(org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl) Client(org.apache.cxf.endpoint.Client) ReflectionServiceFactoryBean(org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean)

Aggregations

SOAPBinding (javax.xml.ws.soap.SOAPBinding)2 SOAPBindingImpl (org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl)2 InvocationHandler (java.lang.reflect.InvocationHandler)1 MTOMFeature (javax.xml.ws.soap.MTOMFeature)1 Bus (org.apache.cxf.Bus)1 SoapBinding (org.apache.cxf.binding.soap.SoapBinding)1 XMLBinding (org.apache.cxf.binding.xml.XMLBinding)1 Client (org.apache.cxf.endpoint.Client)1 ClientImpl (org.apache.cxf.endpoint.ClientImpl)1 LoggingFeature (org.apache.cxf.ext.logging.LoggingFeature)1 LoggingInInterceptor (org.apache.cxf.ext.logging.LoggingInInterceptor)1 LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)1 JaxWsClientProxy (org.apache.cxf.jaxws.JaxWsClientProxy)1 DefaultBindingImpl (org.apache.cxf.jaxws.binding.DefaultBindingImpl)1 HTTPBindingImpl (org.apache.cxf.jaxws.binding.http.HTTPBindingImpl)1 JaxWsEndpointImpl (org.apache.cxf.jaxws.support.JaxWsEndpointImpl)1 JaxWsServiceFactoryBean (org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean)1 Service (org.apache.cxf.service.Service)1 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)1 ReflectionServiceFactoryBean (org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean)1