Axis2 WSDL2Java:生成的存根中缺少无参数操作
我的网络服务中有一个简单的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如我在编辑中所说,问题是缺少 wsdl:input。 通过添加
,
然后我原来的问题就解决了......结论,我应该在询问之前自己进行更多搜索:(
As said in my edit the problem was the missing wsdl:input. By adding
and
then my original problem is solved... conclusion, I should have searched more by myself before to ask on SO :(
我不确定这是否是您的问题,但以下行似乎没有结束标记:
它应该是这样的:
希望这有帮助。
I'm not sure if this is your problem but the following line seems to have no closing tag:
It should be like this:
Hope this helps.