Axis2 WSDL2Java:生成的存根中缺少无参数操作

发布于 2024-07-10 09:28:34 字数 1571 浏览 5 评论 0原文

我的网络服务中有一个简单的 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 后,在搜索 I 后出现警告 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。

I've got in my webservice a simple public boolean isAlive() service.
I defined it in my 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>

When I generate the Service skeleton the method is generated but not in the client stub. Is there a problem in the WSDL ? Should I put a wsdl:input even if the method don't have arguments (I didn't put the whole WSDL but all the other method with a "request" arg are well generated) ? And if I have to put a wsdl:input what would be it's message ?

Edit : After validating the WSDL under Eclipse I have the warning WS-I: (BP2208) wsdl:operation was not a request/response or one-way operation after searching I found a description here : http://www.ws-i.org/Testing/Tools/2005/01/BP11_TAD_1-1.htm#BP2208 (it seems the anchor doesn't work) so I guess the error is probably the missing wsdl:input.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薄荷→糖丶微凉 2024-07-17 09:28:34

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

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

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

然后我原来的问题就解决了......结论,我应该在询问之前自己进行更多搜索:(

As said in my edit the problem was the missing wsdl:input. By adding

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

and

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

then my original problem is solved... conclusion, I should have searched more by myself before to ask on SO :(

情何以堪。 2024-07-17 09:28:34

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

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

它应该是这样的:

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

希望这有帮助。

I'm not sure if this is your problem but the following line seems to have no closing tag:

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

It should be like this:

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

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文