-1

I want to send json object from C# client (using WebRequest or any other method .Net 3.5 support) to WCF service and read that object from there. Can anybody help?

Nishantha
  • 6,065
  • 6
  • 33
  • 51

1 Answers1

0

You can use Newtonsoft.Json package from NuGet to help you accomplish this. To deserialize your json back to the object in WCF you can do:

  List<T> data = JsonConvert.DeserializeObject<T>(jsonString);
  //assuming you have a list of objects.

To convert the object to Json string you will have to do:

JsonConvert.SerializeObject(obj)

Refer to this for posting data to wcf from c#

How to post to wcf

Community
  • 1
  • 1
Kayani
  • 942
  • 7
  • 23
  • Actually I'm using Json.net. I just want to know how to send data client to server through `WebRequest` and `StreamWriter`. Not how serialize or deserialize. Anyway thanks. – Nishantha Oct 05 '15 at 07:16