2012-09-19 53 views
0

我使用客戶端代碼調用Web服務,該客戶端代碼使用Microsoft的slsvcutil生成。不管我做什麼,我都會收到一個EndpointNotFoundException。堆棧跟蹤如下。該服務正在我的本地機器上運行。我能夠使用相同的生成的客戶端代碼和相同的Web服務成功地從MonoTouch應用程序進行相同的調用。MonoDroid EndpointNotFoundException

我跑 單爲Android 4.2.6 的MonoTouch 5.9.9.4 單2.10.9

任何人看到這個?

System.ServiceModel.EndpointNotFoundException: A system exception has occurred. --->    System.Exception: Error: ConnectFailure (Network is unreachable) ---> System.Exception: Network is unreachable 
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x00000] in <filename unknown>:0 
--- End of inner exception stack trace --- 
at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
at System.ServiceModel.Channels.HttpRequestChannel+<BeginProcessRequest>c__AnonStorey7.<>m__1 (IAsyncResult r) [0x00000] in <filename unknown>:0 
--- End of inner exception stack trace --- 
at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.WaitEnd() [0x00000] in <filename unknown>:0 
at System.ServiceModel.Channels.HttpRequestChannel.EndRequest (IAsyncResult result) [0x00000] in <filename unknown>:0 
at System.ServiceModel.Channels.HttpRequestChannel.Request (System.ServiceModel.Channels.Message message, TimeSpan timeout) [0x00000] in <filename unknown>:0 
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Channels.Message msg, TimeSpan timeout) [0x00000] in <filename unknown>:0 
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x00000] in <filename unknown>:0 
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0 
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0 

回答

0

這似乎是網絡配置的結果。

似乎允許MonoTouch應用程序在Android中沒有工作的區別是我的Android應用程序在設備上運行(通過網絡連接到Web服務),MonoTouch應用程序從模擬器運行的位置與Web服務在同一臺機器上。