I have a webservice that looks something like this:
[WebInvoke(UriTemplate = "/{userName}/?key={key}&machineName={machineName}", Method = "PUT")]
public HttpResponseMessage<SomeStuffPutResponse> PutSomeStuff(string userName, string key, string machineName, string theTextToPut)
{
// do stuff
}
My global.asx looks like:
RouteTable.Routes.MapServiceRoute<SomeStuffService>("1.0/SomeStuff", new HttpHostConfiguration());
When I hit the webservice via C# HttpClient or fiddler it is throwing a 500 and not even getting to my method. I added a bunch of logging and am getting the following error:
The service operation 'PutSomeStuff' expected a value assignable to type 'String' for input parameter 'requestMessage' but received a value of type 'HttpRequestMessage`1'.
UPDATE: If I make theTextToPut variable a custom object it works fine. It is just giving me issues if it is a primitive type like a string.