Handling Response in Axis2

I

itsprabhu

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top