System.Net.WebException: Error: NameResolutionFailure when Calling WCF Services in Mono Android Appl

SreeniSreeni INMember

I am working on Mono Android Mobile applicaiton. I am calling my WCF Services
in my applicaiton, I added wcf services using ->Add WebRefernce option of
Project Menu. My Problem is I am getting exception when i am running the
calling the wcf services on the device.

Exception:

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

at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in :0 at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String
method_name, System.Object[] parameters) [0x00000] in :0 }

My device has internet connection using WiFi connection to get and post data

and another way

I tried calling the services using Mobile
Data(Cellular Data) i.e with the Mobile NetWork Provider's internet
connection.. This time i am getting a different exception..

{System.Net.WebException: The request failed with HTTP status 404: NotFound at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReceiveResponse
(System.Net.WebResponse response,
System.Web.Services.Protocols.SoapClientMessage message,
System.Web.Services.Protocols.SoapExtension[] extensions) [0x00000] in :0 at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String
method_name, System.Object[] parameters) [0x00000] in :0 at
AndroidWCFExample.WirelessService.SAGServer.ProcessSomeUpdate
(AndroidWCFExample.WirelessService.WebServicesClient oClientInfo, System.String
ParameterInfo) [0x00001] in C:\Some Dotnet
Examples\AndroidWCFExample\AndroidWCFExample\Web
References\WirelessService\Reference.cs:1232 at (wrapper
remoting-invoke-with-check)
AndroidWCFExample.WirelessService.SAGServer:ProcessSomeUpdate
(AndroidWCFExample.WirelessService.WebServicesClient,string) at
AndroidWCFExample.EmployeeInfoActivity.button_Click (System.Object sender,
System.EventArgs e) [0x0007a] in C:\Some Dotnet
Examples\AndroidWCFExample\AndroidWCFExample\EmployeeInfoActivity.cs:79 }

Note:

This is working Correctly. when i run application on android emulator. I am getting correct result.

It's Debug build. I have net work permission also. I have "" in ManiFest.xml file. Even i
tried changing the build from "Debug" to "Release" mode and executed the
application. It's giving the same Error on the device , but it's giving result
in emulator. No Exception is thrown on emulator.

I am searching for solution to fix this, but not getting correct answer. So
Please let me know what i need to do, to get it fixed. Please help me out.

Sign In or Register to comment.