Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to return an xml file from web service  RSS feed

 
Bipul Agrawal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a web service which is returning a string.

I want to extend this web service so that it returns an xml based string.

To begin with I am able to return xml based strings from a normal POJO class

Could you please help me with this.

Regards
Bipul
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By "XML based string" I assume you mean that the string contains a textual representation of an XML document. If that's correct, where do you see the difference between a WS that returns a string (which you have) and a WS that returns such an "XML based string"? Both sound identical to me. You would have to encapsulate the XML string so that it doesn't interfere with the SOAP processing (assuming you're talking about a SOAP WS - you haven't said), possibly by base-64 encoding it.
 
Bipul Agrawal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the response. Yes i am using the SOAP processing.

Currently my web service is returning a normal string.

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!