English 中文(简体)
WSDL - Example
  • 时间:2024-11-03

WSDL - Example


Previous Page Next Page  

下面是一份WSDL文件,用于展示一个简单的WSDL方案。

让我们承担这项服务,提供一种称为sayHello的公开职能。 这项职能预期只有一个直截了当的参数,并回去了一次直观的问候。 例如,如果你通过参数world。 当时的服务职能sayHello > 回复了问答,“Hello, World>。

Example

页: 1 wsdl file -

<definitions name = "HelloService"
   targetNamespace = "http://www.examples.com/wsdl/HelloService.wsdl"
   xmlns = "http://schemas.xmlsoap.org/wsdl/"
   xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns:tns = "http://www.examples.com/wsdl/HelloService.wsdl"
   xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
 
   <message name = "SayHelloRequest">
      <part name = "firstName" type = "xsd:string"/>
   </message>
	
   <message name = "SayHelloResponse">
      <part name = "greeting" type = "xsd:string"/>
   </message>

   <portType name = "Hello_PortType">
      <operation name = "sayHello">
         <input message = "tns:SayHelloRequest"/>
         <output message = "tns:SayHelloResponse"/>
      </operation>
   </portType>

   <binding name = "Hello_Binding" type = "tns:Hello_PortType">
      <soap:binding style = "rpc"
         transport = "http://schemas.xmlsoap.org/soap/http"/>
      <operation name = "sayHello">
         <soap:operation soapAction = "sayHello"/>
         <input>
            <soap:body
               encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"
               namespace = "urn:examples:helloservice"
               use = "encoded"/>
         </input>
		
         <output>
            <soap:body
               encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"
               namespace = "urn:examples:helloservice"
               use = "encoded"/>
         </output>
      </operation>
   </binding>

   <service name = "Hello_Service">
      <documentation>WSDL File for HelloService</documentation>
      <port binding = "tns:Hello_Binding" name = "Hello_Port">
         <soap:address
            location = "http://www.examples.com/SayHello/" />
      </port>
   </service>
</definitions>

Example Analysis

    Type——使用内在数据类型,并在XMLSchema中加以界定。

      声明HelloRequest - first 姓名

      说Helloresponse——回报值

    Bled - 指示使用SOAP HTTP运输协议。

    - 与URI有约束力的合伙人:http://www.examples.com/SayHello/,可在那里获得经营服务。

Advertisements