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
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
What you want to do sounds like building a RESTful service with WCF. Check out the following article on MSDN, it has all the details:
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.
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:Now you should be able to connect to the URL
and get your data RESTfully.
Marc