Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Using System.Servicemodel.Web in Xamarin.Forms app

$
0
0

Im working on a solution where i connect to a REST JSON api. If/when the Rest call fails i want to be able to display the error message to the user.

When i catch an Exception in my C# Web Service i throw the following to my clients:
catch (Exception e)
{
throw new WebFaultException(string.Format(e.Message), HttpStatusCode.BadRequest);
}

On my clients it is required to to catch as WebFaultException, but i cannot access System.ServiceModel.Web in my PCL code.. :(

Am i supposed to use a Dependency Service to access this, since i can add System.ServiceModel.Web in both my Platform Specific Projects using "Add Reference"?
Anyone has a good guide or walkthrough i can take a look at?

Any help appreciated.

Cheers!


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>