This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
If the "objects" you want to return are just holders for some strings, why not define your service as returning sets of strings?
Actually the most important questions have to do with the potential clients of this web service. What do you expect clients to be looking for? What software will they be running?
Is this a SOAP or RESTful style service?
Joined: Jan 14, 2012
This is a SOAP style service
The objects are just holders of some string, would it be easier to return sets of Strings, I had to set them to objects as it is part of the requirements of my assignment but returning at least a string will be a start.
As for the clients, I would need the client to be able to view the records in the database and scroll through them, then eventually update the database. I have to create two clients using two different software, java (netbeans) and .net (VS 10)
I tried to return the Strings I finally got a value apart from null, thanks for that suggestion. Although i'm only receiving the last record in the database, I guess thats why we have to save them in an array of objects to return all the records.
I would recommend creating a Java bean class that contains fields for all the data that is to be returned. Use this return type when declaring the return type of the methods to be exposed in the web service.
1. Your code will be easier to understand.
2. Such a Java bean will correspond to a XML type, resulting in an element (with contents) in the response XML. If there, in the future, is a need for introducing a new version of the return data, this will be significantly easier with the mentioned construct.