Search in sources :

Example 11 with SOAPAddress

use of javax.wsdl.extensions.soap.SOAPAddress in project tesb-studio-se by Talend.

the class WSDLUtils method getPortAddress.

public static String getPortAddress(final Port port) {
    final Collection<?> extensibilityElements = port.getExtensibilityElements();
    SOAPAddress soapAddress = findExtensibilityElement(extensibilityElements, SOAPAddress.class);
    if (null != soapAddress) {
        return soapAddress.getLocationURI();
    }
    SOAP12Address soap12Address = findExtensibilityElement(extensibilityElements, SOAP12Address.class);
    if (null != soap12Address) {
        return soap12Address.getLocationURI();
    }
    return null;
}
Also used : SOAPAddress(javax.wsdl.extensions.soap.SOAPAddress) SOAP12Address(javax.wsdl.extensions.soap12.SOAP12Address)

Example 12 with SOAPAddress

use of javax.wsdl.extensions.soap.SOAPAddress in project tomee by apache.

the class JaxRpcServiceInfoBuilder method getAddressLocation.

private String getAddressLocation(List extensibilityElements) throws OpenEJBException {
    SOAPAddress soapAddress = getExtensibilityElement(SOAPAddress.class, extensibilityElements);
    String locationURIString = soapAddress.getLocationURI();
    return locationURIString;
}
Also used : SOAPAddress(javax.wsdl.extensions.soap.SOAPAddress)

Example 13 with SOAPAddress

use of javax.wsdl.extensions.soap.SOAPAddress in project tdi-studio-se by Talend.

the class ComponentBuilder method populateComponent.

private ServiceInfo populateComponent(ServiceInfo component, Service service) {
    QName qName = service.getQName();
    String namespace = qName.getNamespaceURI();
    String name = qName.getLocalPart();
    component.setServerName(name);
    component.setServerNameSpace(namespace);
    Map ports = service.getPorts();
    Iterator portIter = ports.values().iterator();
    while (portIter.hasNext()) {
        Port port = (Port) portIter.next();
        Binding binding = port.getBinding();
        if (port.getName() != null && component.getPortNames() == null) {
            List<PortNames> portNames = new ArrayList();
            PortNames portName = new PortNames();
            portName.setPortName(port.getName());
            portNames.add(portName);
            component.setPortNames(portNames);
        } else if (port.getName() != null && component.getPortNames() != null) {
            PortNames portName = new PortNames();
            portName.setPortName(port.getName());
            component.getPortNames().add(portName);
        }
        List operations = buildOperations(binding);
        Iterator operIter = operations.iterator();
        while (operIter.hasNext()) {
            OperationInfo operation = (OperationInfo) operIter.next();
            Vector addrElems = findExtensibilityElement(port.getExtensibilityElements(), "address");
            ExtensibilityElement element = (ExtensibilityElement) addrElems.elementAt(0);
            if (element != null && element instanceof SOAPAddress) {
                SOAPAddress soapAddr = (SOAPAddress) element;
                operation.setTargetURL(soapAddr.getLocationURI());
            } else if (element != null && element instanceof SOAP12Address) {
                SOAP12Address soapAddr = (SOAP12Address) element;
                operation.setTargetURL(soapAddr.getLocationURI());
            }
            component.addOperation(operation);
        }
    }
    return component;
}
Also used : SOAPBinding(javax.wsdl.extensions.soap.SOAPBinding) SOAP12Binding(javax.wsdl.extensions.soap12.SOAP12Binding) Binding(javax.wsdl.Binding) OperationInfo(org.talend.designer.webservice.ws.wsdlinfo.OperationInfo) QName(javax.xml.namespace.QName) Port(javax.wsdl.Port) ArrayList(java.util.ArrayList) UnknownExtensibilityElement(javax.wsdl.extensions.UnknownExtensibilityElement) ExtensibilityElement(javax.wsdl.extensions.ExtensibilityElement) PortNames(org.talend.designer.webservice.ws.wsdlinfo.PortNames) SOAPAddress(javax.wsdl.extensions.soap.SOAPAddress) Iterator(java.util.Iterator) List(java.util.List) ArrayList(java.util.ArrayList) Map(java.util.Map) Vector(java.util.Vector) SOAP12Address(javax.wsdl.extensions.soap12.SOAP12Address)

Example 14 with SOAPAddress

use of javax.wsdl.extensions.soap.SOAPAddress in project cxf by apache.

the class PartialWSDLProcessor method setAddrElement.

public static SOAPAddress setAddrElement(Definition wsdlDefinition, Port port, ExtensionRegistry extReg) throws Exception {
    SOAPAddress address = SOAPBindingUtil.createSoapAddress(extReg, false);
    address.setLocationURI("dummy");
    return address;
}
Also used : SOAPAddress(javax.wsdl.extensions.soap.SOAPAddress)

