I've created the following RESTful WCF service, which works just fine when running it in VS.
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json,
UriTemplate = "/sales/start={start}&end={end}")]
List<Sales> GetSalesByDate(string start, string end);
However, when deploying this to my test server (running Win2K3 and IIS6) I received the following server error:
Operation 'GetSalesByDate' in contract 'ISalesService' uses GET, but also has body parameter 'start'. GET operations cannot have a body. Either make the parameter 'start' a UriTemplate parameter, or switch from WebGetAttribute to WebInvokeAttribute.
Obviously I have already made 'start' a UriParameter. So can anyone tell me why an exception is being thrown?
EDIT: For reference, here is my configuration file:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<services>
<service name="Services.SalesService">
<endpoint behaviorConfiguration="webBehavior"
binding="webHttpBinding"
contract="Services.ISalesService"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="webBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>