axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saminda Abeyruwan <sami...@opensource.lk>
Subject Re: newbie question
Date Wed, 28 Sep 2005 05:58:32 GMT
Young, Wayne wrote:

>If I create an OM element as below in my client & invoke the
>"getTreeviewXML" method, how do I read the "location" I passed in using
>my Axis2 service?
>
>        OMFactory fac = OMAbstractFactory.getOMFactory();
>        OMNamespace omNs =
>fac.createOMNamespace("http://metasolv.com/rv3d", "rv3d");
>        OMElement method = fac.createOMElement("getTreeviewXML", omNs);
>        OMElement value = fac.createOMElement("location", omNs);
>        value.addChild(fac.createText(value, "12345"));
>        method.addChild(value);
>
>I copied this from the echo client, but the echo service just does a
>"detach" and doesn't actually read the value.
>
>Thanks in advance.
>  
>
Axis2 service will give you full liberty to access SOAP body's first clild.

Let say you have  a operation "public OMElement operation1(OMElement 
ele){}" in your service, and you have to get the location as you 
mentioned prior.

"ele" will be "getTreeviewXML"... so
"location" is ele.getFirstChild() .... to extract text 
....ele.getFirstChild().getText() ... simple as that :)

Saminda

Mime
View raw message