Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

trying to write a basic rest wcf service

$
0
0

Hello - I'm trying to write a basic rest wcf service. The following url made the task sound simple enough: http://msdn.microsoft.com/en-us/magazine/dd315413.aspx#id0070034

The wcf service is working as a standard wcf service. I'm able to create a client proxy and call the svc GetCustomer method to return a Customer object. Based on the info url I referenced in my post above it appears that all I need to do to make my RestTest.GetCustomer(int id) REST-ful is to add the following attribute at the top: [WebGet(UriTemplate = "/{id}")]

Then I added the following endpoint to the Web.config of the service project to enable REST (weHttpBinding):

<service name="RestTest">
<endpoint address="RestTest.svc" binding="webHttpBinding" contract="IRestTest" />
</service>

After I do that then shouldn't I just be able to call the wcf svc through a url like this?: http://localhost:81/RestTest.svc/1

When I try to call the svc like this I get a 404 error. What am I missing here?


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>