axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yadav, Yogendra \(IT\)" <Yogendra.Ya...@morganstanley.com>
Subject RE: [Axis2] Converting an OMElement into an Array of Objects
Date Tue, 09 Jan 2007 17:16:01 GMT
what is the exception ?

________________________________

From: Sven Schroebler [mailto:sven.schroebler@uni-muenster.de] 
Sent: Tuesday, January 09, 2007 12:04 PM
To: axis-user@ws.apache.org
Subject: [Axis2] Converting an OMElement into an Array of Objects



Hi All,

 

I am quite new to Axis2 and I am trying to develop a webservice for an
existing webapplication.

So far I managed to set up a basic webservice that transfers JavaBeans
(e.g. "UserDesktopBean") and it possible to access all of the simple
data types from the client application. Unfortunately, even after
reading multiple AXIOM tutorials, I don't know how to correctly work
with the JavaBeans nested inside the "UserDesktopBeans" that need to be
transferred as via AXIOM OMElement-wrapping.

 

 

At this time I use the following code to return an array of Objects as
an OMElement:

SERVER:

###########

//Converting an ArrayList to Array

Object[] budlist = buddies.toArray();

 

QName budQName = new
QName("http://desktop.core.herbie.buddies","buddies");

OMElement omElementBUD = BeanUtil.getOMElement(budQName, budlist, null,
false, null);

 

//Setting the OMElement in the UserDesktopBean

bean.setBuddies(omElementBUD);

 

 

CLIENT:

############

//here I am trying to transform the array back 

OMElement _buddies = benutzer.getBuddies();

ObjectSupplier os = new AxisService().getObjectSupplier();

Object[] budlist=new
Object[]{HerbieWSStub.HerbieObjectDesktopBean.class};

Object[] buddies = BeanUtil.deserialize(_buddies,budlist,os);

 

//here I am trying to access the first array element

HerbieWSStub.HerbieObjectDesktopBean buddies1 =
(HerbieWSStub.HerbieObjectDesktopBean) buddies[0];

System.out.println(buddies1.getName());            

 

Trying to access the array leads to an Exception at this time.

 

 

I would really appreciate, if you could help me with this problem.

 

For a better understanding of the underlying webservice, I've attached
the UserDesktopBean, the WSDL-File and the services.xml

 

Best Regards,
Sven
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to
waive confidentiality or privilege. Use of this email is prohibited when received in error.

Mime
View raw message