简体   繁体   中英

MonoDroid EndpointNotFoundException

I'm calling a web service using client code that I generated using Microsoft's slsvcutil. No matter what call I make, I'm getting an EndpointNotFoundException. Stack trace is below. The service is running on my local machine. I'm able to successfully make identical calls from a MonoTouch application using the same generated client code and the same web service.

I'm running Mono for Android 4.2.6 Monotouch 5.9.9.4 Mono 2.10.9

Anyone else seeing this?

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

This appears to have been the result of a networking configuration.

The difference that seems to have allowed the MonoTouch application to work where Android did not was that I had the Android application running on a device (connecting to the web service over the network) where the MonoTouch application was running from a simulator on the same machine as the web service.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM