Search in sources :

Example 21 with SoapBindingInfo

use of org.apache.cxf.binding.soap.model.SoapBindingInfo in project cxf by apache.

the class SoapTransportFactory method getConduit.

public Conduit getConduit(EndpointInfo ei, EndpointReferenceType target, Bus bus) throws IOException {
    String address = target == null ? ei.getAddress() : target.getAddress().getValue();
    BindingInfo bi = ei.getBinding();
    String transId = ei.getTransportId();
    if (bi instanceof SoapBindingInfo) {
        transId = ((SoapBindingInfo) bi).getTransportURI();
        if (transId == null) {
            transId = ei.getTransportId();
        }
    }
    ConduitInitiator conduitInit;
    try {
        ConduitInitiatorManager mgr = bus.getExtension(ConduitInitiatorManager.class);
        if (StringUtils.isEmpty(address) || address.startsWith("http") || address.startsWith("jms") || address.startsWith("soap.udp")) {
            conduitInit = mgr.getConduitInitiator(mapTransportURI(transId, address));
        } else {
            conduitInit = mgr.getConduitInitiatorForUri(address);
        }
        if (conduitInit == null) {
            throw new RuntimeException(String.format(CANNOT_GET_CONDUIT_ERROR, address, transId));
        }
        return conduitInit.getConduit(ei, target, bus);
    } catch (BusException e) {
        throw new RuntimeException(String.format(CANNOT_GET_CONDUIT_ERROR, address, transId));
    }
}
Also used : BindingInfo(org.apache.cxf.service.model.BindingInfo) SoapBindingInfo(org.apache.cxf.binding.soap.model.SoapBindingInfo) ConduitInitiatorManager(org.apache.cxf.transport.ConduitInitiatorManager) SoapBindingInfo(org.apache.cxf.binding.soap.model.SoapBindingInfo) ConduitInitiator(org.apache.cxf.transport.ConduitInitiator) BusException(org.apache.cxf.BusException)

Example 22 with SoapBindingInfo

use of org.apache.cxf.binding.soap.model.SoapBindingInfo in project cxf by apache.

the class SoapTransportFactory method createEndpointInfo.

public EndpointInfo createEndpointInfo(Bus bus, ServiceInfo serviceInfo, BindingInfo b, List<?> ees) {
    String transportURI = "http://schemas.xmlsoap.org/wsdl/soap/";
    if (b instanceof SoapBindingInfo) {
        SoapBindingInfo sbi = (SoapBindingInfo) b;
        transportURI = sbi.getTransportURI();
    }
    EndpointInfo info = new SoapEndpointInfo(serviceInfo, transportURI);
    if (ees != null) {
        for (Iterator<?> itr = ees.iterator(); itr.hasNext(); ) {
            Object extensor = itr.next();
            if (SOAPBindingUtil.isSOAPAddress(extensor)) {
                final SoapAddress sa = SOAPBindingUtil.getSoapAddress(extensor);
                info.addExtensor(sa);
                info.setAddress(sa.getLocationURI());
                if (isJMSSpecAddress(sa.getLocationURI())) {
                    info.setTransportId(SoapJMSConstants.SOAP_JMS_SPECIFICIATION_TRANSPORTID);
                }
            } else {
                info.addExtensor(extensor);
            }
        }
    }
    return info;
}
Also used : EndpointInfo(org.apache.cxf.service.model.EndpointInfo) SoapAddress(org.apache.cxf.binding.soap.wsdl.extensions.SoapAddress) SoapBindingInfo(org.apache.cxf.binding.soap.model.SoapBindingInfo)

Example 23 with SoapBindingInfo

use of org.apache.cxf.binding.soap.model.SoapBindingInfo in project cxf by apache.

the class SoapTransportFactory method createPortExtensors.

public void createPortExtensors(Bus b, EndpointInfo ei, Service service) {
    if (ei.getBinding() instanceof SoapBindingInfo) {
        SoapBindingInfo bi = (SoapBindingInfo) ei.getBinding();
        createSoapExtensors(b, ei, bi, bi.getSoapVersion() instanceof Soap12);
    }
}
Also used : SoapBindingInfo(org.apache.cxf.binding.soap.model.SoapBindingInfo)

Aggregations

SoapBindingInfo (org.apache.cxf.binding.soap.model.SoapBindingInfo)23 QName (javax.xml.namespace.QName)11 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)11 BindingInfo (org.apache.cxf.service.model.BindingInfo)10 Endpoint (org.apache.cxf.endpoint.Endpoint)9 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)9 Test (org.junit.Test)9 SoapOperationInfo (org.apache.cxf.binding.soap.model.SoapOperationInfo)8 Service (org.apache.cxf.service.Service)8 DestinationFactoryManager (org.apache.cxf.transport.DestinationFactoryManager)5 Bus (org.apache.cxf.Bus)4 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)4 Definition (javax.wsdl.Definition)3 BindingFactoryManager (org.apache.cxf.binding.BindingFactoryManager)3 SoapVersion (org.apache.cxf.binding.soap.SoapVersion)3 SoapBodyInfo (org.apache.cxf.binding.soap.model.SoapBodyInfo)3 BindingMessageInfo (org.apache.cxf.service.model.BindingMessageInfo)3 BusException (org.apache.cxf.BusException)2 Binding (org.apache.cxf.binding.Binding)2 SoapBinding (org.apache.cxf.binding.soap.SoapBinding)2