I have a REST WCF service. When a POST attempt is made to this service to an operation as mentioned below, I get the below error:
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "", RequestFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)]
void Write();
Error: HTTP 307 There is no operation listening for https://xx.xxx.xx.xxx/EnrollmentServer/Discovery.svc, but there is an operation listening for https://xx.xxx.xx.xxx/EnrollmentServer/Discovery.svc/, so you are being redirected there.
Any pointers will be appreciated.
Change your UriTemplate to "/" instead. RESTful WCF has a "thing" about wanting Uris ending with / instead of no ending.
Also, use the Uri with the ending slash to avoid WCF responding with the 307.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With