1

APIは、メソッド「getStock」と次のパラメーターを使用する必要があると言っています:accessToken、company、itemNumber、commissionNumber。このコードを書きましたが、うまくいきません。

    SOAPEnvelope envelope = soapPart.getEnvelope();
    //envelope.addNamespaceDeclaration("sam", "http://samples.axis2.techdive.in");

    // SOAP Body
    SOAPBody soapBody = envelope.getBody();
    SOAPElement method = soapBody.addChildElement("getStock");
    SOAPElement firstParam = method.addChildElement("accessToken");
    firstParam.addTextNode("xxx");

    SOAPElement secondParam = method.addChildElement("company");
    secondParam.addTextNode("AS");

    SOAPElement thirdParam = method.addChildElement("itemNumber");
    thirdParam.addTextNode("020001");

    SOAPElement fourthParam = method.addChildElement("commissionNumber");
    fourthParam.addTextNode("0");

    soapMessage.saveChanges();

そして、NamespaceDeclaration はどうですか?

次のエラーが表示されます。

応答 SOAP メッセージ = ns2:Client {}getStock のディスパッチ メソッドが見つかりません プロセスは終了コード 0 で終了しました

こんにちは アンドリュー

4

1 に答える 1