Tomcat 5.5 + Axis2 1.5.5 + 2 つのサーブレットを実行しています。私のサーブレットの 1 つは、axis2 も実行するカスタム サーブレットです。WEB-INF とその下のすべてのサブディレクトリ (conf、lib、services、および modules) があります。
さて、私のクラスの 1 つは、WS として公開されることになっている EntityWebService です。だから私はこのservices.xmlファイルを作成しました:
<service name="EntityWebService" scope="application">
<description>
service web sur les entites
</description>
<messageReceivers>
<messageReceiver
mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
<messageReceiver
mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
<parameter name="ServiceClass">com.webservice.EntityWebService</parameter>
</service>
これはこれをスローします:
<soapenv:Reason>
<soapenv:Text xml:lang="en-US">
The service cannot be found for the endpoint reference (EPR) /myServlet/services/EntityWebService/getEntityList
</soapenv:Text>
</soapenv:Reason>
私はもっと簡単なものも試しました:
<service name="EntityWebService">
<description>Web Service</description>
<parameter name="ServiceClass" locked="xsd:false">com.webservice.EntityWebService
</parameter>
<operation name="getEntityList">
<messageReceiver
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
</operation>
<operation name="getEntityDescription">
<messageReceiver
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
</operation>
<operation name="searchInstanceEntity">
<messageReceiver
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
</operation>
<operation name="entityWriter">
<messageReceiver
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
</operation>
</service>
これも同じように投げます。
これらの xml は両方とも、これらのメソッドを公開するために想定されています (少なくとも、すべての Web から理解したものです)。
- public OMElement getEntityDescription(String entityName)
- public OMElement getEntityList()
- public OMElement searchInstanceEntity (文字列ログイン、文字列パスワード、文字列ロール、文字列エンティティ名、文字列プロパティ、文字列条件)
- public OMElement entityWriter(String login, String password, String role,String entityName, String actionType, String property)
理想的には、これらのメソッドを次のように URL から直接呼び出したい:
WS 標準で実行できるように、次のように EntityWebService クラスを作成しました。
package com.webservice;
[imports]
@WebService
public class EntityWebService extends AbstractWebService
{
@WebMethod
public OMElement getEntityList(OMElement e) throws RemoteException
{
[...]
}
@WebMethod
public OMElement getEntityDescription(OMElement omEntityParam) throws RemoteException
{
[...]
}
@WebMethod
public OMElement searchInstanceEntity(OMElement omParam) throws RemoteException
{
[...]
}
@WebMethod
public OMElement entityWriter(OMElement omParam) throws RemoteException
{
[...]
}
@Override
public String getServiceName()
{
return "EntityWebService";
}
}
今私の質問。URL エンコードされたパラメーターを有効にして 4 つのメソッドを公開するにはどうすればよいですか?
設定が機能しません。何かが足りないようです。私はそれらを呼び出し可能にするために一度管理しましたが、パラメーターの入力はありません。前回の 1.5.5 リリースから Axis2.xml を取得しましたが、より良い結果は得られませんでした。RPC メッセージングと XML で動作する古い構成がありましたが、AAR コンテナーを取り除きたいと考えていました。上で示した XMLInOut メッセージング services.xml を持っている友人がいますが、それは彼のために働いています。彼は次のようなサービスの下にディレクトリを作成しました: /myServlet/services/EntityWebService/META-INF/services.xml
助けてください、仕事でこれが必要です。どうも