Transferring a Dictionary in a WCF Service

Possible duplicate:
How to serialize the dictionary <string, string> through WCF?

How to pass a dictionary in a method in WCf ... I do it

public void SendData(Dictionary<string, string > data)
{
    foreach (KeyValuePair<string, string> item in data)
    {
        Console.WriteLine("{0} : {1}", item.Key, item.Value);
    }
}

When do I refer to it as 192.XXX//Akhil/service.svc/SendData? data = {}
here What / How to pass arguments to data ... for example, please.

+5
source share
1 answer

Create your proxy server (say, "TestProxy"), then do:

TestProxy.YourServiceClient client = new TestProxy.YourServiceClient();

Dictionary<string, string> testDict = new Dictionary<string, string>();

testDict.Add("test", "test1");

client.SendData(testDict);

WCF . , WCF, REST HTTP Get. , , REST. , google.Net WCF REST.

* : SOA Request/Response, .

Update:

, , , , WCF JSON.

JSON/REST

LINK, gotchas WCF JSON.

. Iphone, , .

+5

All Articles