Can anybody advise, how to force Epicor Web Client to use api v2 instead of v1? I tried to update \Server\Apps\ERP\Home\sysconfig.json file, changing “ep.erp.session”: { “restPath”: “api/v2” }, but it seems not to work.
If you are talking about the application itself, you can’t.
So, how can I trace calls and payload done by Epicor using DevTools in Edge/ Chrome if it uses v1 of api while it is suggested to do REST-API calls using v2? Seems to be no way
I’ve yet to find any significant difference, except for v2 requiring an API Key for [External] calls.
Ok. Thank you!
The thing is when I do calls in v2, I get error in EventLog related to CSF. When working with Web client (which use v1), there is no any issue.
Ignorance time → I don’t know what that is.
What kind of errors?
Country Specific Functionality
Error details:
Category: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
EventId: 1
SpanId: d789220ff572104c
TraceId: c7fecdae8094dd1a0a1f5dde685deea7
ParentId: 0000000000000000
RequestId: 80000fcb-0002-fa00-b63f-84710c7967bb
RequestPath: /Kinetic/api/v2/odata/EPIC06/Erp.BO.PaymentEntrySvc/Update
An unhandled exception has occurred while executing the request.
Exception:
System.ArgumentNullException: Value cannot be null. (Parameter 'source')
at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)
at Ice.Extensions.ExtensionTableHelper.FindPeerExtensionRow(IceRow baseRow, ExtensionTable xTable) in C:\_releases\ICE\ICE4.2.200.37\Source\Shared\Framework\Epicor.ServiceModel\Extensions\ExtensionTableHelper.cs:line 435
at Extensibility.CSF.Poland.PaymentEntryExtenderExtension.BeforeUpdate(PaymentEntryTableset ds)
at ConcreteClass43.BeforeMethod(String , IDictionary`2 )
at Erp.Services.BO.PaymentEntrySvcFacade.Update(PaymentEntryTableset& ds) in C:\_releases\ERP\ERP11.2.200.37\Source\Server\Services\BO\PaymentEntry\PaymentEntrySvcFacade.cs:line 3845 at Ice.Hosting.RestApi.OperationInvokeHelper.CallInvoker(Type svcType, MethodInfo mi, Object[] inputs, Boolean isRoot, IceDataContext dataContext) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Framework\Epicor.Ice\Hosting\RestApi\OperationInvokeHelper.cs:line 409
at Ice.Hosting.RestApi.OperationInvokeHelper.MakeServiceCall(IceDataContext dataContext, Type svcType, MethodInfo mi, Object[] parameters) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Framework\Epicor.Ice\Hosting\RestApi\OperationInvokeHelper.cs:line 357
at Ice.Hosting.RestApi.OperationInvokeHelper.CallCustomMethod(String serviceName, MethodInfo mi, Object[] paramList) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Framework\Epicor.Ice\Hosting\RestApi\OperationInvokeHelper.cs:line 307
at Epicor.RESTApi.DataSources.CustomMethodCaller.CallMethodWithDynamicData(String serviceId, String methodName, IInputParamResolver inputResolver, Action`1 headersPublisher, Action`1 verifyMethod) in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Framework\Epicor.RESTApi.Common\DataSources\Main\CustomMethodCaller.cs:line 74
at Ice.Hosting.AspNetCore.Controllers.ServiceMethodCallController.InvokePostMethod(Object input) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Controllers\ServiceMethodCallController.cs:line 57
at lambda_method10078(Closure , Object , Object[] )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Ice.Hosting.AspNetCore.Middleware.DynamicAssemblyPartMiddleware.Invoke(HttpContext context, CurrentCallInformationService currentCallInformation, ControllerLoader controllerLoader) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\DynamicAssemblyPartMiddleware.cs:line 33
at Ice.Hosting.AspNetCore.Middleware.IPEnforcerMiddleware.Invoke(HttpContext httpContext) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\IPEnforcerMiddleware.cs:line 44
at Ice.Hosting.AspNetCore.Middleware.AuthorizationMiddleware.ProcessAuthenticatedUser(HttpContext context, IPrincipal user) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\AuthorizationMiddleware.cs:line 53
at Ice.Hosting.AspNetCore.Middleware.AuthorizationMiddleware.Invoke(HttpContext context, CurrentCallInformationService currentCallInformation) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\AuthorizationMiddleware.cs:line 44
at Ice.Hosting.AspNetCore.ETags.ETagMiddleware.Invoke(HttpContext httpContext) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\ETags\ETagMiddleware.cs:line 110
at Ice.Hosting.AspNetCore.ETags.ETagMiddleware.Invoke(HttpContext httpContext) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\ETags\ETagMiddleware.cs:line 110
at Ice.Hosting.AspNetCore.Middleware.DecompressRequestMiddleware.Invoke(HttpContext context) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\DecompressRequestMiddleware.cs:line 42
at Epicor.RESTApi.Middleware.ApiKeyEnforcerMiddleware.Invoke(HttpContext context) in C:\_releases\ICE\ICE4.2.200.37\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\ApiKeyEnforcerMiddleware.cs:line 79
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
What does your ds look like?
The error is in peer columns processings.
AFAIR there was a special processing in the home page to work with them.
where do you make this REST v2 call from?
I don’t think it’s data in ds is reason of the problem because on installation without CSF it works fine.
I’m calling REST from .NET desktop application.
well, without data it is hard to tell what exactly is wrong with your call, probably you just don’t send expected column values from extention peer table.
Also in HP there is a special header for handling extension stuff:
x-epi-extension-serialization: full-metadata
But I am not sure it is relevant here
I tried with Extra Data and it was not working (maybe it was not corrrectly filled - I need to check it again). Now I try without extra data and also without success. When I check Epicor calls in DevTools, there is no Extra Data. But Epicor Web Client use api v1 while I use api v2. That’s why I was asking, if its possible to force Epicor Web Client to use api v2. That way I would be able to compare Epicor’s ds and my ds.
Answer to your question is no. Answer to your problem is the same is I wrote before. So try to fill data, and/or header
Ok. I’ll try to figure out how to fill it. By the way - what do you mean by HP?
[H]ome [P]age in the browser
Ok.
Just one more question: do you know from which version Web Client uses api v2? If at all?
Thank you!
Such version does not exist yet
Just a clarification, which CSF, and have you confirmed your CSF install to make sure it all the steps were completed correctly during the… install
You can also force apiv1 in the hosts file so confirm you it has not been changed, more for sanity checking, so we know how things are set up to help.
Can you also please include your version in your profile…
CSF_Poland_147 and it seems to work: there are tables in database (with Csfpl owner), there are additional entries in menu and additional sections on some screens.
Not sure which host file you mean? “hosts.config” in “\Server” (on Epicor Demo where I’m testing it its "C:\inetpub\wwwroot\Kinetic\Server"). I can’t find anything about api version in this file. I found it in “\Server\Apps\ERP\Home\sysconfig.json” and tried to change from v1 to v2 but nothing has changed.
The point to change version used by Wpicor Web Client was I wanted to see “ds” retuned and send by Web Client in version 2 because this is version I used to call REST API from my application. But according to previous comments, it’s not possible. So I tried to call v1 in my application. And result is the same as when using version 2: there is a table in ExtensionTables (see below). But when I do the same via Web Client, there is nothing in ExtensionTables.
So the question is: is there any (and where) parameter in Web Client that exclude ExtensionTables from response/ request? Maybe if I can also switch it off, it will solve my issue?
On the other side: CSF creates few additional tables, but there is no table with name specified in ExtenstionTables (CheckHedPL). So maybe it’s just a bug?
Here is ExternalTable section I get in Response:
"ExtensionTables": [
{
"Table": [ { "ColumnValues": [ "EPIC06", 320, null, null, null, null ] } ],
"SystemCode": "Csfpl",
"TableName": "CheckHedPL",
"Columns": [
{
"ColumnName": "Company",
"ColumnType": "System.String"
},
{
"ColumnName": "HeadNum",
"ColumnType": "System.Int32"
},
{
"ColumnName": "VendorBankPLWLRequired",
"ColumnType": "System.Boolean"
},
{
"ColumnName": "VendorBankPLWhitelisted",
"ColumnType": "System.Boolean"
},
{
"ColumnName": "VendorBankPLWhiteListDate",
"ColumnType": "System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]"
},
{
"ColumnName": "RowMod",
"ColumnType": "System.String"
}
],
"PrimaryKeyColumns": [ "Company", "HeadNum" ],
"PeerTableSystemCode": "erp",
"PeerTableName": "CheckHed"
}
]
}
I’m working with different clients on at least three different version so it’s hard to decide what should I put in my profile? These case is about 2022.2.37 (11.2.200.37) version.