天天看點

WSDL系列文章連結

1。我應該采用哪一種 WSDL 樣式?

文檔/文字包裝樣式:将參數用方法名包裝,每個方法的方法名與參數是一一對應的,因為用方法名作為辨別,是以不支援重載。

string oper1(string s1); string oper1(string s1,string s2)将不被支援

一個參數 string operation1(string input1)

<wsdl:definitions xmlns:tns="http://HelloWordMd/HelloInterface" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloInterface" targetNamespace="http://HelloWordMd/HelloInterface">

  <wsdl:types>

    <xsd:schema targetNamespace="http://HelloWordMd/HelloInterface" xmlns:tns="http://HelloWordMd/HelloInterface" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

      <xsd:element name="operation1">

        <xsd:complexType>

          <xsd:sequence>

            <xsd:element name="input1" nillable="true" type="xsd:string"/>

                    </xsd:sequence>

        </xsd:complexType>

      </xsd:element>

      <xsd:element name="operation1Response">

        <xsd:complexType>

          <xsd:sequence>

            <xsd:element name="output1" nillable="true" type="xsd:string"/>

          </xsd:sequence>

        </xsd:complexType>

      </xsd:element>

    </xsd:schema>

  </wsdl:types>

    <wsdl:message name="operation1RequestMsg">

    <wsdl:part element="tns:operation1" name="operation1參數"/>

  </wsdl:message>

    <wsdl:message name="operation1ResponseMsg">

    <wsdl:part element="tns:operation1Response" name="operation1Result"/>

  </wsdl:message>

    <wsdl:portType name="HelloInterface">

    <wsdl:operation name="operation1">

            <wsdl:input message="tns:operation1RequestMsg" name="operation1Request"/>

            <wsdl:output message="tns:operation1ResponseMsg" name="operation1Response"/>

    </wsdl:operation>

  </wsdl:portType>

</wsdl:definitions>

兩個參數 string operation1(string input1,string input2)

<wsdl:definitions xmlns:tns="http://HelloWordMd/HelloInterface" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloInterface" targetNamespace="http://HelloWordMd/HelloInterface">

  <wsdl:types>

    <xsd:schema targetNamespace="http://HelloWordMd/HelloInterface" xmlns:tns="http://HelloWordMd/HelloInterface" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

      <xsd:element name="operation1">

        <xsd:complexType>

          <xsd:sequence>

            <xsd:element name="input1" nillable="true" type="xsd:string"/>

                        <xsd:element name="input2" nillable="true" type="xsd:string"/>

                    </xsd:sequence>

        </xsd:complexType>

      </xsd:element>

      <xsd:element name="operation1Response">

        <xsd:complexType>

          <xsd:sequence>

            <xsd:element name="output1" nillable="true" type="xsd:string"/>

          </xsd:sequence>

        </xsd:complexType>

      </xsd:element>

    </xsd:schema>

  </wsdl:types>

    <wsdl:message name="operation1RequestMsg">

    <wsdl:part element="tns:operation1" name="operation1參數"/>

  </wsdl:message>

    <wsdl:message name="operation1ResponseMsg">

    <wsdl:part element="tns:operation1Response" name="operation1Result"/>

  </wsdl:message>

    <wsdl:portType name="HelloInterface">

    <wsdl:operation name="operation1">

            <wsdl:input message="tns:operation1RequestMsg" name="operation1Request"/>

            <wsdl:output message="tns:operation1ResponseMsg" name="operation1Response"/>

    </wsdl:operation>

  </wsdl:portType>

</wsdl:definitions>