0

Is it possible to consume Task based async WCF web service methods from Android? Any sample code will be appreciated. I could not find any Android sample when I googled.

Edit:

I would specifically like Android to consume a WCF service like below.

[ServiceContract]
public interface IMessage
{
    [OperationContract]
    Task<string> GetMessages(string msg);
}
Dan Homola
  • 3,819
  • 1
  • 28
  • 43
svrcoder
  • 96
  • 1
  • 9
  • How the web service is implemented doesn't matter. Just look up how to call a web service, or WCF service. – Tim S. Jul 30 '13 at 15:15
  • @TimS. I do not think this is a duplicate of that post. See my edit. AFAIK Task<> is something specific to C#. So I am exploring to see if someone was able to consume this in Android. – svrcoder Jul 30 '13 at 15:38
  • 1
    @svrcoder, as far as the client is concerned, calling an operation defined as `Task GetMessage(string msg)` is **exactly** the same as calling an operation defined as `string GetMessage(string msg)`. The networking request required to call both operations are the same (and the response should be the same as well). – carlosfigueira Jul 30 '13 at 17:43
  • To second what @carlosfigueira said, I have just verified that the WSDLs/XSDs generated by those two signatures (`Task` and `string`) are the same - thus, it looks exactly the same to the client. – Tim S. Jul 30 '13 at 17:44

0 Answers0