1

wsdl2java.bat を使用してスタブを生成しようとしています。wsdl は 2 つのバインディングで構成されています。wsdl2bat は最初のバインディングで操作用のインターフェースを作成しますが、秒のバインディングでは操作用に何も生成しないことがわかります。wsdl2java.bat -uri http://... -o client -d adb -s -u.

たとえば、コードは次のようになります

try {
     //Create the stub by passing the AXIS_HOME and target EPR.
     //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOME 
     Axis2SampleDocLitPortTypeStub stub= new Axis2SampleDocLitPortTypeStub(null,
                                "http://localhost:8080/axis2/services/Axis2SampleStub");
     //Create the request document to be sent.
     EchoString  reqDoc= EchoString.Factory.newInstance();
     reqDoc.setEchoString("Echo this");
     //invokes the Web service.
     EchoStringReturn resDoc=stub.echoString(reqDoc);
     System.out.println(resDoc.getEchoStringReturn());

    } catch (Exception e) {
        e.printStackTrace();
    }

ここでの問題は、スタブの resDoc インスタンスにメソッド getEchoStringReturn があることです。

4

1 に答える 1