Example 15 with SOAPAddress

use of javax.wsdl.extensions.soap.SOAPAddress in project wso2-synapse by wso2.

the class WSDL11EndpointBuilder method createEndpointDefinitionFromWSDL.

private EndpointDefinition createEndpointDefinitionFromWSDL(EndpointDefinition endpointDefinition, Definition definition, String serviceName, String portName) {
    if (definition == null) {
        handleException("WSDL document is not specified.");
    }
    if (serviceName == null) {
        handleException("Service name of the WSDL document is not specified.");
    }
    if (portName == null) {
        handleException("Port name of the WSDL document is not specified.");
    }
    String serviceURL = null;
    // get soap version from wsdl port and update endpoint definition below
    // so that correct soap version is used when endpoint is called
    String format = null;
    assert definition != null;
    String tns = definition.getTargetNamespace();
    Service service = definition.getService(new QName(tns, serviceName));
    if (service != null) {
        Port port = service.getPort(portName);
        if (port != null) {
            for (Object obj : port.getExtensibilityElements()) {
                if (obj instanceof SOAPAddress) {
                    SOAPAddress address = (SOAPAddress) obj;
                    serviceURL = address.getLocationURI();
                    format = SynapseConstants.FORMAT_SOAP11;
                    break;
                } else if (obj instanceof SOAP12Address) {
                    SOAP12Address address = (SOAP12Address) obj;
                    serviceURL = address.getLocationURI();
                    format = SynapseConstants.FORMAT_SOAP12;
                    break;
                } else if (obj instanceof HTTPAddress) {
                    HTTPAddress address = (HTTPAddress) obj;
                    serviceURL = address.getLocationURI();
                    format = SynapseConstants.FORMAT_REST;
                    Binding binding = port.getBinding();
                    if (binding == null) {
                        continue;
                    }
                    for (Object portElement : binding.getExtensibilityElements()) {
                        if (portElement instanceof HTTPBinding) {
                            HTTPBinding httpBinding = (HTTPBinding) portElement;
                            String verb = httpBinding.getVerb();
                            if (verb == null || "".equals(verb)) {
                                continue;
                            }
                            if ("POST".equals(verb.toUpperCase())) {
                                format = SynapseConstants.FORMAT_REST;
                            } else if ("GET".equals(verb.toUpperCase())) {
                                format = SynapseConstants.FORMAT_GET;
                            }
                        }
                    }
                }
            }
        }
    }
    if (serviceURL != null) {
        endpointDefinition.setAddress(serviceURL);
        if (SynapseConstants.FORMAT_SOAP11.equals(format)) {
            endpointDefinition.setForceSOAP11(true);
        } else if (SynapseConstants.FORMAT_SOAP12.equals(format)) {
            endpointDefinition.setForceSOAP12(true);
        } else if (SynapseConstants.FORMAT_REST.equals(format)) {
            endpointDefinition.setForceREST(true);
        } else if (SynapseConstants.FORMAT_GET.equals(format)) {
            endpointDefinition.setForceGET(true);
        } else {
            handleException("format value '" + format + "' not yet implemented");
        }
        endpointDefinition.setFormat(format);
        return endpointDefinition;
    } else {
        handleException("Couldn't retrieve endpoint information from the WSDL.");
    }
    return null;
}
Also used : HTTPBinding(javax.wsdl.extensions.http.HTTPBinding) HTTPAddress(javax.wsdl.extensions.http.HTTPAddress) QName(javax.xml.namespace.QName) SOAPAddress(javax.wsdl.extensions.soap.SOAPAddress) SOAP12Address(javax.wsdl.extensions.soap12.SOAP12Address) HTTPBinding(javax.wsdl.extensions.http.HTTPBinding)

Aggregations

SOAPAddress (javax.wsdl.extensions.soap.SOAPAddress)22 Port (javax.wsdl.Port)12 QName (javax.xml.namespace.QName)9 Service (javax.wsdl.Service)7 SOAP12Address (javax.wsdl.extensions.soap12.SOAP12Address)7 Definition (javax.wsdl.Definition)5 Test (org.junit.Test)5 List (java.util.List)4 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)4 HTTPAddress (javax.wsdl.extensions.http.HTTPAddress)4 URL (java.net.URL)3 Iterator (java.util.Iterator)3 Binding (javax.wsdl.Binding)3 File (java.io.File)2 Map (java.util.Map)2 BindingOperation (javax.wsdl.BindingOperation)2 UnknownExtensibilityElement (javax.wsdl.extensions.UnknownExtensibilityElement)2 SOAPBinding (javax.wsdl.extensions.soap.SOAPBinding)2 SOAPOperation (javax.wsdl.extensions.soap.SOAPOperation)2 ToolException (org.apache.cxf.tools.common.ToolException)2