Hi,
I'm a newbie to web services and I'm having difficulty returning an "xml formatted"
string from a simple
java class. All of the "less-than" and "greater-than" symbols get converted to:
"& lt;" and "& gt;" without the spaces
respectively.
I'm currently using JDeveloper and having it create the WSDL based on my java class. The return type in WSDL is a simple "xsd:string" as I would expect.
Because of this change from my literal character of '<' and '>' to the expanded xml notation, I am having problems consuming the response in client applications. BTW, what is the proper terminology for this character translation of reserved xml characters?
I just did another
test where if I define my WSDL using the xsd schema of my expected result set and then have JDeveloper generate the java classes, my webservice will return xml in the proper format that I expected.
However, this seems like overkill as it could generate tons of java classes for complex xml schemas, which in turn makes it more difficult to populate with my xml data. Is this the correct approach (best practice) that I should be taking?
My ultimate goal is to produce an xml result set from my database (easy), have a java class get this result set and return it as a string (easy) and have the
SOAP response preserve my return string verbatim (hard). Should I be looking into a REST solution instead of a SOAP solution? In my early testing, when I invoked my web service via REST, it did preserve my return string verbatim.
Thanks,
Alan [ August 21, 2007: Message edited by: Alan Davey ]
[ August 21, 2007: Message edited by: Alan Davey ]
[ August 21, 2007: Message edited by: Alan Davey ]