2012-04-05 38 views
0

你好,我的控制檯應用程序是我的wcf restful服務的主機,我最終設法工作(到目前爲止)。我的問題是這個主機服務是否可以使用「POST」?它適用於獲取但不確定是否需要主機在發佈或刪除時做更多事情?郵寄主機服務配置?

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(); 

回答