Developer forum

Forum » Dynamicweb 10 » DynamicwebConnectorService request timeout

DynamicwebConnectorService request timeout

Peter Krusell
Reply

Hi,

We are setting up the standard DynamicwebConnectorService / CodeUnit based integration to interact with a BC on prem environment. The ShopData and StockLevel data requests work fine. But the CustomerData request result in a timeout already after 20 seconds.

The request setting "Timeout in minutes" is set to max value 360 on all requests and they are identical exept for the request body of course. Still the ShopData request can run for 1.6 min as you see in the screenshot and the gives an OK response with fine data. But the Customerdata request, even though its slimmed down with false on optional data, just runs for  <GetEcomData><tables><Customers type="all" importSalesPeople="false" importContacts="false"/></tables></GetEcomData> 20 sec and then gives timeout.

Full error message:
An unhandled error occurred: The request channel timed out while waiting for a reply after 05:59:39.8915911. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

System.TimeoutException: The request channel timed out while waiting for a reply after 05:59:39.8915911. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.
   at System.ServiceModel.Channels.RequestChannel.RequestAsync(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.RequestAsyncInternal(Message message, TimeSpan timeout)
   at System.Runtime.TaskHelpers.WaitForCompletionNoSpin[TResult](Task`1 task)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(MethodCall methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(MethodInfo targetMethod, Object[] args)
   at generatedProxy_1.DataRequest(String)
   at DynamicwebServiceReference.DynamicwebServiceClient.DataRequest(String request)
   at Dynamicweb.DataIntegration.Integration.ERPIntegration.ErpServiceCaller.SendRequestInternal(DynamicwebServiceClient client, String secret, String requestText, ILogger logger, Boolean persistentClient)
   at Dynamicweb.DataIntegration.Integration.ERPIntegration.ErpServiceCaller.SendRequest(DynamicwebServiceClient client, String secret, String requestText, ILogger logger)
   at Dynamicweb.DataIntegration.Integration.ERPIntegration.ErpServiceCaller.GetDataFromRequestString(String endpoint, String secret, String requestXml, TimeSpan timeout, ILogger logger)
   at Dynamicweb.DataIntegration.EndpointManagement.EndpointService.ExecuteDynamicwebConnectorServiceEndpoint(Endpoint endpoint, String requestBody, TimeSpan requestTimeout)
   at Dynamicweb.DataIntegration.EndpointManagement.EndpointService.GetResponse(Endpoint endpoint, String requestBody, TimeSpan requestTimeout)
   at Dynamicweb.DataIntegration.EndpointManagement.EndpointService.Execute(Endpoint endpoint)
   at Dynamicweb.Integration.UI.Queries.EndpointGetResponseQuery.GetModel()
   at Dynamicweb.CoreUI.Data.DataQueryModelBase`1.GetData()
   at Dynamicweb.CoreUI.Screens.ScreenBuilders.DefaultScreenBuilder`2.Make()
   at Dynamicweb.CoreUI.Screens.ScreenBuilder.MakeScreen(BuildRequest request)
   at Dynamicweb.Management.UI.Controllers.AdminController.GetScreenFromDefinition(String screenDefinition, String shadowEditId)
   at Dynamicweb.Management.UI.Controllers.AdminController.GetLayoutDefinition(String screenDefinition, String shadowEditId)
   at Dynamicweb.Management.UI.Controllers.AdminController.GetScreen(String layout, String navigationPath, String shadowEditId)
   at Dynamicweb.Management.UI.Controllers.AdminController.GetUI()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   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()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Dynamicweb.Management.UI.Middleware.AdminUIRedirectMiddleware.Invoke(HttpContext context)
   at Dynamicweb.Management.UI.Middleware.AdminDiagnosticsMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

 

Idéas what can be the reason for this and how to solve it?

All the best
/Peter


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Peter,
maybe the customer request fails on the BC side. 
Can you also try some other requests for example getting products or some paged requests for the customers:
 <GetEcomData Qty="1">   <tables>     <Customers type="all" importContacts="true" />   </tables> </GetEcomData>
 <GetEcomData Qty="1">   <tables>     <Customers type="all" importContacts="false" />   </tables> </GetEcomData>
?
You can also download and run the Test tool application and try to run the failed request from there. Test tool documentation is here. Maybe it can provide more detailed message about the problem.
BR, Dmitrij

 
Peter Krusell
Reply

Hi Dmitriy,

Yes if we limit the request to only a few thousand records with the Qty parameter there is no timeout and the response from BC comes through. But the timeout come already after about 20 sec when going above around 4000 records as limit. So its not possible to get all customers and all products without this timeout happening. This is the same in the test tool.

These requests both get timeout
 <GetEcomData><tables><Customers type="all" importContacts="false" /></tables></GetEcomData>
<GetEcomData><tables><Products type="all" setLanguage="SVE" importProductProperties="false" /></tables></GetEcomData>


20 sec is very low time out value. How can this be increased?
In this case it is a BC on prem and the client was advised by DW expert services to skip the DynamicwebConnector middleware service. So the reqeusts are sent directly to the codeunit endpoint in BC. The test tool config looks like this:


 

All the best
/Peter

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Peter,
it looks like problem is connected with the BC server. Can you try to run the failing requests and check the Windows Event Viewer logs after each failure request to find more explanation about the problem? Here is an explanation on how to browse the OnPrem server windows logs.
The TestTool sets the 30 min timeout for the requests so it should not fail just after 20 sec then.
BR, Dmitrij

 

You must be logged in to post in the forum