Domanda

I have this webservice

 [OperationContract]
            [WebInvoke(Method = "POST", UriTemplate = "UploadReceipt?CompanyCode={CompanyCode}&FileName={FileName}&FileContent={FileContent}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
            RestResponseInfo<bool> UploadReceipt(string CompanyCode, string FileName, string FileContent);

And i am calling it like this enter image description here

Then after it will call this method

public RestResponseInfo<bool> UploadReceipt(string CompanyCode, string FileName, string FileContent)
        {

}

But when i see this parameters by inspecting debugger its returning null value i am very much stuck into this from 5 hours ........

I also used advance rest service from chrome but still have this issues

È stato utile?

Soluzione

After checking i mark that I am passing

<form runat="server" method="post" action="http://localhost:37542/AccountService.svc/UploadReceipt">

Which should be

 <form runat="server" method="post" action="http://localhost:37542/AccountService.svc/UploadReceipt?CompanyCode=1&FileName=Test&FileContent=/9j/4AAQ">

Any ways thanks for your support :)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top