0

axis2 に簡単な例を実装しようとしています。Service クラスと xml を作成し、aar を生成して services ディレクトリに展開しました。サービスとオペレーション sayHello に気付くことができますが、Web サービスをテストすると、クラスである HelloAxisService にそのようなメソッド sayHello がないと表示されます。

ここにservices.xmlがあります

<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;
    }
}

私のURLはhttp://localhost:8080/axis2/services/HelloAxisService/sayHello?name=dude

サービスは以下のサービスのリストに存在しますが、ブラウザと axiom を使用するクライアント プログラムの両方でエラーが発生します。

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
4

1 に答える 1

0

コードを注意深く観察した後、問題が見つかりました。privateメソッド sayHello.Changing のアクセス修飾子でしたpublic

于 2012-05-14T09:16:32.713 に答える