AXIS2 1.4 メソッドを使用する AXIS 1.4 クライアントを実装する必要があります。AXIS 1.4 クライアントは、スタブを作成することによって作成されます。クライアントはリクエストを送信し、何らかの添付ファイル (MTOM) を含むサービスからレスポンスを返します。AXIS 1.4 ポート タイプ オブジェクトでメソッド (操作) を呼び出すと、次のエラーが発生しました。
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
MTOM が AXIS を台無しにしたと思います。ここで質問があります。AXIS2 1.4 (MTOM) Web サービスから返された添付ファイルをどのように取得したのでしょうか? ティア。
フランチェスコ
PS: これがコードです。WSDL によって生成されるスタブがあります。問題は、ポートのスタブ メソッドを呼び出すと例外が発生することです。戻ってきたメッセージには添付ファイルがあります。
String codistat = "CODISTAT";
OrdinanzeViabilitaLocator ovlocretreive = new OrdinanzeViabilitaLocator();
ovlocretreive.setOrdinanzeViabilitaHttpSoap11EndpointEndpointAddress(".. the service url + action..");
try {
OrdinanzeViabilitaPortType ovretreive = ovlocretreive.getOrdinanzeViabilitaHttpSoap11Endpoint();
((Stub) ovretreive)._setProperty(javax.xml.rpc.Call.USERNAME_PROPERTY, "username");
((Stub) ovretreive)._setProperty(javax.xml.rpc.Call.PASSWORD_PROPERTY, "password");
//problems began here
MessageReqOrdinanze mrq = new MessageReqOrdinanze();
mrq.setCodistat(codistat);
Calendar date_from = Calendar.getInstance();
date_from.setTimeInMillis(0);
Calendar date_to = Calendar.getInstance();
date_from.setTimeInMillis(0);
mrq.setDate_from(date_from);
mrq.setDate_to(date_to);
// the next line generate the exception
MessageOrdinanze mretreive = ovretreive.getOrdinanze(mrq);
} catch (AxisFault e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ServiceException e) {
e.printStackTrace();
}
返されるメッセージには
<xop:include href="cid... >...< ../xop/include"/>
内部のタグ、それはMTOMです(私が推測する例外が発生します)。お役に立てれば。