You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Young, Wayne" <WY...@metasolv.com> on 2005/09/27 16:18:11 UTC
newbie question
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.
Wayne
wyoung@metasolv.com
Re: newbie question
Posted by Saminda Abeyruwan <sa...@opensource.lk>.
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