c# - wcf rest send dictionary as parameter -


i have rest service

    [operationcontract]     [webinvoke(method = "post",      requestformat = webmessageformat.json,      responseformat = webmessageformat.json,      uritemplate = "dispatche")]      string dispatche(dictionary<string, dispatchparameter> dispatchparameters); 

and dispatchparameter code

public class dispatchparameter {      public string servicename { get; set; }      public string serviceurl { get; set; }      public string parameter { get; set; } } 

in client when call service service parameter(dispatchparameters) dose not value

httpclient client = new httpclient(); var param = new dictionary<string, dispatchparameter>(); param.add("persons",new dispatchparameter(){servicename = "personservice",serviceurl = "personservice url"}); var result = client.postasjsonasync("http://localhost:1822/dispatcherservice.svc/dispatche", dispatchparameters).result; 

is there mistake in code?


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -