File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes how to retrieve list data from webservice into jsp page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "how to retrieve list data from webservice into jsp page?" Watch "how to retrieve list data from webservice into jsp page?" New topic
Author

how to retrieve list data from webservice into jsp page?

Sarah Choudhary
Greenhorn

Joined: Sep 05, 2012
Posts: 11
hi,

I am calling a web service function in jsp client application. This function is returning a list (Retrieved from database). My question is how can I modify my code so that all the values in the list can be displayed in jsp (Client application)?


I am using netbeans IDE 7.2.


Actually, I have to tried the following code (jsp) but it only displays the last value in the list while testing the web service in netbeans gives all the values of list.




web service code


Saket Kumar Sinha
Ranch Hand

Joined: Aug 04, 2011
Posts: 32

Since you are returning ArrayList



This would print all the data. for proper formatting you can use table tag. and can put the result in tr and td.
Sarah Choudhary
Greenhorn

Joined: Sep 05, 2012
Posts: 11
but it gives an error of incompatible type i.e. ArrayList required, string is found



When I test the web service (above mentioned code) using netbeans IDE, it returns the list values but when I try to get these values through client application, only the last value of the list is returned.





Saket Kumar Sinha wrote:Since you are returning ArrayList



This would print all the data. for proper formatting you can use table tag. and can put the result in tr and td.
Sarah Choudhary
Greenhorn

Joined: Sep 05, 2012
Posts: 11
Can somebody tell me, why the client app. is getting a string value? It should get list data instead of a single string value as web service is returning list data while testing.

One more thing; While debugging, I have noticed that the class generated by jax-ws RI has changed the return value of getFeedback() to string. Why is it so?? I have checked .java file, it's still returning the list data.

In short, the problem is while testing web service, it gives the expected list data while invoking service through client gives an error of incompatible type.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12785
    
    5
It makes no sense to return an object implementing List - instead return an array, a standard data type in SOAP and RPC.

Bill

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to retrieve list data from webservice into jsp page?