aspose file tools
The moose likes Web Services and the fly likes Return type of web service.. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Return type of web service.." Watch "Return type of web service.." New topic
Author

Return type of web service..

aseem agarwal
Greenhorn

Joined: Oct 17, 2009
Posts: 9
Can i return an array of strings from a web service,,,,

webmethod
example public String[] hello(){
String[] s=new String(3);

return s;
}
Ivan Krizsan
Bartender

Joined: Oct 04, 2006
Posts: 2193
Hi!
The best way to know is to implement an example web service and try it!
If you wonder whether you can return something as a result of a web service method or whether you can use some parameter type, then ask yourself how you would represent that data using XML.
An array of strings can be represented as an element with maxOccurs larger than 1. The result would also have to be wrapped, since the WS-I Basic Profile only allows the SOAP body to contain one single element.
Best wishes!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Return type of web service..
 
Similar Threads
Java class to WSDL
Better way to return XML document
Asynchronous server-side web service
Consuming SOAP Web Service
Invoke .Net web service from JSP