Xamarin Forms and RestSharp Library

Has anyone used the RestSharp library in an Android app?
I’m trying to do a REST query and I’m getting the below error which Google is no help in identifying:

Yes works great! I’ve had no issues with it

Any idea why I’d be getting that non-CLS error?

Wait you are not authenticating…

I wouldn’t roll your own if you can avoid it. @josecgomez and I have a NuGet published for Epicor Rest that implements RestSharp behind it. Try using that instead. Then you don’t have to build the rest clients yourself. Nothing is documented in the NuGet, but basically you provide it the connection info and then you can use any of our prebuilt methods or the generic GET POST PATCH functions built.

3 Likes

@josecgomez I have no clue what I’m doing. Hacking my way through life. :slight_smile:

@jgiese.wci Do you guys have one for Oreo?

Grab the mobile one. It doesn’t care if it’s Oreo, Marshmallow or whatever is next. REST is generic. Works for IOS too

2 Likes

Seems to have an issue with me using 8.1.

Try the standard instead.

That one worked.

yeah Standard is what you should use for Xamarin

we just updated it too :slight_smile:

We should put together some docs… but I’m lazy. If you can’t figure it out let me know and I’ll get you something,

1 Like

Here’s a quick walk through

EpicorRest.AppPoolHost = "your.tld.server";
EpicorRest.AppPoolInstance = "yourEpicorInstance";
EpicorRest.UserName = "epicor";
EpicorRest.Password = "epicor";
EpicorRest.IgnoreCertErrors = true;

//get
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add($"filter", "ABCCode eq 'A'");
dynamic abcData = EpicorRest.DynamicGet("Erp.BO.EmpBasicSvc", "List", dic);

//GetJSON String
string json = EpicorRest.DynamicGetJSON("Erp.BO.EmpBasicSvc", "List", dic);


image

You got version 1.1.4.1? of the nuget?
If not you’ll need to update to it (we just published it)

Ah–okay. Got it!

It doesn’t like me. :frowning:

Without a lot more troubleshooting… I have no clue why its doing that. We use this all the time without issue.
This nuget should only be in your xamarin project (Standard-library) not inside the Android project.
Android project pulls from the standard library to get what it needs.

1 Like

aaron,

have you taken any of the classes from xamarin university? These are really helpful, I’ve even taken some of their paid classes and they were extremely cost beneficial in getting jump started. Xamarin can be kinda deep when you first jump in.

@rbucek I have taken a few on LinkedIn Learning and Googled a bunch.
I can make a rest call and have it push to the view using a test API, but I’m having issues with certificates when I try and do anything with my Epicor environment.

Remove the nuget from Android project
only work in the xamarin project. Don’t touch the android project (ever… ok sometimes but hardly ever)