Handling Response in Axis2

Discussion in 'Java' started by itsprabhu@gmail.com, Feb 12, 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.csaxo.com/location/xsd"><ALogin
    id="10532" mask="-1"/></m:Response>

    When i use response.getResponse() o/p is
    <xml-fragment xmlns:m="http://www.csaxo.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 12, 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. axis2 why?

    , Dec 30, 2005, in forum: Java
    Replies:
    0
    Views:
    558
  2. Replies:
    0
    Views:
    390
  3. milesd
    Replies:
    2
    Views:
    1,079
    milesd
    Oct 4, 2008
  4. Michael Post
    Replies:
    5
    Views:
    1,164
    Arne Vajhøj
    Aug 22, 2009
  5. Replies:
    0
    Views:
    387
Loading...

Share This Page