Click here to Skip to main content
15,908,437 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
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.....

Note:- I find this url and follwed SubHeading 4.Consuming WCF Services.. http://docs.xamarin.com/guides/cross-platform/application_fundamentals/introduction_to_web_services

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

GPFServiceClient ogpfClient = new GPFServiceClient(); ogpfClient.GetAllCountriesAsync(); 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.

Is this problem with Mono for Android or WCF Services?

Please help me out, It's urgent requirement.

Thanks in Advance

Sreeni
Posted
Updated 21-Aug-13 3:33am
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900