-1

Could someone give me recommendations on which would be the easiest way to send objects through webservices (back and forth through the client-side and server-side) on C# without the client-side knowing the definition of the objects to send.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Marcox
  • 102
  • 10
  • maybe you need to send the object as stream (byte[]), it is nice to send the meta data (class definition) with it, but if you are going to just send the values, use a specific format and send them as stream –  Jun 25 '13 at 16:34
  • the client side will send something without knowing what to send? So send anything? what's the use case? most of the features in webservices are for object typing and parameter discovery! – Vivek Jun 25 '13 at 17:08
  • You should clarify why the client doesn't know the definition of the objects to send and how it makes sense to call a web service in that case. – bmm6o Jun 26 '13 at 01:02

1 Answers1

0

You mentioned you want to send "objects". This implies there is some structure to your data.

Options:

  1. user2511414 is right, you can just stream bytes.
  2. You can use JSON. All calls can read/write strings and not objects if you are trying to avoid getting locked in to objects.
  3. You can invent your own serialization format and just send data back and forth as strings.
ryan1234
  • 7,237
  • 6
  • 25
  • 36
  • The reason the client can't have the definition of objects is that my teacher stated so (it's a school project); the client just has the views and he wants to stick it that way... i think I'll use serialization, thanks everyone. – Marcox Jun 26 '13 at 05:09