Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Objects used in webservice  RSS feed

 
krishnapriya varma
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
i am a newbie. I am writing a webservice that takes in a request object REQ and sents back a response object RES.

i have the request object & response mentioned to be Serializable. The request object is in turn consisting of a String S1 and another object OBJ1 that has an a String and Array of String as its members.

Similarly RES is also composed of an OBJ2 that in turn contains array of Strings


I have 2 Qs:
1. Is it necessary to have the objects --> OBJ1 and OBJ2 also Serializable???
2. If i have defines an exception class should that also be made as Serializable???

thanks in advance

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most web services, particularly SOAP based ones, use standard variable types rather than serializing Java objects.

Passing objects around is certainly doable in a RESTful style service but they would obviously need to be serializable.

Obviously, passing serialized objects requires much more compatibility between server and client.

The most important question at this point is: - what sort of clients are you expecting to use this service?

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!