Search in sources :

Example 6 with ExtensibilityElement

use of javax.wsdl.extensions.ExtensibilityElement 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)

Aggregations

ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)6 ArrayList (java.util.ArrayList)5 Iterator (java.util.Iterator)4 List (java.util.List)4 Vector (java.util.Vector)4 UnknownExtensibilityElement (javax.wsdl.extensions.UnknownExtensibilityElement)4 Map (java.util.Map)3 BindingOperation (javax.wsdl.BindingOperation)2 Definition (javax.wsdl.Definition)2 SOAPAddress (javax.wsdl.extensions.soap.SOAPAddress)2 SOAPBinding (javax.wsdl.extensions.soap.SOAPBinding)2 SOAPOperation (javax.wsdl.extensions.soap.SOAPOperation)2 SOAP12Binding (javax.wsdl.extensions.soap12.SOAP12Binding)2 SOAP12Operation (javax.wsdl.extensions.soap12.SOAP12Operation)2 XmlSchema (org.apache.ws.commons.schema.XmlSchema)2 OperationInfo (org.talend.designer.webservice.ws.wsdlinfo.OperationInfo)2 URI (java.net.URI)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Binding (javax.wsdl.Binding)1