1

I have a very simple WCF service I would like to pass it an array or json?

[OperationContract, WebGet(ResponseFormat = WebMessageFormat.Json)]
    public string GetPreDisplay(string inputData)
    {
        //DoSomething with inputData
        return "Sweet!";
    }

My javascript...

 var data = [paymentControls['claimNum'], paymentControls['claimSeq']];
        $lps.GetPreDisplay(data, onComplete);

Obviously string is the wrong type. Can anyone point me in the right direction?

Thanks, ~ck

Hcabnettek
  • 12,678
  • 38
  • 124
  • 190

1 Answers1

0

With ASP.Net MVC you can return data as an ActionResult, there is a method "Json" which converts the data to the correct format. Have a look at this other question:

wcf json web service

Community
  • 1
  • 1
Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252