• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML result as a String

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic