Skip to content

Commit

Permalink
Update version of the RESTAPIClient Dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaumov committed Jan 25, 2022
1 parent b6ebde4 commit c0c824c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<PackageReference Include="Acumatica.Default_20.200.001" Version="2.0.0" />
<PackageReference Include="Acumatica.RESTClient" Version="2.0.0" />
<PackageReference Include="Acumatica.RESTClient" Version="2.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 8 additions & 2 deletions Acumatica REST API Console Application/RESTExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ public static void ExampleMethod(string siteURL, string username, string passwor
finally
{
//we use logout in finally block because we need to always logut, even if the request failed for some reason
authApi.AuthLogout();
Console.WriteLine("Logged Out...");
if (authApi.TryLogout())
{
Console.WriteLine("Logged out successfully.");
}
else
{
Console.WriteLine("An error occured during loguot.");
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions SOAPLikeWrapperForREST/SOAPLikeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public void SetBusinessDate(DateTime now)

public void Login(string username, string password, string tenant = null, string branch = null, string locale = null)
{
AuthorizationApi.AuthLogin(new Credentials(username, password, tenant, branch, locale));
AuthorizationApi.LogIn(new Credentials(username, password, tenant, branch, locale));

CurrentConfiguration.ApiClient.RestClient.CookieContainer.Add(
AuthorizationApi.Configuration.ApiClient.RestClient.CookieContainer.GetCookies(new Uri(AuthorizationApi.Configuration.BasePath)));
}
public void Logout()
{
AuthorizationApi.AuthLogout();
AuthorizationApi.TryLogout();
BusinessDate = null;
}

Expand Down
2 changes: 1 addition & 1 deletion SOAPLikeWrapperForREST/SOAPLikeWrapperForREST.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Acumatica.RESTClient" Version="2.0.0" />
<PackageReference Include="Acumatica.RESTClient" Version="2.1.1" />
</ItemGroup>

</Project>

0 comments on commit c0c824c

Please sign in to comment.