3.2.2 Apache Axis for Java Webサービス・クライアントのプログラミング・ツールキット

SALTは、AXISのwsdl2javaユーティリティをサポートしています。このユーティリティは、WSDLドキュメントからjavaスタブ・コードを生成します。AXIS Webサービスのプログラミング・モデルは、WebLogicに似ています。

ヒント:

  • HTTP MIME添付用、AXIS固有のWSDLドキュメントを使用します

    SALTは、Oracle Tuxedo CARRAYデータのHTTP MIME転送をサポートしています。WSDLのオンライン・ダウンロードとtmwsdlgenユーティリティには、特別なオプションを指定する必要があります。

    オンライン・ダウンロード:

    http://salt.host:portnumber//wsdl?mappolicy=raw&toolkit=axis

    tmwsdlgenユーティリティ

    tmwsdlgen -c WSDF_FILE -m raw -t axis

  • RPC/encodedスタイルを使用する場合は、AXISでマルチリファレンス形式を無効にします
    TuxedoWebServiceLocator service = new TuxedoWebServiceLocator();
    service.getEngine().setOption("sendMultiRefs", false);¦
  • WS-ReliableMessaging通信を行うには、SALTでApache Sandenshaプロジェクトを使用します。

    SALTとApache Sandenshaプロジェクトの間におけるWS-ReliableMessagingの相互運用性はテスト済です。Sandenshaの非同期モードとsend offerをコードで設定する必要があります。

    サンプルのApache Sandensha非同期モードとsend offerのサンプル・コードを次の例に示します:

例3-4 サンプルのApache Sandensha非同期モードとsend offerのサンプル・コード


/* Call the service */
           TuxedoWebService service = new TuxedoWebServiceLocator();

       Call call = (Call) service.createCall();
           SandeshaContext ctx = new SandeshaContext();

           ctx.setAcksToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
       ctx.setReplyToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
       ctx.setSendOffer(true);
       ctx.initCall(call, targetURL, "urn:wsrm:simpapp", Constants.ClientProperties.IN_OUT);

       call.setUseSOAPAction(true);
       call.setSOAPActionURI("ToUpperWS");
       call.setOperationName(new javax.xml.namespace.QName("urn:pack.simpappsimpapp_typedef.salt11", "ToUpperWS"));
       call.addParameter("inbuf", XMLType.XSD_STRING, ParameterMode.IN);
       call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);

           String input = new String();
           String output = new String();
       int i;
           for (i = 0; i < 3; i++ ) {
                      input = "request" + "_" + String.valueOf(i);

              System.out.println("Request:"+input);
                   output = (String) call.invoke(new Object[]{input});
                   System.out.println("Reply:" + output);
            }

ctx.setLastMessage(call);
       input = "request" + "_" + String.valueOf(i);
       System.out.println("Request:"+input);
           output = (String) call.invoke(new Object[]{input});