Hello my console app is my host for my wcf restful service which I finaly managed to get working (so far). My question is will this host service work with “POST”? It works fine for get but not sure if you need the host to do anything more when it comes to post or delete?
class Program
{
static void Main(string[] args)
{
string baseAddress = "http://" + Environment.MachineName + ":8000/Service";
ServiceHost host = new ServiceHost(typeof(RawDataService), new Uri(baseAddress));
host.AddServiceEndpoint(typeof(IReceiveData), new WebHttpBinding(), "").Behaviors.Add(new WebHttpBehavior());
host.Open();
Console.WriteLine("Host opened");
Console.ReadLine();
Your service will work fine with POST. Attributes in your interface will define whether an operation is a POST or GET. See the documentation for WebInvokeAttribute here:
http://msdn.microsoft.com/en-us/library/system.servicemodel.web.webinvokeattribute.aspx