Search in sources :

Example 31 with Binding

use of javax.wsdl.Binding 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 32 with Binding

use of javax.wsdl.Binding in project Lucee by lucee.

the class Axis1Client method keyIterator.

@Override
public Iterator<Collection.Key> keyIterator() {
    List<Collection.Key> list = new ArrayList<Collection.Key>();
    Port port = null;
    try {
        port = getPort();
    } catch (Exception e) {
        return new KeyIterator(new Collection.Key[0]);
    }
    Binding binding = port.getBinding();
    SymbolTable symbolTable = parser.getSymbolTable();
    BindingEntry bEntry = symbolTable.getBindingEntry(binding.getQName());
    Iterator itr = bEntry.getParameters().keySet().iterator();
    Operation tmpOp = null;
    // Operation operation = null;
    while (itr.hasNext()) {
        tmpOp = (Operation) itr.next();
        // Parameters p = (Parameters)bEntry.getParameters().get(tmpOp);
        list.add(KeyImpl.init(tmpOp.getName()));
    }
    return new KeyIterator(list.toArray(new Collection.Key[list.size()]));
}
Also used : Binding(javax.wsdl.Binding) KeyIterator(lucee.runtime.type.it.KeyIterator) Port(javax.wsdl.Port) ArrayList(java.util.ArrayList) KeyIterator(lucee.runtime.type.it.KeyIterator) KeyAsStringIterator(lucee.runtime.type.it.KeyAsStringIterator) ObjectsIterator(lucee.runtime.type.it.ObjectsIterator) Iterator(java.util.Iterator) ObjectsEntryIterator(lucee.runtime.type.it.ObjectsEntryIterator) Collection(lucee.runtime.type.Collection) SymbolTable(org.apache.axis.wsdl.symbolTable.SymbolTable) Operation(javax.wsdl.Operation) BindingEntry(org.apache.axis.wsdl.symbolTable.BindingEntry) Key(lucee.runtime.type.Collection.Key) PageException(lucee.runtime.exp.PageException) RemoteException(java.rmi.RemoteException) RPCException(lucee.runtime.net.rpc.RPCException) ServiceException(javax.xml.rpc.ServiceException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) ExpressionException(lucee.runtime.exp.ExpressionException)

Example 33 with Binding

use of javax.wsdl.Binding in project Lucee by lucee.

the class Axis1Client method _toDumpData.

private DumpData _toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) throws PageException {
    DumpTable functions = new DumpTable("webservice", "#99cccc", "#ccffff", "#000000");
    functions.setTitle("Web Service (Axis 1)");
    if (dp.getMetainfo())
        functions.setComment(wsdlUrl);
    // DumpTable functions = new DumpTable("#ccccff","#cccc00","#000000");
    Port port = getPort();
    Binding binding = port.getBinding();
    // Parameters parameters = null;
    // Parameter p = null;
    SymbolTable symbolTable = parser.getSymbolTable();
    BindingEntry bEntry = symbolTable.getBindingEntry(binding.getQName());
    Iterator itr = bEntry.getParameters().keySet().iterator();
    Operation tmpOp = null;
    // Operation operation = null;
    while (itr.hasNext()) {
        tmpOp = (Operation) itr.next();
        Element el = tmpOp.getDocumentationElement();
        StringBuffer doc = new StringBuffer();
        if (el != null) {
            NodeList children = XMLUtil.getChildNodes(el, Node.TEXT_NODE);
            int len = children.getLength();
            Text text;
            for (int i = 0; i < len; i++) {
                text = (Text) children.item(i);
                doc.append(text.getData());
            }
        }
        // parameters = (Parameters)bEntry.getParameters().get(tmpOp);
        functions.appendRow(1, new SimpleDumpData(tmpOp.getName()), _toHTMLOperation(tmpOp.getName(), doc.toString(), (Parameters) bEntry.getParameters().get(tmpOp)));
    }
    // box.appendRow(1,new SimpleDumpData(""),functions);
    return functions;
}
Also used : Binding(javax.wsdl.Binding) Parameters(org.apache.axis.wsdl.symbolTable.Parameters) Port(javax.wsdl.Port) SOAPHeaderElement(org.apache.axis.message.SOAPHeaderElement) Element(org.w3c.dom.Element) NodeList(org.w3c.dom.NodeList) SymbolTable(org.apache.axis.wsdl.symbolTable.SymbolTable) Text(org.w3c.dom.Text) Operation(javax.wsdl.Operation) DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) KeyIterator(lucee.runtime.type.it.KeyIterator) KeyAsStringIterator(lucee.runtime.type.it.KeyAsStringIterator) ObjectsIterator(lucee.runtime.type.it.ObjectsIterator) Iterator(java.util.Iterator) ObjectsEntryIterator(lucee.runtime.type.it.ObjectsEntryIterator) BindingEntry(org.apache.axis.wsdl.symbolTable.BindingEntry)

