开发者

Why WSDL introduce wsdl:message?

Why WSDL introduces wsdl:message? And message parts?

What the advantage they could bring over the direct using of the XSD in the operations parameters (input, output, fault)?

How they (wsdl messages with wsdl message parts) can be more abstract then XSD?

Why it is not organized for example that way:

<operation name="GetEndorsingBoarder"> 
  <input type="xsd:string"/> 
  <output type="xsd:string, xsd:int, xsd:boolean"/> 
开发者_JS百科  <fault "type="xsd:string""/> 
</operation>


I got it:

Messages not just specify operation's parameters.

Messages and theirs parts are referred in the bindings. It should be possible to bind different parts differently:

<message name="m1">
    <part name="body" element="tns:GetCompanyInfo"/>
</message>

<message name="m2">
    <part name="body" element="tns:GetCompanyInfoResult"/>
    <part name="docs" type="xsd:string"/>
    <part name="logo" type="tns:ArrayOfBinary"/>
</message>

<portType name="pt1">
    <operation name="GetCompanyInfo">
       <input message="m1"/>
       <output message="m2"/>
    </operation>
</portType>

 <binding name="b1" type="tns:pt1">
        <operation name="GetCompanyInfo">
           <soap:operation soapAction="http://example.com/GetCompanyInfo"/>
           <input>
               <soap:body use="literal"/>
           </input>
           <output>
               <mime:multipartRelated>
                   <mime:part>
                       <soap:body parts="body" use="literal"/>
                   </mime:part>
                   <mime:part>
                       <mime:content part="docs" type="text/html"/>
                   </mime:part>
                   <mime:part>
                       <mime:content part="logo" type="image/gif"/>
                       <mime:content part="logo" type="image/jpeg"/>
                   </mime:part>
               </mime:multipartRelated>
           </output>
        </operation>
    </binding>

I have missed this since "non SOAP 'literal'" bindings are so uncommon.


A XSD describes the DATA aspects, for example data aspects of webservice call whereas the WSDL describes the purpose of the web services (method calls). You cannot typically figure out the method calls from your data alone.

Check out Cheeso and Marc answers on Generating a WSDL from an XSD file

EDIT: source

The message describes the data being exchanged between the web services' provider and consumer and each web service has two messages: 1) input: parameters of the web service 2) output: return data from the web service

Each message has zero or more part parameters (one for each parameter of the web service's function) Each part parameter associates with a concrete type defined in the types container element.

   <message name="SayHelloRequest">
      <part name="firstName" type="xsd:string"/>
   </message>
   <message name="SayHelloResponse">
      <part name="greeting" type="xsd:string"/>
   </message>

Here, two message elements are defined. The first represents a request message SayHelloRequest, and the second represents a response message SayHelloResponse.

Each of these messages contains a single part element. For the request, the part specifies the function parameters; in this case, we specify a single firstName parameter. For the response, the part specifies the function return values; in this case, we specify a single greeting return value.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