Retrieving Response from webservice in Axis2

Discussion in 'Java' started by itsprabhu@gmail.com, Feb 2, 2007.

  1. Guest

    Hi all . I used Axis2 to convert my wsdl to java . I used the
    following sample pgm which actually uses the generated java files to
    invoke a method frm a webservice.

    sample pgm:

    ALogin AL = ALogin.Factory.newInstance();
    onnectionServiceStub stub = new ConnectionServiceStub();
    ServiceClient sc = stub._getServiceClient();

    LoginDocument.Login LR =
    LoginDocument.Login.Factory.newInstance();
    LR.setALogin( AL);
    LoginDocument requestDoc =
    LoginDocument.Factory.newInstance();
    requestDoc.setLogin(LR);
    //call the method
    ResponseDocument response
    =(ResponseDocument)stub.Login(requestDoc);
    System.out.println(response.getResponse()); // Working

    System.out.println(response.getResponse().getALogin()); // Not
    working

    Response contains:
    <m:Response xmlns:m="http://www.cisco.com/location/xsd"><ALogin
    id="10532" mask="-1"/></m:Response>

    When i use response.getResponse() o/p is
    <xml-fragment xmlns:m="http://www.cisco.com/location/xsd" xmlns:SOAP-
    ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <AesBusinessSession id="10532" mask="-1"/>
    </xml-fragment>

    But when i use response.getResponse().getALogin(); o/p is null

    i can able to access thro
    response.getBody().getFirstElement().getFirstOMChild(); but how to
    get thro getALogin(); Any typecast i need to do?

    Can anyone help .

    Thanks in advance.
    prabhu
    , Feb 2, 2007
    #1
    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.
Similar Threads
  1. Florian Grousset

    SOAP Webservice C# / Axis2

    Florian Grousset, Dec 5, 2006, in forum: Java
    Replies:
    0
    Views:
    2,836
    Florian Grousset
    Dec 5, 2006
  2. Replies:
    0
    Views:
    364
  3. cod3nam3

    jsp client for axis2 webservice

    cod3nam3, Oct 29, 2007, in forum: Java
    Replies:
    10
    Views:
    989
    cod3nam3
    Nov 10, 2007
  4. Andrew Thompson

    Re: jsp client for axis2 webservice

    Andrew Thompson, Oct 29, 2007, in forum: Java
    Replies:
    0
    Views:
    413
    Andrew Thompson
    Oct 29, 2007
  5. Michael Post
    Replies:
    5
    Views:
    1,119
    Arne Vajhøj
    Aug 22, 2009
Loading...

Share This Page