When I execute this request WCF returns a 405 error with the following message:
"Method not allowed. Please see the service help page for constructing valid requests to the service"
The service help page displays the following info for the request which doesn't appear to be helpful:
Request N/A The Request body is empty
So what's wrong with my Fiddler request? If I can make a request through the url then it seems like making a request through Fiddler shoudn't be too much more complicated....
Hi bcanonica - I don't think this is a low-level configuration issue. For example, my SaveCustomer method works when I submit a request through Fiddler:
dotnetterAMG...
Member
234 Points
510 Posts
what's wrong with this fiddler request?
Aug 07, 2012 05:54 PM|LINK
I have a WCF REST method to return a Customer by customer ID. For example the following url returns the Customer with ID 123:
http://localhost:35798/RestServiceImpl.svc/Customers/123
However, I'm having problems trying to call this WCF REST service through the following Fiddler request:
GET http://localhost:35798/RestServiceImpl.svc/Customers/
Content-Type: application/json; charset=UTF-8
Accept: application/json, text/javascript, */*; q=0.01
Host: localhost:35798
Content-Length: 12
{"id":"123"}
When I execute this request WCF returns a 405 error with the following message:
"Method not allowed. Please see the service help page for constructing valid requests to the service"
The service help page displays the following info for the request which doesn't appear to be helpful:
Request N/A The Request body is empty
So what's wrong with my Fiddler request? If I can make a request through the url then it seems like making a request through Fiddler shoudn't be too much more complicated....
bcanonica
Contributor
3082 Points
595 Posts
Re: what's wrong with this fiddler request?
Aug 07, 2012 06:02 PM|LINK
Please see the answer to the below thread.
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/31d3f1aa-28b6-4bd7-b031-73b7e7588e6d/
Thanks,
BC
Blog Void Impossible
dotnetterAMG...
Member
234 Points
510 Posts
Re: what's wrong with this fiddler request?
Aug 07, 2012 06:14 PM|LINK
Hi bcanonica - I don't think this is a low-level configuration issue. For example, my SaveCustomer method works when I submit a request through Fiddler:
[OperationContract]
[WebInvoke(Method = "POST",
UriTemplate = "Customers/")
]
Customer SaveCustomer(Customer customer);
However, my GetCustomer method returns a 405 when I submit a request through Fiddler:
[OperationContract]
[WebInvoke(Method = "GET",
UriTemplate = "Customers/{id}")]
Customer GetCustomer(string id);
dotnetterAMG...
Member
234 Points
510 Posts
Re: what's wrong with this fiddler request?
Aug 07, 2012 07:15 PM|LINK
ok - I think the issue here is that the GET protocol ignores the message body so the only way to pass parameters to GET methods is through the url.
kushalrdalal
Contributor
7130 Points
1273 Posts
Re: what's wrong with this fiddler request?
Aug 07, 2012 08:10 PM|LINK
Get means you can not pass anything in body of your request in fiddler.
You can do that in POST and in put.
Get means you have one url, in which you have your id or any other parameter.
My Blog
LinkedIn Profile