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>