• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to return an XML Document in a web service..?  RSS feed

Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Can anyone tell me how to return an Xml document in a Web Service.?
The xml document i wanted to return is

<?xml version="1.0" encoding="UTF-8"?>

The attempt I made is, wrote this into a 'response.xml' file using
FileOutputStream and tried to return its object.

I am using RAD V6.0.
while using the wizard and creating a web service from the java bean ,
error message was seen
"WSWS3292W: Warning: The class java.io.FileOutputStream is defined in a java or javax package and cannot be converted into an xml schema type. An xml schema anyType will be used to define this class in the wsdl file."

I tried changing the return type as Object instead of FileOutputStream but retuned the same file object.
Web Service wizard is able to create a web service successfully but when i test the web service uisng the sample JSP's that the wizard creates, JSP Processing error is seen with error code 500.

There is an error in Result.jsp
Do i need to perform type cast or change any part of these jsp's(TestClient.jsp, Result.jsp..) ..?

Or If you had other way of returning an XML document in a web service please tell me...

Thank you
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!