WSDL复杂类型请求澄清

时间:2013-12-08 01:36:29

标签: soap wsdl soapui

我很想知道在WSDL文件中配置复杂类型并在SOAP UI客户端中看到这种复杂类型。

在下面找到WSDL文件。

<?xml version ='1.0' encoding ='UTF-8' ?> 
<wsdl:definitions name='Catalog' 
  targetNamespace='http://website.net/websitesmsmobile' 
  xmlns:tns='http://website.net/websitesmsmobile' 
  xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' 
  xmlns:xsd='http://www.w3.org/2001/XMLSchema' 
  xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' 
  xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' 
  xmlns='http://schemas.xmlsoap.org/wsdl/'> 

<types>
    <xsd:complexType name="xsd:parameter">
        <xsd:sequence>
            <xsd:element name="key" type="xsd:string"/>
            <xsd:element name="value" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="xsd:parameters">
     <xsd:complexType>
         <xsd:sequence>
             <xsd:element minOccurs="0" maxOccurs="1" name="parameter" type="tns:parameter"/>
         </xsd:sequence>
     </xsd:complexType>
    </xsd:element>
</types>

<message name='callServerRequest'>
    <part name='methodName' type='xsd:string'/> 
  <part name='parameter' type='paramters'/> 
</message>

<message name='callServerResponse'> 
  <part name='response' type='xsd:string'/>
</message> 

<portType name='websitePortType'> 
  <operation name='callServer'> 
    <input message='tns:callServerRequest'/> 
    <output message='tns:callServerResponse'/> 
  </operation>
</portType> 

<binding name='websiteBinding' type='tns:websitePortType'> 
  <soap:binding
        style='rpc' 
    transport='http://schemas.xmlsoap.org/soap/http'
  /> 
  <operation name='callServer'> 
    <soap:operation soapAction='urn:website-net-websitesmsmobile#callServer'/> 
    <input> 
      <soap:body
                use='encoded'
                namespace='urn:website-net-websitesmsmobile' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </input> 
    <output> 
      <soap:body
                use='encoded'
                namespace='urn:website-net-websitesmsmobile' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </output> 
  </operation>
</binding> 

<service name='websiteService'> 
    <port name='websitePort' binding='websiteBinding'> 
    <soap:address location='http://localhost/smsmobile/server/smsmobile.php'/> 
  </port> 
</service>
</wsdl:definitions>

当我在SOAP UI中创建请求时,我会看到以下内容。

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:website-net-websitesmsmobile">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:callServer soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <methodName xsi:type="xsd:string">?</methodName>
      </urn:callServer>
   </soapenv:Body>
</soapenv:Envelope>

成功生成字符串类型'methodName'。为什么请求中没有生成复杂类型'参数'?

WSDL文件有什么问题?

1 个答案:

答案 0 :(得分:0)

http://www.w3.org/TR/2001/NOTE-wsdl-20010315 (示例5. HTTP上的请求 - 响应RPC操作的SOAP绑定)

通过示例5中的上述链接。您的架构定义在绑定时不正确,这就是为什么它没有正确显示您的请求消息。