tags:

views:

134

answers:

1

I'm fairly new to WCF but am technically competent.

I am having trouble getting WCF to play nicely. I currently have a WSHttpBinding set up to a service and it is working when using the WCFTestClient supplied with VS2008. What I would like to do is have the service accessible within the browser.

I currently return a JSON response from my service but am unable, as of yet, to access the data via. a URL. I have seen lots of internet tutorials where they seem to be accessing data a bit like this (note the bolded section):

http://localhost/Service.svc/MethodName?param1=value1&param2=value2

If I try and do that I get a 404 - I am guessing it is looking for a literal file but don't know how to fix it.

Any help you can give would be great, thanks!

+3  A: 

You can't do that with WSHttpBinding... you need to expose an endpoint using the WebHttpBinding and have your contract correctly specify the right uri template in the [WebGet] attribute. Here are some pointers to get you started:

tomasr
Exactly - the "normal" WCF protocols are all SOAP based, i.e. you cannot just point to them with a browser; you need a SOAP-capable client (like the WcfTestClient or SoapUI)
marc_s
Thanks for your help, worked beautifully.
Nat Ryall