[MonoTouch] Consuming WCF

Alessandro80 alessandro at iws-italia.it
Thu Mar 8 09:26:50 UTC 2012


Hello,
I followed this: http://wiki.ios.xamarin.com/HowTo/WebServices/Using_WCF

My WCF service have a method GetData that returns a string.
I wrote this function to consuming WCF e return string value:

public string GetTestWS(string input, string url)
        {
            string str = "";

            //Specify the binding to be used for the client.
            BasicHttpBinding binding = new BasicHttpBinding();
            
            //Specify the address to be used for the client.
            EndpointAddress address = new EndpointAddress(url);
            
            ServiceClient wcfClient = new ServiceClient(binding, address);
            
            wcfClient.GetDataCompleted += delegate(object sender,
GetDataCompletedEventArgs e)
                {
                    strValue = String.Format("This is service response:
{0}",e.Result);
                };
                
            // Invoke the service   
            wcfClient.GetDataAsync(input);

            return strValue;
        }


but it returns empty string.

If I debug my code MonoTouch show me "unknow sender" message on
"wcfClient.GetDataCompleted += delegate(object sender,
GetDataCompletedEventArgs e)" row.

Thanks,
Alessandro

--
View this message in context: http://monotouch.2284126.n4.nabble.com/Consuming-WCF-tp4455961p4455961.html
Sent from the MonoTouch mailing list archive at Nabble.com.


More information about the MonoTouch mailing list