加入收藏 | 设为首页 | 会员中心 | 我要投稿 汽车网 (https://www.0577qiche.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 教程 > 正文

WSDL 2.0文档简单示例

发布时间:2023-09-26 10:56:02 所属栏目:教程 来源:
导读:以下是以XML格式表示WSDL 2.0 文档的简单示例,文件:hello_wsdl_20_soap.wsdl 的内容如下 -

<?xml version=1.0?>
<wsdl:description xmlns:wsdl=http://www.w3.org/ns/wsdl
xmlns:wsoap= http://www.w3.org
以下是以XML格式表示WSDL 2.0 文档的简单示例,文件:hello_wsdl_20_soap.wsdl 的内容如下 -

<?xml version=1.0?> 
<wsdl:description xmlns:wsdl=http://www.w3.org/ns/wsdl
  xmlns:wsoap= http://www.w3.org/ns/wsdl/soap
  xmlns:hy=http://www.herongyang.com/Service/
  targetNamespace=http://www.herongyang.com/Service/>
  <wsdl:documentation>
    Hello_WSDL_20_SOAP.wsdl
    copyright (c) 2009 herongYang.com, All Rights Reserved.
  </wsdl:documentation>
  <wsdl:types>
    <xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema
      targetNamespace=http://www.jb51.cc/service/>
      <xsd:element name=Hello type=xsd:string/>    
      <xsd:element name=HelloResponse type=xsd:string/>    
    </xsd:schema>    
  </wsdl:types>
  <wsdl:interface name=helloInterface >
    <wsdl:operation name=Hello 
      pattern=http://www.w3.org/ns/wsdl/in-out 
      style=http://www.w3.org/ns/wsdl/style/iri>
      <wsdl:input messageLabel=In 
        element=hy:Hello />
      <wsdl:output messageLabel=Out 
        element=hy:HelloResponse />
    </wsdl:operation>
  </wsdl:interface>
  <wsdl:binding name=helloBinding 
    interface=hy:helloInterface
    type=http://www.w3.org/ns/wsdl/soap
    wsoap:protocol=http://www.w3.org/2003/05/soap/bindings/HTTP/>
    <wsdl:operation ref=hy:Hello 
      wsoap:mep=http://www.w3.org/2003/05/soap/mep/soap-response/>
  </wsdl:binding>
  <wsdl:service name=helloService 
    interface=hy:helloInterface>
    <wsdl:endpoint name=helloEndpoint 
      binding=hy:helloBinding
address=http://www.jb51.cc/service/hello_soap_12.PHP/>
  </wsdl:service>
</wsdl:description>

在这个WSDL 2.0示例文档中,
Web服务helloService使用端点helloEndpoint定义 。
端点helloEndpoint链接到绑定helloBinding。
绑定helloBinding是通过HTTP上的SOAP 1.2通信协议定义的。
绑定helloBinding链接到接口helloInterface。
接口helloInterface由一个操作Hello定义的,该操作需要输入消息元素和输出消息元素。
每个元素Hello/HelloResponse都由Types部分中包含的XML模式定义。
 

(编辑:汽车网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章