I am getting a strange error when calling GetNewJobMtl and not sure why, it only seems to be happening for this particular job as well. The json has been run through a validator and no errors are returned. The ds parameter is clearly there and correct.
Can you replicate with the BL Tester? (non REST)?
Any errors in the event viewer?
I am able to add material to the job when using the Epicor client.
This is what was in the event viewer for the call.
Epicor.RESTApi.ErrorHandling.ApiException: Parameter ds is not found in the input object
at Epicor.RESTApi.DataSources.IceServiceCaller.GetInputParams(ParameterInfo[] plist, Object inputData) in C:_Releases\ICE\3.1.500.19\Source\Framework\Epicor.RESTApi\DataSources\IceServiceCaller.cs:line 502
at Epicor.RESTApi.DataSources.IceServiceCaller.CallCustomMethod(TypeMapping typeMapping, ContextInfo context, String methodName, Object inputObject) in C:_Releases\ICE\3.1.500.19\Source\Framework\Epicor.RESTApi\DataSources\IceServiceCaller.cs:line 246
at Epicor.RESTApi.Controllers.CustomActionController.CustomMethod(Object input) in C:_Releases\ICE\3.1.500.19\Source\Framework\Epicor.RESTApi\Controllers\CustomActionController.cs:line 25
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()
What about in SWAGGER can you make the call in SWAGGER with the results of a GetByID?
Are you passing swagger the results of a GetByID?
Looking at the line number in your POSTMAN that’s 180K… your JSON is HUGGEEEEEEEEE how big is this job? Not that it should matter but geez
Yea, the job has 750+ materials added to it.
Correct, passing it the same json that I was using with Postman.
oh jesus… you might be running into some limitation here… I haven’t looked but I imagine that there’s quite the overhead to turn that dataset back and forth into JSON / XML and back, plus some of the overheards internally with making the WCF call and translating it back… Yikes!
Try using UpdateExt and pass only a limited DataSet with the new material row…
@Olga, @Bart_Elia, @bconner any insight on this? Could he be hitting some processing limit?
As soon as I cleared the JobMtl array and passed the json back again it worked. Seems as though there is a limitation.
yes, looks like some data size limit is exceeded. We need to look at it.
I don’t see similar JSON error, when I send huge data. I only see request limits errors in that case.
Did you set any request limit settings in the web.config?
I had to add 2 items there. First, in system.web section:
<system.web> <httpRuntime maxRequestLength="2147483647" /> </system.web
Second, in system.webServer section:
<system.webServer>
....
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
</system.webServer>
Hi Olga,
I do not have these settings in my web.config, I will add them.
Thanks!
Now I actually think it is not your issue - you have different error. I think you may have unescaped double quote in your JobMtl array and JSON become invalid. For example,
"Description": "My " Description",
It should be replaced with
“Description”: “My " Description”,
It’s difficult to tell because there are over 750 materials in this job. I did run the json through a validator that returned zero errors.
When using the JsonConvert.SerializeObject method it will automatically escape double quotes. I checked a couple materials in the json and the double quotes were automatically escaped.
I see… Then probably something else makes json invalid. Did setting in web.config change anything?
I have not got a chance yet to test yet, this was happening in our production environment. I’ll need to set up a test.