I posted this on the simplexml forum, but thought Id do so here as well in hopes of getting this solved faster, so if some of this doesnt seem to pertain to this forum that is why:
SO I have a method that uses httpclient to get data from a web service. The data is stored on the web service in an xml format. I can use httpclient getMethod to retrieve this xml either as a stream or a string.
So I have that data stored in a varable, called responseBody.
Now I need to convert that into xml form. If I try to add the current value of responseBody to a list (when it is a String) the list does print out the data and it does look like xml. But for some reason it is not being recognized as xml. It is being recognized as a String, and even though that String looks like xml, it is not being recognized as such ny a rich:tree
The final goal is to somehow bind this xml to a list (or some other possible value), which I can then bind to a richfaces tree through a backing bean.
So here is my method that gets the responseBody from the web service:
This seems to be working OK. Through various tests I have been able to print out the value of resposeBody and it does return this:
That is if I get responseBody as a String. If I get responseBody as a stream, I cant print out the value but I am guessing it would be the same, just in a stream form right? If I try to print it as a Stream it gives me some odd print out that doesnt mean much, I just know it does not mean null.
So assuming that is true, I have my variable responseBody, either as a String or Stream depending on what I do, and it holds the xml I printed above.
Now I need simple to take that data in, and output it in some kind of xml form that I can use. Although Im not sure what yet...
Like I said, the end goal is to use this xml to populate a rich tree. If I leave responseBody as a String, and use that to populate the tree it gives me a one node tree that has all of that xml text on one line...not too useful.
From what I understand from the jboss forum, if I can get some form of xml bound to the rich tree then I can use this line on my jsf page to do what I need:
But I just cant get this working,
so any help at all anyone might have would be great. I mean anything, I have tried all I can think to do, so even if you have help pretaining to the tree rather than simpleXml that is great
True wisdom is in knowing you know nothing - Socrates
subject: trouble parsing stream or string into xml