I have a WCF service that has a Task<bool> return type in the service Interface. It would be great if when adding a service reference if you could support the newer .NET 4.5 System.Threading.Task based methods so we can use the async await pattern. Presently XS doesn't know how to handle these service references with task based methods. As you're adding async await (.NET 4.5) support in the upcoming release which I'm in the beta channel testing, having this available would be great.
Are there any news or plans about this topic? This feature is even useful if you want to create a proxy reference for soap services that should use async/ await instead of events.
The lack of support for Task-based service references manifests itself in InvalidOperationExceptions when sharing generated code with .Net Framework, even though the Xamarin code doesn't call the async method. See e.g. https://bugzilla.xamarin.com/show_bug.cgi?id=46917
When creating a channel, the contract description is generated, and the operation description for the async method throws an InvalidOperationException: Operation 'FooAsync' contains a message with parameters. Strongly-typed or untyped message can be paired only with strongly-typed, untyped or void message.
The source of the exception is https://github.com/mono/mono/blob/0bcbe39b148bb498742fc68416f8293ccd350fb6/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OperationFormatter.cs#L515
It seems likely that the root cause is that MessageDescription.IsTypedMessage is returning false for the return type System.Threading.Tasks.Task<MyTypedMessage>.
Seems to be a very common issue. See: https://duckduckgo.com/?q=InvalidOperationException%3A+Operation+contains+a+message+with+parameters.+Strongly-typed+or+untyped+message+can+be+paired+only+with+strongly-typed%2C+untyped+or+void+message.&t=hf&ia=qa
OH, BTW, the issue is not limited to Mac OS. Android has the same problem, and probably iOS too.