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 Shivaraj Tenginakai <ts...@gmail.com> on 2008/08/10 12:05:03 UTC

Re: axis2 How to convert XMLStreamReader to String?

There are two ways you can achieve this:
 * First, as you are attempting:
      XMLStreamReader reader = request.getPullParser(null);
      OMElement omElement = new StAXOMBuilder(reader).getDocumentElement();
      String xml = omElement.toStringWithConsume();

      This only works for me, if I have only one element in the request,
else it returns the first element.

* Second, easier, get the OMElement directly
      OMElement omElement = request.getOMElement(null, null);
      String xml = omElement.toStringWithConsume();

Not sure if either of these are "official", I figured it out by looking at
the generated code for the request class.

Shivaraj Tenginakai



-- 
View this message in context: http://www.nabble.com/axis2-How-to-convert-XMLStreamReader-to-String--tp18396460p18912078.html
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