• Post Reply Bookmark Topic Watch Topic
  • New Topic

getting Vectors of Objects through Web Services  RSS feed

 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks..

Though the implementation is on a MIDP using J2ME, since the subject id on web services, i am posting this here...

I need to know whether it is possible to return a Vector which has objects though a web services cal...

To use web services i am using kSOAP in my mobile program..

I think my question revolves in the general domain of web services

I also need to know whether i can invoke the usual methods on those objects contained in the vector object...

Myobject obj= vector.elementAt(i);
System.out.println(obj.getName());

the above doesnt demo what i am actually to do...but if it was possible, i can go ahead and implement the needed functionality..


Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java objects as such can't be sent through SOAP (unless they're Serializable, and you're sending their binary representation, which I would advise against).

This article is helpful reading Collection types and WS.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem I would try to come up with a compact representation of these objects as Strings - easily handled with just about any SOAP toolkit. Suppose your custom objects have constructors that can take a String and toString() methods that can encode all the critical information as a String. More compact and easier to debug to boot.

As Ulf says, serialization and transmission as base64 is possible but there is no good reason to do it and plenty of pitfals.

Bill
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hear that arrays (of Objects too) can be received over web services..

Still i dont have a clear understanding about it..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!