axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Upul Godage" <upulg....@gmail.com>
Subject Re: OMElement problem
Date Mon, 08 Oct 2007 01:42:30 GMT
Hi,

You can print out the OMElement and see how you get the element at that
moment in your code.
System.out.println(myOMElement);

Upul


On 10/8/07, jerome.mariette <jerome@mbari.org> wrote:
>
>
>
> Hi everybody,
> I have a little probleme reading messages I got back from my web service:
> This is the OMElement I'm sending back
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace omNs =
> fac.createOMNamespace("http://server.webservice.aved.mbari.org", "ns1");
>         OMElement job_info = fac.createOMElement("AVEDJob", omNs);
>         OMElement cluster_id = fac.createOMElement("cluster", omNs);
>         OMElement job_id = fac.createOMElement("job", omNs);
>         cluster_id.setText(Integer.toString(45));
>         job_id.setText(Integer.toString(0));
>         job_info.addChild(cluster_id);
>         job_info.addChild(job_id);
>         return job_info;
>
> To read it I do like that:
>                 Iterator childElements = myOMElement.getChildElements();
>                 String s = ((OMElement)childElements.next()).getText();
>                 String s1 = ((OMElement)childElements.next()).getText();
>                 System.out.println("s " + s);
>                 System.out.println("s1 " + s1);
>
> If I do that outside a web service it's working (create the OMElement in a
> main and read it into the same main) ... but when I'm trying to read the
> OMElement coming back from my web service, it's not working!!!
> I guess it's because of the SOAP layer added to wrape the message, but I
> have no idea how to take it away to be able to work on my OMElement
> directly
> !!!
>
> thx for your help!
> --
> View this message in context:
> http://www.nabble.com/OMElement-problem-tf4585272.html#a13088866
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Mime
View raw message