Print widget - Increase timeout for Synchronous service?

1291
7
04-10-2019 03:36 AM
PrashantKirpan
Occasional Contributor

Hi All,

I am using customised print service in print widget -WAB 2.10. Service is synchronous and it fails to execute when exceeds 60 seconds. Works well with less execution time.

I tried to increase time in  esriConfig.defaults.io.timeout and set service settings as mentioned below but still widget is showing  "Unable to Load \url\.. Status 0" error on UI.

Is there any additional configuration is required? Any help would be much appreciated.

Regards,

Prashant

0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

See if this thread helps:

https://community.esri.com/thread/181102

0 Kudos
PrashantKirpan
Occasional Contributor

Thanks Robert for reply.Currently proxy is not in place, I will try to configure as mention in thread and hope this should resolve issue.

0 Kudos
PrashantKirpan
Occasional Contributor

Hi Robert,

As mentioned in thread https://community.esri.com/thread/181102 i tried to configure proxy but still after 60 seconds widget\service is throwing error. 

After adding proxy,print request is redirected through proxy as displayed below :

Proxy.config :

<ProxyConfig allowedReferers="*"  mustMatch="false">
     <serverUrls>
           <serverUrl url="Https://application.domain.name"  matchAll="true"/>
      </serverUrls>
</ProxyConfig>

Print.js:

_getPrintTaskInfo: function(){

..

esriRequest({..

 },{useProxy: true, usePost: false}).then(lang.hitch(this, function (data) {..}

app config.json: 

"httpProxy": {
   "useProxy": true,
   "alwaysUseProxy": false,
   "url": "https:/....../proxy.ashx",
   "rules": [
       {
         "urlPrefix":"https://....PrintTask/",
         "proxyUrl":"https://.../proxy.ashx"
        }
      ]
}

Also service time out settings are  600/300/18000 as mentioned in main thread.

Apart from this any additional settings are required?

Thanks & Regards,

Prashant

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Prashant,

   The overall request timeout is set in the jimu.js/main.js file and is set to 3 minutes.

//set the default timeout to 3 minutes
esriConfig.defaults.io.timeout = 60000 * 3;

I am out of ideas as to why you are having an issue.

0 Kudos
Mehretab
Occasional Contributor

It is hard to identify where the timeout is defined in a complicated Infrastructure. Remember also the web server/firewall can have a timeout for requests. 

Having said that, having said that it worked fine for me when I switched the printer service to  Asynchronous mode.

AdminAccount2
Occasional Contributor

"Having said that, having said that it worked fine for me when I switched the printer service to  Asynchronous mode."

Every ESRI post on using geoprocessing print services stated the printer service MUST be set to Synchronous. Doing that results in timeout and job failure if executing a long print job. I switched to Asynchronous as per your recommendation and that fixed it! I think ESRI needs to modify their documentation.

0 Kudos
DávidGregor
New Contributor II

I extended these timeouts, but i still got timeout after 5mins(300sec/300000milisec), so i searched for this number in the app, and in the jimu.js/main.js if found this at line 94 (wab 2.15):

    esriRequest.setRequestPreCallback(function(ioArgs) {
      if (ioArgs.content && ioArgs.content.printFlag) { // printTask
        ioArgs.timeout = 300000;
      }

So i overwrote this number to 1200000 and finally i could export A0 size pdf (with PrintPlus widget, but probably this works with normal Print widget).

Probably this is not the answer for this question, but maybe a helpful info.

0 Kudos