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

时间:2021-01-15 09:55:38

I've got in my webservice a simple public boolean isAlive() service. I defined it in my WSDL :

我的web服务中有一个简单的公共布尔值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>

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 ?

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

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.

编辑:在Eclipse下验证WSDL之后我有警告WS-I:(BP2208)wsdl:操作不是请求/响应或搜索后的单向操作我在这里找到了一个描述:http://www.ws-i .org / Testing / Tools / 2005/01 / BP11_TAD_1-1.htm#BP2208(似乎锚不起作用)所以我猜错误可能是缺少的wsdl:input。

2 个解决方案

#1


1  

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

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

<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 :(

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

#2


0  

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.

希望这可以帮助。

#1


1  

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

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

<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 :(

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

#2


0  

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.

希望这可以帮助。