Hello! How bad is it to return a result from a webservice that is XML as a String? My webservice returns XML this way, but I want to do it according to good practice. [ January 23, 2006: Message edited by: Kristian Ledung ]
Sounds like you are probably looking for something like soap-with-attachments. If your result is naturally an XML document that is probably the cleanest approach.
Reid - SCJP2 (April 2002)
Reid M. Pinchback
Joined: Jan 25, 2002
When the encoding of the SOAP XML and the encoding of the XML result being returned are the same, sending it as a String would seem to work fine. Anybody ever tried that when the XML result is in a different encoding? That may be the criterion for deciding on one approach versus the other: needing to ensure that serialization/deserialization of the XML doc by SOAP preserved the character encoding.
Hi Reid, Regd preserving encoding format, can you specify in what soap encoding style or how we can send a xml with different encoding ?? because the de/serialization will not happen for soap with xml attachments. Also the java complex object will be sent as an SOAP inline complex types.
No idea what happens with attachements, haven't used them yet. That was pretty much my question - which of the two approaches, if either, would be "safe" when dealing with docs including more than vanilla 7-bit ASCII characters?
Joined: Jan 23, 2006
This is a part of my WSDL. This is the only thing my clients know about the result. The String is actually XML. What can I do to show the clients how the XML looks? I�m using RPC/encoded style.
<wsdl:message name="searchResponse"> <wsdl : part name="searchReturn" type="xsd:string"/> </wsdl:message> [ January 24, 2006: Message edited by: Kristian Ledung ]
author and deputy
Joined: Jul 13, 2001
Ok Kristian, Unless you consume the service and print the string result, you will not be able to tell on xml structure.