0

Here is my webInvoke

[WebInvoke(
        Method = "GET",
        ResponseFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = "{invoice}/{transtype}/"

        )
    ]

I have this 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 is it does not return a 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 I make this a JSON array?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
SHINHAN
  • 685
  • 2
  • 12
  • 28

0 Answers0