File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML result as a String

 
Kristian Ledung
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Kristian Ledung
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Kristian,
Unless you consume the service and print the string result, you will not be able to tell on xml structure.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic