Apache

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Get SOAP header from Call instance?

    5 answers - 1977 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    use call's addHeader
    ()
    -- dims
    5/11/06, Axel Bock <axel.bock.news (AT) googlemail (DOT) comwrote:
    Hi,
    I am having BIG problems with a very, very, very simple Axis WS call.
    Basically I am trying to get a String back from a web service, which has
    only one method without parameters. I managed to generate stubs and call it,
    but I would really like to call it without having to build stubs.
    problem is, the web service requires (!) a username and a password in the
    soap header (I can't do nothing about that). My code so far looks like this:
    String endpoint = "
    ";
    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(endpoint);
    Name (new QName("http://my.namespace.setting",
    "openSession"));
    String ret = (String) call.invoke(null);
    System.out.println("got: " + ret);
    --
    basically that is just fine, but I cannot get access to the soap header. the
    XML generated is exactly this:
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="
    "
    xmlns:xsd="" xmlns:xsi="
    ">
    <soapenv:Body>
    <ns1:openSession soapenv:encodingStyle="
    "
    xmlns:ns1="http://my.namespace.setting" />
    </soapenv:Body>
    </soapenv:Envelope>
    but I need something like this (this is actually working):
    <SAP-ENV:Envelope
    xmlns:SAP-ENV=""
    xmlns:SAP-ENC=" "
    xmlns:xsi=""
    xmlns:xsd=" ">
    <SAP-ENV:Header>
    <username>vdbvdb</username>
    <password>vdbvdbvdb</password>
    </SAP-ENV:Header>
    <SAP-ENV:Body>
    <m:openSession xmlns:m="http://my.namespace.setting"
    SAP-ENV:encodingStyle="
    " />
    </SAP-ENV:Body>
    </SAP-ENV:Envelope>
    >
    >
    >

    can you maybe (pretty please :) help me out?
    --
    Greetings & thanks in advance,
    Axel.
  • No.1 | | 2345 bytes | |

    , sorry - I didn't mention. I guess you're assuming I'm using Axis 2.
    I'm not :)
    And my call does not have an addHeader() method, as much as I wish for it
    :))

    Greetinsg & thanks,
    Axel.

    5/11/06, Davanum Srinivas <davanum (AT) gmail (DOT) comwrote:

    use call's addHeader
    ()

    -- dims

    5/11/06, Axel Bock <axel.bock.news (AT) googlemail (DOT) comwrote:
    Hi,

    I am having BIG problems with a very, very, very simple Axis WS call.

    Basically I am trying to get a String back from a web service, which has
    only one method without parameters. I managed to generate stubs and call
    it,
    but I would really like to call it without having to build stubs.

    problem is, the web service requires (!) a username and a password in
    the
    soap header (I can't do nothing about that). My code so far looks like
    this:

    String endpoint = "
    ";
    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(endpoint);
    Name (new QName("http://my.namespace.setting",
    "openSession"));
    String ret = (String) call.invoke(null);
    System.out.println("got: " + ret);
    --
    basically that is just fine, but I cannot get access to the soap header
    the
    XML generated is exactly this:

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="
    "
    xmlns:xsd="" xmlns:xsi="
    ">
    <soapenv:Body>
    <ns1:openSession soapenv:encodingStyle="
    "
    xmlns:ns1="http://my.namespace.setting" />
    </soapenv:Body>
    </soapenv:Envelope>

    but I need something like this (this is actually working):

    <SAP-ENV:Envelope
    xmlns:SAP-ENV=""
    xmlns:SAP-ENC=" "
    xmlns:xsi=""
    xmlns:xsd=" ">
    <SAP-ENV:Header>
    <username>vdbvdb</username>
    <password>vdbvdbvdb</password>
    </SAP-ENV:Header>
    <SAP-ENV:Body>
    <m:openSession xmlns:m="http://my.namespace.setting"
    SAP-ENV:encodingStyle="
    " />
    </SAP-ENV:Body>
    </SAP-ENV:Envelope>
    >
    >
    >

    can you maybe (pretty please :) help me out?
    --
    Greetings & thanks in advance,
    Axel.
    >
    >
    >
  • No.2 | | 1821 bytes | |

    Hi,

    I am having BIG problems with a very, very, very simple Axis WS call.

    Basically I am trying to get a String back from a web service, which has
    only one method without parameters. I managed to generate stubs and call it,
    but I would really like to call it without having to build stubs.

    problem is, the web service requires (!) a username and a password in the
    soap header (I can't do nothing about that). My code so far looks like this:

    String endpoint = "";

    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(endpoint);
    Name(new QName("http://my.namespace.setting",
    "openSession"));
    String ret = (String) call.invoke(null);
    System.out.println("got: " + ret);

    basically that is just fine, but I cannot get access to the soap header. the
    XML generated is exactly this:

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv=""
    xmlns:xsd="" xmlns:xsi="
    ">
    <soapenv:Body>
    <ns1:openSession soapenv:encodingStyle="
    " xmlns:ns1="
    http://my.namespace.setting" />
    </soapenv:Body>
    </soapenv:Envelope>

    but I need something like this (this is actually working):

    <SAP-ENV:Envelope xmlns:SAP-ENV=""
    xmlns:SAP-ENC="" xmlns:xsi="
    " xmlns:xsd="
    ">
    <SAP-ENV:Header>
    <username>vdbvdb</username>
    <password>vdbvdbvdb</password>
    </SAP-ENV:Header>
    <SAP-ENV:Body>
    <m:openSession xmlns:m="http://my.namespace.setting"
    SAP-ENV:encodingStyle="" />
    </SAP-ENV:Body>
    </SAP-ENV:Envelope>

    can you maybe (pretty please :) help me out?

    Greetings & thanks in advance,
    Axel.
  • No.3 | | 2554 bytes | |

    Nope. i made no such assumption :) Please read the url carefully. note
    the package names.
    -- dims

    5/11/06, Axel Bock <axel.bock.news (AT) googlemail (DOT) comwrote:
    , sorry - I didn't mention. I guess you're assuming I'm using Axis 2.
    I'm not :)
    And my call does not have an addHeader() method, as much as I wish for it
    :))
    --
    Greetinsg & thanks,
    Axel.
    --
    5/11/06, Davanum Srinivas <davanum (AT) gmail (DOT) comwrote:
    use call's addHeader

    ()

    -- dims

    5/11/06, Axel Bock < axel.bock.news (AT) googlemail (DOT) comwrote:
    Hi,

    I am having BIG problems with a very, very, very simple Axis WS call.

    Basically I am trying to get a String back from a web service, which has
    only one method without parameters. I managed to generate stubs and call
    it,
    but I would really like to call it without having to build stubs.

    problem is, the web service requires (!) a username and a password in
    the
    soap header (I can't do nothing about that). My code so far looks like
    this:

    String endpoint = "

    ";
    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(endpoint);
    Name (new QName(" http://my.namespace.setting",
    "openSession"));
    String ret = (String) call.invoke(null);
    System.out.println("got: " + ret);
    --
    basically that is just fine, but I cannot get access to the soap header.
    the
    XML generated is exactly this:

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="
    "
    xmlns:xsd=""
    xmlns:xsi="
    ">
    <soapenv:Body>
    <ns1:openSession soapenv:encodingStyle="
    "
    xmlns:ns1="http://my.namespace.setting" />
    </soapenv:Body>
    </soapenv:Envelope>

    but I need something like this (this is actually working):

    <SAP-ENV:Envelope

    xmlns:SAP-ENV=""
    xmlns:SAP-ENC="
    "
    xmlns:xsi=""
    xmlns:xsd=" ">
    <SAP-ENV:Header>
    <username>vdbvdb</username>
    <password>vdbvdbvdb</password>
    </SAP-ENV:Header>
    <SAP-ENV:Body>
    <m:openSession xmlns:m="http://my.namespace.setting"
    SAP-ENV:encodingStyle="

    " />
    </SAP-ENV:Body>
    </SAP-ENV:Envelope>
    >
    >
    >

    can you maybe (pretty please :) help me out?
    --
    Greetings & thanks in advance,
    Axel.
    >
    >
    >
  • No.4 | | 153 bytes | |

    Trying the EchoNonBlockingDualClient (addressing module is found) getting:
    org.apache.axis2.AxisFault: Address already in use: JVM_Bind
  • No.5 | | 327 bytes | |

    thanks, I already solved the problem. It was part my fault :)

    grettings,
    axel.

    5/11/06, Roman Weidlich <romanweidlich (AT) gmx (DOT) atwrote:

    Trying the EchoNonBlockingDualClient (addressing module is found) getting:

    org.apache.axis2.AxisFault: Address already in use: JVM_Bind

Re: Get SOAP header from Call instance?


max 4000 letters.
Your nickname that display:
In order to stop the spam: 5 + 5 =
QUESTION ON "Apache"

EMSDN.COM