I have created a RESTful WCF service with a method that will be used to save data using a POST. I want to test this method from an HTML form. The following HTML form and interface definition (and related .cs code) result in the SaveTest
function getting called when I hit the form Submit
button, however the one argument id
is always set to null.
HTML form:
<form action="http://localhost:1378/MyService.svc/SaveTest" method="post">
<input type="text" id="id"/>
<input type="submit" value="Submit" />
</form>
Interface definition:
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "SaveTest")]
Stream SaveTest(string id);
What am I missing here?
Edit
Our WCF service has some other methods that use GET that are working without any issues
i.e. [WebGet(UriTemplate = "GetByTransactionID/{transactionID}")]