Is there a built in ability to create a REST WCF Web Service?
I have created a WCF web service that is very simple, for testing purposes it ad开发者_JAVA百科ds two numbers together and returns the result.
This all works fine from a console app with a reference to the service hosting on my domain.
I created the service by going to
New Project -> WCF Web Service Application
As I understand, by default this is a SOAP web service, correct??
I am wondering are REST Web Services a built in type of Web Service for WCF, or does it involve work arounds?
I want to be able to call the Web Service by hitting a URL and getting the result back, as I understand this requires the service to be a REST service rather than SOAP.
Yes, by default the basicHttpBinding will be used which is soap based. You will want to look at the webHttpBinding to make your service restful. You can find a short guide at http://msdn.microsoft.com/en-us/library/bb412178.aspx.
精彩评论