0
我想在axis2中實現一個簡單的例子。我創建了Service類和xml,生成了aar並在services目錄中爆炸了。我可以注意到我的服務和操作sayHello,但是在測試webservice時,它說在HelloAxisService中沒有這樣的方法,這是我的類。Axis2錯誤 - 沒有這樣的方法sayHello在類HelloAxisService
這裏是中聲明。
<service name="HelloAxisService">
<description>Hello Axis service</description>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
<parameter name="ServiceClass">com.my.axis.HelloAxisService</parameter>
</service>
,這裏是我的課
package com.my.axis;
public class HelloAxisService {
private String sayHello(String name){
return "Hello"+ name;
}
}
我的網址是http://localhost:8080/axis2/services/HelloAxisService/sayHello?name=dude
雖然該服務目前在服務列表如下,我在瀏覽器以及使用公理的客戶端程序中都出現錯誤
Available services
HelloAxisService
Service EPR : http://localhost:8080/axis2/services/HelloAxisService
Service Description : No description available for this service
Service Status : Active
Available Operations
sayHello