`
chelsea
  • 浏览: 112449 次
  • 来自: ...
社区版块
存档分类
最新评论

Web Services:WSDL 1.1 规范中的几个错误

    博客分类:
 
阅读更多

读完了WSDL 1.1的规范,令人惊讶的是发现似乎例子中有几个错误

在下面用红色字体标出了错误相关之处,用蓝色字体标出了注释

我不确定是我理解有误还是它真的错了,贴出来大家一起看看;再说现在都WSDL2.0了

原文地址:http://www.w3.org/TR/wsdl

 

1,Example 1 (同样的错误还发生在Example 2, 4,5,估计是“copy-paste” bug pattern)

Example 1 SOAP 1.1 Request/Response via HTTP

<?xml version="1.0"?>
<definitions name="StockQuote"

targetNamespace="http://example.com/stockquote.wsdl"
          xmlns:tns="http://example.com/stockquote.wsdl"
          xmlns:xsd1="http://example.com/stockquote.xsd"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns="http://schemas.xmlsoap.org/wsdl/">

    <types>
       <schema targetNamespace="http://example.com/stockquote.xsd"
              xmlns="http://www.w3.org/2000/10/XMLSchema">
           <element name="TradePriceRequest">
              <complexType>
                  <all>
                      <element name="tickerSymbol" type="string"/>
                  </all>
              </complexType>
           </element>
           <element name="TradePrice">
              <complexType>
                  <all>
                      <element name="price" type="float"/>
                  </all>
              </complexType>
           </element>
       </schema>
    </types>

    <message name="GetLastTradePriceInput">
        <part name="body" element="xsd1:TradePriceRequest"/>
    </message>

    <message name="GetLastTradePriceOutput">
        <part name="body" element="xsd1:TradePrice"/>
    </message>

    <portType name="StockQuotePortType">
        <operation name="GetLastTradePrice">
           <input message="tns:GetLastTradePriceInput"/>
           <output message="tns:GetLastTradePriceOutput"/>
        </operation>
    </portType>

    <binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GetLastTradePrice">
           <soap:operation soapAction="http://example.com/GetLastTradePrice"/>
           <input>
               <soap:body use="literal"/>
           </input>
           <output>
               <soap:body use="literal"/>
           </output>
        </operation>
    </binding>

    <service name="StockQuoteService">
        <documentation>My first service</documentation>
        <port name="StockQuotePort" binding="tns:StockQuoteBinding"> <!--应为 StockQuoteSoapBinding ? -->
           <soap:address location="http://example.com/stockquote"/>
        </port>
    </service>

</definitions>

 

2, Example 5: GetLastTradePrice vs. GetTradePrices

Example 5. SOAP binding of request-response RPC operation over HTTP

<?xml version="1.0"?>
<definitions name="StockQuote"

targetNamespace="http://example.com/stockquote.wsdl"
          xmlns:tns="http://example.com/stockquote.wsdl"
          xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
          xmlns:xsd1="http://example.com/stockquote/schema"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
          xmlns="http://schemas.xmlsoap.org/wsdl/">

    <types>
       <schema targetNamespace="http://example.com/stockquote/schema"
              xmlns="http://www.w3.org/2000/10/XMLSchema">
           <complexType name="TimePeriod">
              <all>
                  <element name="startTime" type="xsd:timeInstant"/>
                  <element name="endTime" type="xsd:timeInstant"/>
              </all>
           </complexType>
           <complexType name="ArrayOfFloat">
              <complexContent>
                  <restriction base="soapenc:Array">
                      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:float[]"/>
                  </restriction>
              </complexContent>
           </complexType>
       </schema>
    </types>

    <message name="GetTradePricesInput">
        <part name="tickerSymbol" element="xsd:string"/>
        <part name="timePeriod" element="xsd1:TimePeriod"/>
    </message>

    <message name="GetTradePricesOutput">
        <part name="result" type="xsd1:ArrayOfFloat"/>
        <part name="frequency" type="xsd:float"/>
    </message>

    <portType name="StockQuotePortType">
        <operation name="GetLastTradePrice" parameterOrder="tickerSymbol timePeriod frequency"><!--应为 GetTradePrices? -->
           <input message="tns:GetTradePricesInput"/>
           <output message="tns:GetTradePricesOutput"/>
        </operation>
    </portType>

    <binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GetTradePrices">
           <soap:operation soapAction="http://example.com/GetTradePrices"/>
           <input>
               <soap:body use="encoded" namespace="http://example.com/stockquote"
                          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
           </input>
           <output>
               <soap:body use="encoded" namespace="http://example.com/stockquote"
                          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
           </output>
        </operation>>
    </binding>

    <service name="StockQuoteService">
        <documentation>My first service</documentation>
        <port name="StockQuotePort" binding="tns:StockQuoteBinding">
           <soap:address location="http://example.com/stockquote"/>
        </port>
    </service>
</definitions>

 

3,Example 3: smtp?

Example 3. SOAP binding of one-way operation over SMTP using a SOAP Header

<?xml version="1.0"?>
<definitions name="StockQuote"
          targetNamespace="http://example.com/stockquote.wsdl"
          xmlns:tns="http://example.com/stockquote.wsdl"
          xmlns:xsd1="http://example.com/stockquote.xsd"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns="http://schemas.xmlsoap.org/wsdl/">

    <message name="SubscribeToQuotes">
        <part name="body" element="xsd1:SubscribeToQuotes"/>
       <part name="subscribeheader" element="xsd1:SubscriptionHeader"/>
    </message>

    <portType name="StockQuotePortType">
        <operation name="SubscribeToQuotes">
           <input message="tns:SubscribeToQuotes"/>
        </operation>
    </portType>

    <binding name="StockQuoteSoap" type="tns:StockQuotePortType">
        <soap:binding style="document" transport="http://example.com/smtp"/><!--应为http://schemas.xmlsoap.org/soap/smtp? -->
        <operation name="SubscribeToQuotes">
           <input message="tns:SubscribeToQuotes">
               <soap:body parts="body" use="literal"/>
               <soap:header message="tns:SubscribeToQuotes" part="subscribeheader" use="literal"/>
           </input>
        </operation>
    </binding>

    <service name="StockQuoteService">
        <port name="StockQuotePort" binding="tns:StockQuoteSoap">
           <soap:address location="mailto:subscribe@example.com"/>
        </port>
    </service>

    <types>
        <schema targetNamespace="http://example.com/stockquote.xsd"
               xmlns="http://www.w3.org/2000/10/XMLSchema">
           <element name="SubscribeToQuotes">
               <complexType>
                   <all>
                       <element name="tickerSymbol" type="string"/>
                   </all>
               </complexType>
           </element>
           <element name="SubscriptionHeader" type="uriReference"/>
        </schema>
    </types>
</definitions>
分享到:
评论

相关推荐

    WSDL 1.1 中文规范 doc 版.rar

    另外WSDL1.1是一个宽泛的规范,所有的语法都以非正式的形式出现,而且为了满足WEB Service 扩展性的需求,也不可能定义出详尽的语法,请在阅读时特别注意。 我的翻译版本以word形式提供,请要转载的同学们别把酷壳...

    WSDL中文规范1.1版

    WSDL中文规范1.1版WSDL中文规范1.1版WSDL中文规范1.1版WSDL中文规范1.1版WSDL中文规范1.1版WSDL中文规范1.1版WSDL中文规范1.1版WSDL中文规范1.1版WSDL中文规范1.1版WSDL中文规范1.1版WSDL中文规范1.1版WSDL中文规范...

    WSDL-中文规范1.1.pdf

    WSDL-中文规范1.1

    WSDL1.1标准规范

    WSDL官方标准规范,方便随时参考

    J2EE Web Services: XML SOAP WSDL UDDI WS-I JAX-RPC JAXR SAAJ JAXP

    J2EE Web Services: XML SOAP WSDL UDDI WS-I JAX-RPC JAXR SAAJ JAXP

    Web 服务-- WSDL 1.1 理解与建模1

    尽管很流行,但是 WSDL 1.1 仍然有一些问题,包括使用的模式很多,而且 Web 服务处理 WSDL 文档的方法各异。根据其中一个模式版本编写的文档一般与其

    webservices-wsdl详解

    NULL 博文链接:https://cowry.iteye.com/blog/1457063

    Understanding Web Services XML WSDL SOAP and UDDI

    理解WebServices xml wsdl SOAP和uddi的好东西,pdf

    wsdl4j-1.6.3-API文档-中文版.zip

    赠送jar包:wsdl4j-1.6.3.jar; 赠送原API文档:wsdl4j-1.6.3-javadoc.jar; 赠送源代码:wsdl4j-1.6.3-sources.jar; 赠送Maven依赖信息文件:wsdl4j-1.6.3.pom; 包含翻译后的API文档:wsdl4j-1.6.3-javadoc-API...

    Primavera Unifier WebServices.wsdl

    Oracle Primavera Unifier v19.12 WebServices.wsdl 文件 包括Unifier对外的所有接口方法含参数 建议只对接v19.12版本,反之不必要的异常

    gowsdl:WSDL2Go代码生成及其SOAP代理

    安装在本地下载并构建: go get github.com/hooklift/gowsdl/... 从Homebrew brew install gowsdl : brew install gowsdl目标尽可能生成惯用的Go代码仅支持符合文档/文档包装服务支持: WSDL 1.1 XML模式1.0 SOAP ...

    gowsdl:WSDL2Go 代码生成及其 SOAP 代理,hookliftgowsdl 的私有分支

    特征仅支持符合Document/Literal 包装服务尝试尽可能多地生成惯用的 Go 代码并行生成 Go 代码:类型、操作和肥皂代理支持: WSDL 1.1 XML 架构 1.0 肥皂 1.1 递归解析外部 XML 模式,最多 5 次递归。 支持提供 WSDL ...

    现实世界XML Web服务:适用于VB和VB .NET开发人员Real World XML Web Services: For VB and VB .NET Developers

    解释了从XML Schema,序列化,SOAP,WSDL开始的Web服务的基础,并介绍了使用ASP.NET实施Web服务的实用细节。

    java webservices.jar

    在java开发services中,会用到: 1.webservices-api.jar 2.webservices-extra.jar 3.webservices-rt.jar 4.webservices-tools.jar 5.webservices-extra-api.jar 此压缩文件里就是这五个jar文件。

    android wsdl 实现webServices

    android wsdl 实现webServices

    understanding web services. xml, wsdl, soap and uddi

    基础的Web Services(假定你没有EAI背景,最好在涉入SOA之前阅读这两本书)Enterprise Application Integration Addison-Wesley Information Technology Series) by David S. Linthicum Next Generation ...

    使用Soap消息调用Web Services

    HelloWorld-service.wsdl 文件描述了 Web Services 的服务访问点,而 HelloWorld-binding.wsdl 文件描述了 Web Services 的通信消息的数据结构、每个访问点支持的操作、特定的断口类型的具体协议和数据格式规范的...

    soap-server:SOAP 1.1和1.2服务器的纯PHP实现

    goetas-webservices / soap-server PHP实现SOAP 1.1和1.2服务器规范。 优点: 纯PHP,不依赖ext-soap 可扩展(JMS事件侦听器支持) PSR-7 HTTP消息传递 PSR-15 HTTP服务器处理程序 无需在生产中解析WSDL / XSD ...

    Web Services 教程

    Web services 把 Web 应用程序提升到了另外一个层面 7 Web services 有两种类型的应用 7 Web Services 平台元素 8 什么是 SOAP? 8 什么是 WSDL? 8 什么是UDDI? 8 Web Service 实例 9 一个实例:ASP.NET Web ...

    W3C教程(13):W3C WSDL 活动

    Web Services 与应用程序到应用程序的通信有关。WSDL 是一门基于 XML 的 Web Services 描述语言。 Web Services 与应用程序到应用程序的通信有关。...作为一种可描述 Web Services 的 XML 格式,WSDL 1.1 于 2001

Global site tag (gtag.js) - Google Analytics