【问题标题】:Mule ESB - Web Service Consumer - Fails to parse WSDLMule ESB - Web 服务使用者 - 无法解析 WSDL
【发布时间】:2015-06-12 03:52:06
【问题描述】:

我在配置 Web 服务使用者时遇到了非常基本的问题,希望有人能提供帮助。

我正在使用 Anypoint Studio 2015 年 3 月版 版本:5.1.2 内部版本号:201504301511 在 Windows Vista 上

我尝试使用的服务的 WSDL 是

<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">
      <soap:address location="http://localhost:8080/"/>
    </port>
  </service>
</definitions>

这是来自 W3C 站点的示例的副本,仅修改了肥皂地址。

我遇到的第一个问题是,在成功将 WDL 文件导入我的 mule 项目后,我无法使用文件全局元素属性窗口使用文件浏览“按钮”填充 WDSL 位置文本框。

单击文件浏览按钮成功列出了我的 mule 项目中的所有 *.wsdl 文件,但选择其中任何一个都不会填充 WSDL 位置文本框。

在项目中手动输入 wsdl 的文件路径似乎可以识别 wsdl。它不再报告缺少的 wsdl 位置属性,它会自动从 wsdl (StockQuoteService) 中的服务定义填充服务文本框。但是,端口(和地址)下拉列表不会从 WSDL 条目中填充。

手动输入端口 (StockQuotePort) 会自动从 WSDL 填充地址文本框,但会报告错误“Web 服务使用者仅支持带有 SOAP 主体的端口”。

任何帮助将不胜感激。

【问题讨论】:

  • 是的,我遇到了同样的问题,但是您可以尝试使用此tshirt-service.cloudhub.io/?wsdl ...。我想知道 WS Consumer 目前是否仅适用于托管的 wsdl ...

标签: mule


【解决方案1】:

ws-consumer 也适用于本地 WSDL,并且适用于我在 Mac 上使用:

Anypoint Studio March 2015 Release
Version: 5.1.1
Build Id: 201504011500

可能是 Windows Studio 发行版的一个错误。但是您也可以切换到 XML 视图并编辑 ws-consumer-config 以从类路径中读取 WSDL:

    <ws:consumer-config name="Web_Service_Consumer1"
        wsdlLocation="MyLocalWsdl.wsdl" service="ImportV200606" port="ImportV200606Soap"
        serviceAddress="https://MyLocalService/service.svc?responseTimeout=280000"
        doc:name="Web Service Consumer">
    </ws:consumer-config>

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-02-13
  • 1970-01-01
  • 1970-01-01
  • 2014-09-10
  • 1970-01-01
相关资源
最近更新 更多