Consuming WCF Service

Mike_HachenMike_Hachen Wenger MarcCHMember
edited February 2013 in Android

Hi there

I need to consume a WCF Webservice with android. In the emulator everything works fine, I can access the service and display some lists, edit items and so on. I host the service on my local machine since the emulator ist not able to access remote webservices (as I read somewhere...)

However as soon as I debugg my application on a real device nothing works. No matter which url (http://10.0.2.2/..., http://172.16.10.5/... I use I always get an System.ServiceModel.EndpointNotFoundException.

Here is the full exception:

`System.ServiceModel.EndpointNotFoundException: A system exception has occurred. ---> System.Exception: Error: ConnectFailure (Connection timed out) ---> System.Exception: Connection timed out at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in :0

at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x00000] in :0

--- End of inner exception stack trace ---

at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00000] in :0

at System.ServiceModel.Channels.HttpRequestChannel+c__AnonStorey7.<>m__1 (IAsyncResult r) [0x00000] in :0

--- End of inner exception stack trace ---

at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.WaitEnd () [0x00000] in :0

at System.ServiceModel.Channels.HttpRequestChannel.EndRequest (IAsyncResult result) [0x00000] in :0

at System.ServiceModel.Channels.HttpRequestChannel.Request (System.ServiceModel.Channels.Message message, TimeSpan timeout) [0x00000] in :0

at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Channels.Message msg, TimeSpan timeout) [0x00000] in :0

at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x00000] in :0

at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in :0

at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in :0`

Is there anything I miss? How can I access a wcf webservice from my device?

Target framework is 2.2 (Froyo)

Thank you for any help! Mike

Sign In or Register to comment.