Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi
I've build two separate projects using Chilkat.com functions(client and server), in which the client sends information to the server (but it only sends it as a "STRING"). My question is:

is it possible to send a structure from the client to the server, which contains data of different types?
And if my projects only send strings, how can it be done ?

Best Regards.
Rania
Posted
Comments
Vedat Ozan Oner 23-Feb-14 5:55am    
you can use JSON. see http://www.json.org/
Sergey Alexandrovich Kryukov 23-Feb-14 12:41pm    
Why as a string? Yes, of course, it can be done. You need to have serialization and deserialization of data, not necessarily to/from string. There are many ways to do it. Did you try anything?
—SA

Quote:
is it possible to send a structure from the client to the server, which contains data of different types?
Of course it is possible. It happens all the time :-).


Quote:
And if my projects only send strings, how can it be done ?
You have full control on both the client and the server applications, hence you could even establish your own protocol for sending/receiving data. However I would follow the good advices other people gave and have a look at serialization topic (see, for instance: "Introducing XML Serialization" at MSDN[^]).
 
Share this answer
 
You should sent the data in a serialized data format. Json or XML is a good idea, but often gives your framework some easy-solution.

Be careful in implementing error handling if data is missing or invalid.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900