We are having trouble figuring out how to call asmx web services from cross-platform Xamarin code. There seem to be four options. The first two seem flawed, and information is scarce on the other two.
Can anyone offer some advice? Surely there must be at least one supported way to call web services from cross platform Xamarin apps.
Here are the options we're aware of so far:
- We tried using WCF to make the calls, from a Portable Class Library (PCL). We got some incorrect behaviour, which we put down to the fact that WCF on Xamarin is "preview" only. (The generated XML was different from that produced by the same code running under other WCF implementations, and was not accepted by the target server.) Furthermore, WCF is not supported in PCL profiles that target Windows Phone 8.1. (!)
- We looked up whether we could drop the use of WCF, and use "old school" ASMX-type proxies from a PCL. There seems to be an enormous amount of conflicting information on whether this is even possible. For instance here, a Xamarin employee writes that it's not supported to use ASMX-style web references in PCL, and that you have to use WCF. But we've already established that using WCF could be a bad idea (see #1).
- Should we just roll our own calling code, based just on HttpClient?
- OR should we drop all use of PCLs, and use Shared Libraries instead?
Many thanks for any help or experiences you can share.