Forum General

Consuming WCF Services in MonoAndroid Mobile Application

SreeniSreeni INMember

question :

How to specify Endpoint and how to get ServicClient in MonoAndroid Mobile Application?

I am working on Mono Android Mobile Applicaiton, I have problem while consuming WCF Services in my mobile application.
How can i get ServiceClient in the application in order give the Binding type and Endpoint

In normal .Net Client(dotnet web application) when we add Service to the client we will get ServiceClient automatically

In DotNet Client We will get

_WebService.GPFServerService.GPFServerClient oCls
BasicHttpBinding bGPFBinding = new BasicHttpBinding("BasicHttpBinding");
string sEPAddress = System.Configuration.ConfigurationManager.AppSettings.Get("GPFServerService_EndPoint");
EndpointAddress ep = new EndpointAddress(sEPAddress);

oCls = new WebService.GPFServerService.GPFServerClient(bGPFBinding, ep);
textbox1.text = oCls.GetAllCountries();

Where as in Mono Android I am getting

WebService.GPFServerService oCls = new WebService.GPFServerService();
textbox1.text = oCls.GetAllCountries();

and there is no ServiceClient to give the Binding and Endpoint. But i am getting all the Operation Contracts.

We don't have config files in MonoAndroid Application i hope.....

I find this url and follwed SubHeading 4.Consuming WCF Services..

I got GPFService.cs and ServiceReferences.ClientConfig files by which i got ServiceClient ,But by this i am able to call the operationcontracts in Async mode only.

GPFServiceClient ogpfClient = new GPFServiceClient();
ogpfClient.GetAllCountriesCompleted += new EventHandler(ogpfclient_GetAllCountriesCompleted);

As per requirement I need to call services Synchronously. So is there any way how to get the ServiceClient and how could i specify the endpointaddress and binding in order to call the services synchronously.

Please help me out, It's urgent requirement.

Thanks in Advance



  • SreeniSreeni INMember

    Is this problem with WCF Services or Android. Waiting for response.Help is appreciated.

Sign In or Register to comment.