Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Define Interface/Binding/PortType

Help
Rich T
2010-08-04
2013-06-06
  • Rich T
    Rich T
    2010-08-04

    I've been using NuSoap for a while fine, but I now have a WSDL that has two bindings with similar actions, only one interface is for SOAP 12 and one for SOAP11, how do I change my call to use the correct binding? The WSDL is below. Previously I would set up the NuSoap client with reference to the WSDL and then set the method, action and message and make a call. However, this can't distinguish between the two types of call for example on the InvokeScenario method.  I assume I have to define the PortType to get this working, but I'm not sure how. The bottom of the WSDL has the important info I think.

    Hope that makes sense!

    <?xml version="1.0" encoding="UTF-8" ?>
    - <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:odi="xmlns.oracle.com/odi/OdiInvoke/" targetNamespace="xmlns.oracle.com/odi/OdiInvoke/">
    <wsdl:documentation>OdiInvoke</wsdl:documentation>
    - <wsdl:types>
    - <xsd:schema xmlns="xmlns.oracle.com/odi/OdiInvoke/" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="xmlns.oracle.com/odi/OdiInvoke/">
    <xsd:element name="invokeScenarioResponse" type="CommandResultType" />
    - <xsd:element name="invokeScenarioRequest">
    - <xsd:complexType>
    - <xsd:all>
    <xsd:element name="RepositoryConnection" type="RepositoryConnectionType" />
    <xsd:element name="Command" type="ScenarioCommandType" />
    <xsd:element name="Agent" type="AgentType" />
    </xsd:all>
    </xsd:complexType>
    </xsd:element>
    - <xsd:complexType name="RepositoryConnectionType">
    - <xsd:all>
    <xsd:element minOccurs="0" name="JdbcDriver" type="xsd:string" />
    <xsd:element minOccurs="0" name="JdbcUrl" type="xsd:string" />
    <xsd:element minOccurs="0" name="JdbcUser" type="xsd:string" />
    <xsd:element minOccurs="0" name="JdbcPassword" type="xsd:string" />
    <xsd:element name="OdiUser" type="xsd:string" />
    <xsd:element name="OdiPassword" type="xsd:string" />
    <xsd:element minOccurs="0" name="WorkRepository" type="xsd:string" />
    </xsd:all>
    </xsd:complexType>
    - <xsd:complexType name="ScenarioCommandType">
    - <xsd:sequence>
    <xsd:element name="ScenName" type="xsd:string" />
    <xsd:element name="ScenVersion" type="xsd:string" />
    <xsd:element name="Context" type="xsd:string" />
    <xsd:element default="5" minOccurs="0" name="LogLevel" type="xsd:int" />
    <xsd:element default="1" minOccurs="0" name="SyncMode" type="xsd:int" />
    <xsd:element minOccurs="0" name="SessionName" type="xsd:string" />
    <xsd:element minOccurs="0" name="Keywords" type="xsd:string" />
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="Variables" type="VariableType" />
    </xsd:sequence>
    </xsd:complexType>
    - <xsd:complexType name="VariableType">
    - <xsd:all>
    <xsd:element name="Name" type="xsd:string" />
    <xsd:element name="Value" type="xsd:string" />
    </xsd:all>
    </xsd:complexType>
    - <xsd:complexType name="CommandResultType">
    - <xsd:all>
    <xsd:element name="Ok" type="xsd:boolean" />
    <xsd:element name="SessionNumber" type="xsd:string" />
    <xsd:element name="ErrorMessage" type="xsd:string" />
    </xsd:all>
    </xsd:complexType>
    - <xsd:complexType name="AgentType">
    - <xsd:all>
    <xsd:element default="localhost" name="Host" type="xsd:string" />
    <xsd:element default="20910" name="Port" type="xsd:int" />
    </xsd:all>
    </xsd:complexType>
    - <xsd:element name="getWebServiceVersionRequest">
    <xsd:complexType />
    </xsd:element>
    - <xsd:element name="getWebServiceVersionResponse">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element name="version" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </wsdl:types>
    - <wsdl:message name="getWebServiceVersionRequest">
    <wsdl:part name="part1" element="odi:getWebServiceVersionRequest" />
    </wsdl:message>
    - <wsdl:message name="getWebServiceVersionResponse">
    <wsdl:part name="part1" element="odi:getWebServiceVersionResponse" />
    </wsdl:message>
    - <wsdl:message name="invokeScenarioRequest">
    <wsdl:part name="part1" element="odi:invokeScenarioRequest" />
    </wsdl:message>
    - <wsdl:message name="invokeScenarioResponse">
    <wsdl:part name="part1" element="odi:invokeScenarioResponse" />
    </wsdl:message>
    - <wsdl:portType name="OdiInvokePortType">
    - <wsdl:operation name="getWebServiceVersion">
    <wsdl:input message="odi:getWebServiceVersionRequest" wsaw:Action="urn:getWebServiceVersion" />
    <wsdl:output message="odi:getWebServiceVersionResponse" wsaw:Action="xmlns.oracle.com/odi/OdiInvoke/InvokePortType/getWebServiceVersionResponse" />
    </wsdl:operation>
    - <wsdl:operation name="invokeScenario">
    <wsdl:input message="odi:invokeScenarioRequest" wsaw:Action="invokeScenario" />
    <wsdl:output message="odi:invokeScenarioResponse" wsaw:Action="xmlns.oracle.com/odi/OdiInvoke/InvokePortType/invokeScenarioResponse" />
    </wsdl:operation>
    </wsdl:portType>
    - <wsdl:binding name="InvokeSOAP11Binding" type="odi:OdiInvokePortType">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <wsdl:operation name="getWebServiceVersion">
    <soap:operation soapAction="urn:getWebServiceVersion" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="invokeScenario">
    <soap:operation soapAction="invokeScenario" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:binding name="InvokeSOAP12Binding" type="odi:OdiInvokePortType">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <wsdl:operation name="getWebServiceVersion">
    <soap12:operation soapAction="urn:getWebServiceVersion" style="document" />
    - <wsdl:input>
    <soap12:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap12:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="invokeScenario">
    <soap12:operation soapAction="invokeScenario" style="document" />
    - <wsdl:input>
    <soap12:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap12:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:service name="OdiInvoke">
    - <wsdl:port name="OdiInvokeSOAP11port0" binding="odi:InvokeSOAP11Binding">
    <soap:address location="http://www.lp-iq.com:8480/axis2/services/OdiInvoke.OdiInvokeSOAP11port0/" />
    </wsdl:port>
    - <wsdl:port name="OdiInvokeSOAP12port0" binding="odi:InvokeSOAP12Binding">
    <soap12:address location="http://www.lp-iq.com:8480/axis2/services/OdiInvoke.OdiInvokeSOAP12port0/" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

     
  • Rich T
    Rich T
    2010-08-05

    For anyone who's interested I fixed my own problem by calling the correct port name as the 9th parameter in the soap_client function.