2013-08-07 30 views
0

問題是沒有使用basichttpBinding調用wcf函數並顯示錯誤。 在Visual Studio中沒有主機路由錯誤。BasicHttpBinding錯誤 - Xamarin

未處理的異常: System.Net.WebException:錯誤:ConnectFailure(否主機路由)

using System; 
using System.Collections.Generic; 
using System.Linq; 
using MonoTouch.Foundation; 
using MonoTouch.UIKit; 
using HelloWorld_App4.localhost; 

namespace HelloWorld_App4 
{ 
    public class Application 
    { 
     // This is the main entry point of the application. 
     static void Main(string[] args) 
     { 
      // if you want to use a different Application Delegate class from "AppDelegate" 
      // you can specify it here. 

      localhost.Service1 obj = new localhost.Service1(); 

      obj.GetData(32, true); 

      UIApplication.Main(args, null, "AppDelegate"); 
     } 
    } 
} 

回答

0

你有什麼執照? 如果您只有獨立許可證,您將無法訪問web/wcf服務,並且必須依賴休息服務。

我發現,困難的方式,但只是切換使用ASP.Net Web API創建我的服務。購買營業執照簡單且便宜得多。