I want to pass a user defined data type(a complex data type- an object say) to asmx web service from my android app. I have tried of sending primitive data
types and works fine. When I am trying to send the object it self as it is then I got the following error. (See link below)
and here is the code I am using to call the web service http://pastie.org/5936733
and this is my class Implementation http://pastie.org/5936414 and
another class implementation is here http://pastie.org/5936586.
Note: Every thing works fine when I send the data with primitive data types but when I send the data with my class object it is throwing an exception.
Please any onc could try to tell me what may be the problem. I was on this problem for last 4 days but could not resolve it still.
Thanks
Ganesh
You need a way to serialize/write your data so that it can be parsed and converted back to objects on the receiving side (asmx web service).
Popular approaches are to use JSON/XML for text based solutions i.e. human readable. There are also solutions for serializing the data to binary. I only have experience with Google protocol buffers, which worked quite well for me.
For the JSON approach you basically have a read and write method in each class you wish to transfer. These methods are used to convert your object to and from your desired format (JSON/XML).
Hope that helps.