c# - How to return valid JSON array in WCF -


here webinvoke

[webinvoke(         method = "get",         responseformat = webmessageformat.json,         bodystyle = webmessagebodystyle.bare,         uritemplate = "{invoice}/{transtype}/"          )     ] 

i have return code

dictionary<string, object> dic = new dictionary<string, object>();         dic.add("approvalstatus", response.approvalstatus);         dic.add("authorizationcode", response.authorizationcode);         dic.add("cardbalance", response.cardbalance);         dic.add("errormessage", response.errormessage);         dic.add("invoicenumber", response.invoicenumber);          return dic; 

my problem not return valid json array

sample result

 [{"key":"approvalstatus","value":"captured"},{"key":"authorizationcode","value":"tas926"},{"key":"cardbalance","value":null},{"key":"errormessage","value":""},{"key":"invoicenumber","value":"1"},{"key":"referencenumber","value":"313506502708"},{"key":"uniquecode","value":"2704"}] 

how can make json array?


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -