SOAP Envelope/Encoding using Axis 1.2

Discussion in 'Java' started by almousawi@gmail.com, Oct 10, 2007.

  1. Guest

    No sure if i am using the write group. My 2 questions are:
    1. How can i know the exact soap message being sent (how to print
    it).
    It seems the server is getting an envelope tag appended twice to my
    message.

    2.I am trying to use SOAP Axis 1.2 to connect to non-java service.
    When I use the code below, I keep getting Error:
    aultDetail:
    {http://xml.apache.org/axis/}stackTrace:
    SOAP envelope validation error. Envelope element doesn't have
    SOAP 1.1 encoding attribute or requested encoding is not supported.
    ..........


    Call call = (Call) service.createCall();
    call.setEncodingStyle("SOAP-ENC=\"http://schemas.xmlsoap.org/soap/
    encoding/\"");
    SOAPBodyElement[] input = new SOAPBodyElement[1];
    Element payload = buildInputQuery(queryFileName);
    input[0] = new SOAPBodyElement(payload );//inputQuery);
    this.writeDOMDocument(payload.getOwnerDocument(), System.out);
    Vector elems = (Vector) call.invoke( input );


    ==============
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ns1="somefile.wsdl">
    <SOAP-ENV:Header>
    <ns1:Login xsi:type="ns1:ATSPA_Login" SOAP-
    ENV:mustUnderstand="1">
    <username>USERNAME</username>
    <pwd_hash>PASSWORD_HASH</pwd_hash>
    </ns1:Login>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/
    soap/encoding/">
    <ns1:GetAccountAddress>
    <account_id xsi:type="xsd:integer">222</account_id>
    </ns1:GetAccountAddress>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    , Oct 10, 2007
    #1
    1. Advertising

  2. Mark Clements, Oct 13, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page