WCF and HTTP GET

http, wcf

Solution

yes, you need to use the `webHttpBinding` on your WCF service.

See the WCF REST Starter Kit for more information on REST Support in WCF.

- REST in WCF

- Overview of REST in WCF

- Series of screencasts on how to use REST in WCF

If you're hosting your service in IIS, you need to create a separate *.svc file for the REST service (let's call it `RESTService.svc`), which contains:

<%@ ServiceHost Service="YourServiceName" Language="C#" debug="False"
    Factory="System.ServiceModel.Activation.WebServiceHostFactory" %>

Now you should be able to connect to the URL

http://localhost:8004/MyService/RESTService.svc

and get your data RESTfully.

Marc

Problem

My WCF service exposes this function ``` public SerialNumberInfo GetSerialNumberInfo(string serialNumber) { } ``` Is there a way to enable HTTP GET on my WCF service? Example: ``` http://localhost:8004/MyService/GetSerialNumberInfo?serialNumber=4 ```

Original source