Search in sources :

Example 6 with SOAP12Operation

use of javax.wsdl.extensions.soap12.SOAP12Operation in project tesb-studio-se by Talend.

the class ComponentBuilder method populateComponent.

private static ServiceInfo populateComponent(Service service) {
    ServiceInfo serviceInfo = new ServiceInfo();
    serviceInfo.setServiceName(service.getQName());
    Collection<Port> ports = service.getPorts().values();
    for (Port port : ports) {
        String soapLocation = null;
        SOAPAddress soapAddress = findExtensibilityElement(port.getExtensibilityElements(), SOAPAddress.class);
        if (null != soapAddress) {
            soapLocation = soapAddress.getLocationURI();
        } else {
            SOAP12Address soap12Address = findExtensibilityElement(port.getExtensibilityElements(), SOAP12Address.class);
            if (null != soap12Address) {
                soapLocation = soap12Address.getLocationURI();
            }
        }
        Binding binding = port.getBinding();
        for (BindingOperation operation : (Collection<BindingOperation>) binding.getBindingOperations()) {
            SOAPOperation soapOperation = findExtensibilityElement(operation.getExtensibilityElements(), SOAPOperation.class);
            OperationInfo operationInfo = new OperationInfo(operation.getOperation());
            operationInfo.setPortName(port.getName());
            operationInfo.setNamespaceURI(binding.getPortType().getQName().getNamespaceURI());
            if (soapOperation != null) {
                operationInfo.setSoapActionURI(soapOperation.getSoapActionURI());
            } else {
                SOAP12Operation soap12Operation = findExtensibilityElement(operation.getExtensibilityElements(), SOAP12Operation.class);
                if (soap12Operation != null) {
                    operationInfo.setSoapActionURI(soap12Operation.getSoapActionURI());
                }
            }
            operationInfo.setTargetURL(soapLocation);
            serviceInfo.addOperation(operationInfo);
        }
    }
    return serviceInfo;
}
Also used : ServiceInfo(org.talend.designer.esb.webservice.ws.wsdlinfo.ServiceInfo) Binding(javax.wsdl.Binding) OperationInfo(org.talend.designer.esb.webservice.ws.wsdlinfo.OperationInfo) BindingOperation(javax.wsdl.BindingOperation) SOAPOperation(javax.wsdl.extensions.soap.SOAPOperation) SOAP12Operation(javax.wsdl.extensions.soap12.SOAP12Operation) Port(javax.wsdl.Port) SOAPAddress(javax.wsdl.extensions.soap.SOAPAddress) Collection(java.util.Collection) SOAP12Address(javax.wsdl.extensions.soap12.SOAP12Address)

Aggregations

BindingOperation (javax.wsdl.BindingOperation)6 SOAP12Operation (javax.wsdl.extensions.soap12.SOAP12Operation)6 SOAPOperation (javax.wsdl.extensions.soap.SOAPOperation)4 Binding (javax.wsdl.Binding)3 BindingInput (javax.wsdl.BindingInput)3 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)3 SOAPBinding (javax.wsdl.extensions.soap.SOAPBinding)3 SOAP12Binding (javax.wsdl.extensions.soap12.SOAP12Binding)3 SOAP12Body (javax.wsdl.extensions.soap12.SOAP12Body)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Vector (java.util.Vector)2 Input (javax.wsdl.Input)2 Message (javax.wsdl.Message)2 Operation (javax.wsdl.Operation)2 Output (javax.wsdl.Output)2 UnknownExtensibilityElement (javax.wsdl.extensions.UnknownExtensibilityElement)2 QName (javax.xml.namespace.QName)2 SoapBinding (org.apache.cxf.binding.soap.wsdl.extensions.SoapBinding)2