【问题标题】:Axis2 WSDL2Java : missing no-arg operation in generated stubAxis2 WSDL2Java:生成的存根中缺少无参数操作
【发布时间】:2008-11-25 13:42:34
【问题描述】:

我的网络服务中有一个简单的public boolean isAlive() 服务。 我在我的 WSDL 中定义了它:

<wsdl:types>
    <xsd:element name="isAliveResponse" type="xsd:boolean">
    </xsd:element>
</wsdl:types>
<wsdl:message name="isAliveResponse">
    <wsdl:part element="ns:isAliveResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="myService">
    <wsdl:operation name="isAlive">
        <wsdl:output message="ns:isAliveResponse"/>
    </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="myServiceSOAP" type="ns:myService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="isAlive">
    <soap:operation soapAction="http://myServiceURL/isAlive" />
    <wsdl:input>
        <soap:body use="literal" />
    </wsdl:input>
    <wsdl:output>
        <soap:body use="literal" />
    </wsdl:output>
</wsdl:operation>
</wsdl:binding>

当我生成服务框架时,方法是生成的,但不在客户端存根中。 WSDL 有问题吗?即使该方法没有参数,我是否应该放置一个 wsdl:input(我没有放置整个 WSDL,但所有其他带有“请求”参数的方法都生成得很好)?如果我必须放一个 wsdl:input 它的消息是什么?

编辑:在 Eclipse 下验证 WSDL 后,我在搜索后收到警告 WS-I: (BP2208) wsdl:operation was not a request/response or one-way operation,我在这里找到了描述:http://www.ws-i.org/Testing/Tools/2005/01/BP11_TAD_1-1.htm#BP2208(似乎锚不起作用)所以我猜错误可能是缺少 wsdl:input。

【问题讨论】:

    标签: java web-services wsdl axis2 wsdl2java


    【解决方案1】:

    正如我在编辑中所说,问题是缺少 wsdl:input。通过添加

    <wsdl:input message="ns:isAliveRequest" />
    

    <wsdl:message name="isAliveRequest"></wsdl:message>
    

    那么我原来的问题就解决了......结论,我应该先自己搜索更多,然后再问SO :(

    【讨论】:

      【解决方案2】:

      我不确定这是否是您的问题,但以下行似乎没有结束标记:

      <wsdl:types>
          <xsd:element name="isAliveResponse" type="xsd:boolean">
      </wsdl:types>
      

      应该是这样的:

      <wsdl:types>
          <xsd:element name="isAliveResponse" type="xsd:boolean"/>
      </wsdl:types>
      

      希望这会有所帮助。

      【讨论】:

      • 这只是我的复制/粘贴中的一个错误,但原件是正确的......我编辑了问题以更正。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多