Developer forum

Forum » Integration » Error importing XML products ((504) Gateway Timeout)

Error importing XML products ((504) Gateway Timeout)

Mario Jorge Silva
Reply

Hello, I have come across an error when trying to import products through a scheduled task, using DW 9.10.7, when I try to run the scheduled task it takes too long and gets a timeout from the BC API, when using the Dynamicweb Connector Test Tool 2.5.0 it works in less than 10 minutes. Could this be an issue with the DW version or what could be causing this difference in speed between the test tool and the actual DW task? The parameters for the XML request are the same both on the scheduled task and on Dynamicweb Connector Test Tool.


2023-01-23 18:30:04.776: Starting scheduled task.
2023-01-23 18:30:06.933: Request: <GetEcomData ReimportTable="true" SetCheckpointToNow="false" CustomModifier="FB"><tables><Products type="all" importProductProperties="true" setLanguage="DAN" /></tables></GetEcomData>.
2023-01-23 18:40:07.227: Response: An error occurred processing the request. Exception: The remote server returned an error: (504) Gateway Timeout. Response: Timeout Request timed out..
2023-01-23 18:40:07.227: String is not valid XML format: '{0}'.. System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.    at System.Xml.XmlTextReaderImpl.Throw(Exception e)    at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()    at System.Xml.XmlTextReaderImpl.ParseDocumentContent()    at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)    at System.Xml.XmlDocument.Load(XmlReader reader)    at System.Xml.XmlDocument.LoadXml(String xml)    at Dynamicweb.DataIntegration.ScheduledTaskAddIns.ImportDataWithPaging.ImportDataWithPagingScheduledTask.StringToXml(String xml)
2023-01-23 18:40:11.163: File: 'D:\dynamicweb.net\Solutions\S_DW_Fagerberg\Files\System\Log\DataIntegration\Import Products to XML (DAN)20230123-1830047901026.log' doesn't exists
2023-01-23 18:40:11.163: Xml returned from the web service: 'http://www.fagerberg.dk/fagerbergservice' is empty
2023-01-23 18:40:11.163: Scheduled task failed.

 


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Mario,
different things can be a cause. Do you have the Dynamciweb connector connected to the BC instance?
Is it BC OnPrem or Cloud?
Also can you check the sessionState timeout in the web.config file and the global settings values for:
Globalsettings/System/ScheduledTasks/ScriptTimeout:
https://doc.dynamicweb.com/documentation-9/platform/platform-tools/scheduled-tasks#sideNavTitle1-4-3
BR, Dmitrij

Votes for this answer: 1
 
Mario Jorge Silva
Reply

Hi Dmitriy, I am connecting to DynamicWebService on the connector tool and then calling the webservice with the same XML request that is on the scheduled task. 
It is Microsoft's Dynamics 365 Business Central on Cloud. I have changed the ScriptTimeout, but the main issue now is that it is still very slow when running the scheduled task, it takes around 1 hour to run the scheduled task, but through the connector tool it only takes around 10 minutes.

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Mario,
what scheduled task add-in do you use for the task? Do you run the task manually from the task list or is it scheduled and executed automatically?
Are you sure you run the same requests to the same BC instance?
BR, Dmitrij

 
Mario Jorge Silva
Reply

Hi Dmitriy, I am running a scheduled with Import data with pagging add-in, but after altering the ScriptTimeout property as you mentioned and changing paging to 250 documents per request it is now working. Thanks for the help :)

 

You must be logged in to post in the forum