Example 34 with Binding

use of javax.wsdl.Binding in project carbon-business-process by wso2.

the class PeopleActivity method getSoapFactory.

public SOAPFactory getSoapFactory() throws FaultException {
    Binding binding = getBinding();
    ExtensibilityElement bindingType = SOAPHelper.getBindingExtension(binding);
    if (!(bindingType instanceof SOAPBinding || bindingType instanceof SOAP12Binding || bindingType instanceof HTTPBinding)) {
        throw new FaultException(BPEL4PeopleConstants.B4P_FAULT, "Service binding is not supported for service " + serviceName + " and port " + getServicePort());
    }
    if (bindingType instanceof SOAPBinding) {
        return OMAbstractFactory.getSOAP11Factory();
    } else {
        return OMAbstractFactory.getSOAP12Factory();
    }
}
Also used : HTTPBinding(javax.wsdl.extensions.http.HTTPBinding) SOAPBinding(javax.wsdl.extensions.soap.SOAPBinding) SOAP12Binding(javax.wsdl.extensions.soap12.SOAP12Binding) Binding(javax.wsdl.Binding) SOAP12Binding(javax.wsdl.extensions.soap12.SOAP12Binding) FaultException(org.apache.ode.bpel.common.FaultException) SOAPBinding(javax.wsdl.extensions.soap.SOAPBinding) ExtensibilityElement(javax.wsdl.extensions.ExtensibilityElement) HTTPBinding(javax.wsdl.extensions.http.HTTPBinding)

Example 35 with Binding

use of javax.wsdl.Binding in project carbon-business-process by wso2.

the class BPELMessageContextFactory method fillBindingAndRelatedInformation.

private static void fillBindingAndRelatedInformation(final BPELMessageContext bpelMessageContext) throws AxisFault {
    Binding wsdlBinding = getWSDLBindingOfCurrentMessageFlow(bpelMessageContext.getInMessageContext().getAxisService(), bpelMessageContext.getInMessageContext());
    if (wsdlBinding == null) {
        throw new NullPointerException("WSDL Binding null for incoming message.");
    }
    bpelMessageContext.setWsdlBindingForCurrentMessageFlow(wsdlBinding);
    setSOAPFactoryAndBindingStyle(bpelMessageContext);
}
Also used : SOAPBinding(javax.wsdl.extensions.soap.SOAPBinding) SOAP12Binding(javax.wsdl.extensions.soap12.SOAP12Binding) Binding(javax.wsdl.Binding) AxisBinding(org.apache.axis2.description.AxisBinding)

Aggregations

Binding (javax.wsdl.Binding)69 QName (javax.xml.namespace.QName)39 BindingOperation (javax.wsdl.BindingOperation)28 SOAPBinding (javax.wsdl.extensions.soap.SOAPBinding)22 Definition (javax.wsdl.Definition)18 SOAP12Binding (javax.wsdl.extensions.soap12.SOAP12Binding)18 Test (org.junit.Test)18 Port (javax.wsdl.Port)17 Operation (javax.wsdl.Operation)16 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)15 PortType (javax.wsdl.PortType)14 Service (javax.wsdl.Service)12 BindingType (org.apache.cxf.binding.corba.wsdl.BindingType)12 ToolException (org.apache.cxf.tools.common.ToolException)12 File (java.io.File)9 ArrayList (java.util.ArrayList)8 BindingInput (javax.wsdl.BindingInput)8 Message (javax.wsdl.Message)8 Map (java.util.Map)7 HashSet (java.util.HashSet)6