Skip to main content

I am involved in a software application development project that utilizes XBIS running on a Linux server.  The project has a requirement that states "If a request exceeds 15-seconds, the system will stop processing and return a message stating the request is taking too long".

After speaking with Steve Jolivet I learned of the B$SetServiceTimeout.  After reviewing the documentation, I understand I can set the timeout to 15-seconds to fulfill this requirement.  The documentation states "If the timer elapses, the service program is terminated".

I have never used the timeout feature.  I have 2 basic questions, please: (1) considering the set-up steps of an XBIS program, where would the call to B$SetServiceTimeout go and (2) where in the program would I construct the "system is taking too long" error message.

Any advice will be greatly appreciated.

Thanks!

Russell H.


#XBIS
#RMCOBOL
#BIS
#SetServiceTimeout

I am involved in a software application development project that utilizes XBIS running on a Linux server.  The project has a requirement that states "If a request exceeds 15-seconds, the system will stop processing and return a message stating the request is taking too long".

After speaking with Steve Jolivet I learned of the B$SetServiceTimeout.  After reviewing the documentation, I understand I can set the timeout to 15-seconds to fulfill this requirement.  The documentation states "If the timer elapses, the service program is terminated".

I have never used the timeout feature.  I have 2 basic questions, please: (1) considering the set-up steps of an XBIS program, where would the call to B$SetServiceTimeout go and (2) where in the program would I construct the "system is taking too long" error message.

Any advice will be greatly appreciated.

Thanks!

Russell H.


#XBIS
#RMCOBOL
#BIS
#SetServiceTimeout

Hi Russell,

Is the BIS implementation a web service, or is some sort of HTML page expected?  In either situation, is there anything in the error response that is dependent on the request inputs?

Is this a global requirement for the service, or is this requirement conditioned on certain factors?

There are two ways to set a service timeout.  One is in the SRF file, using the {{SessionParms}} tag.  The other is for the COBOL service program to CALL "B$SetServiceTimeout".  The former is a global setting for the session, while the latter can be conditioned on request inputs, for example.

The biggest problem is that if a service timeout occurs, the COBOL service program is not notified and has no chance to recover.  Also, if a service timeout occurs, the XMLExchange 'OnExit' will be used by BIS to send a REDIRECT to the client - which is not very helpful unless the client can understand the redirect.  If the client can understand the REDIRECT and a static response is acceptable, then you can use the OnExit to redirect the client to an SRF that generates the static error response.

However, what it probably boils down to is for the COBOL service program to manage its own time, so that it can shut down in a reasonable fashion and return the correct response to the client.  Since about the only way a program can consume 15 seconds on a modern computer is through looping, it means that in any long running loop, you will have to ACCEPT the TIME and determine if the program has taken too long (after having computed at the beginning of the request the time at which to stop).  If you take this route, then the service timeout should not be used (except to control gross runaway situations of unexpected program behavior).

I know this is probably not the answer you were looking for, but the fact that there is no mechanism in the SRF to capture an exception (without involving the client via REDIRECT) is inconvenient.  (I hope that I am missing something and that one of the Micro Focus gurus will chime in.)

Tom Morrison
Hill Country Software


I am involved in a software application development project that utilizes XBIS running on a Linux server.  The project has a requirement that states "If a request exceeds 15-seconds, the system will stop processing and return a message stating the request is taking too long".

After speaking with Steve Jolivet I learned of the B$SetServiceTimeout.  After reviewing the documentation, I understand I can set the timeout to 15-seconds to fulfill this requirement.  The documentation states "If the timer elapses, the service program is terminated".

I have never used the timeout feature.  I have 2 basic questions, please: (1) considering the set-up steps of an XBIS program, where would the call to B$SetServiceTimeout go and (2) where in the program would I construct the "system is taking too long" error message.

Any advice will be greatly appreciated.

Thanks!

Russell H.


#XBIS
#RMCOBOL
#BIS
#SetServiceTimeout

Hi Russell:

As usual, Tom is correct.  The ServiceTimeout is intended to terminate run-away or unresponsive COBOL programs because, when the time expires, it's effectively the same as requesting a STOP RUN (Ctrl C or control-break). BIS will then redirect to the URL specified in the OnExit attribute of the {{XmlExchange}} tag.  

While this might not be unreasonable if your program is just querying data, it's also possible that your program may be in a state where this isn't desirable.  

The OnExit redirect in the {{XMLExchange}} tag is taken any time the program terminates without calling B$WriteResponse.  So you won't be able to tell the user exactly why the program terminated, but redirecting to a static page that says something like "server too busy" is not unreasonable.

It's still best to have your program track its own time, respond with an appropriate page, and terminate cleanly when time time expires.  Then you can display any output you like.

If you want to experiment with this, you can place this tag in the .SRF file before the {{StartService}}:

{{ SessionParms(ServiceTimeout=15) }}


I am involved in a software application development project that utilizes XBIS running on a Linux server.  The project has a requirement that states "If a request exceeds 15-seconds, the system will stop processing and return a message stating the request is taking too long".

After speaking with Steve Jolivet I learned of the B$SetServiceTimeout.  After reviewing the documentation, I understand I can set the timeout to 15-seconds to fulfill this requirement.  The documentation states "If the timer elapses, the service program is terminated".

I have never used the timeout feature.  I have 2 basic questions, please: (1) considering the set-up steps of an XBIS program, where would the call to B$SetServiceTimeout go and (2) where in the program would I construct the "system is taking too long" error message.

Any advice will be greatly appreciated.

Thanks!

Russell H.


#XBIS
#RMCOBOL
#BIS
#SetServiceTimeout

Tom / Uwe,

My software application is a web service.  The application is supposed to handle 2 different requests from our integration partner.  One request is our integration partner requesting data from us.  The other request is our integration partner sending data to us where we would "update" our records.  We do not control the incoming request or the outgoing response.  We had to write our application to conform to the incoming request and to structure responses according to the integration partner requirements.  Therefore, the program is not written in the format of the BIS sample program "webappsample4".  I wrote the application as best I could and, in my opinion, the program makes a valid attempt to make a complicated situation easy.  That said, it was a valid attempt and I'm not confident I succeeded.

I will have to determine if the timeout error condition response is the same between the 2 requests from our integration partner.  If they are, I believe the OnExit redirect would resolve my issue.  If the timeout error responses are different, I don't know what I will do.

I will research "ServiceTimeout" and the OnExit redirect in the {{XMLExchange}} tag.  I will let you know the results of my research and we'll decide how to close this thread.

Thank You very much for your help!

Russell H.


I am involved in a software application development project that utilizes XBIS running on a Linux server.  The project has a requirement that states "If a request exceeds 15-seconds, the system will stop processing and return a message stating the request is taking too long".

After speaking with Steve Jolivet I learned of the B$SetServiceTimeout.  After reviewing the documentation, I understand I can set the timeout to 15-seconds to fulfill this requirement.  The documentation states "If the timer elapses, the service program is terminated".

I have never used the timeout feature.  I have 2 basic questions, please: (1) considering the set-up steps of an XBIS program, where would the call to B$SetServiceTimeout go and (2) where in the program would I construct the "system is taking too long" error message.

Any advice will be greatly appreciated.

Thanks!

Russell H.


#XBIS
#RMCOBOL
#BIS
#SetServiceTimeout

Tom / Uwe,

My software application is a web service.  The application is supposed to handle 2 different requests from our integration partner.  One request is our integration partner requesting data from us.  The other request is our integration partner sending data to us where we would "update" our records.  We do not control the incoming request or the outgoing response.  We had to write our application to conform to the incoming request and to structure responses according to the integration partner requirements.  Therefore, the program is not written in the format of the BIS sample program "webappsample4".  I wrote the application as best I could and, in my opinion, the program makes a valid attempt to make a complicated situation easy.  That said, it was a valid attempt and I'm not confident I succeeded.

I will have to determine if the timeout error condition response is the same between the 2 requests from our integration partner.  If they are, I believe the OnExit redirect would resolve my issue.  If the timeout error responses are different, I don't know what I will do.

I will research "ServiceTimeout" and the OnExit redirect in the {{XMLExchange}} tag.  I will let you know the results of my research and we'll decide how to close this thread.

Thank You very much for your help!

Russell H.


I am involved in a software application development project that utilizes XBIS running on a Linux server.  The project has a requirement that states "If a request exceeds 15-seconds, the system will stop processing and return a message stating the request is taking too long".

After speaking with Steve Jolivet I learned of the B$SetServiceTimeout.  After reviewing the documentation, I understand I can set the timeout to 15-seconds to fulfill this requirement.  The documentation states "If the timer elapses, the service program is terminated".

I have never used the timeout feature.  I have 2 basic questions, please: (1) considering the set-up steps of an XBIS program, where would the call to B$SetServiceTimeout go and (2) where in the program would I construct the "system is taking too long" error message.

Any advice will be greatly appreciated.

Thanks!

Russell H.


#XBIS
#RMCOBOL
#BIS
#SetServiceTimeout

Russell, I hate to be the bearer of bad news, but almost certainly the OnExit redirect will NOT work.  Most clients of web services (whether SOAP or REST) are not really expecting a redirect HTTP status.  

Instead, they are expecting a SOAP fault (in the case of SOAP) or some specific error structure (in the case of RES, but an HTTP status of 200.


I am involved in a software application development project that utilizes XBIS running on a Linux server.  The project has a requirement that states "If a request exceeds 15-seconds, the system will stop processing and return a message stating the request is taking too long".

After speaking with Steve Jolivet I learned of the B$SetServiceTimeout.  After reviewing the documentation, I understand I can set the timeout to 15-seconds to fulfill this requirement.  The documentation states "If the timer elapses, the service program is terminated".

I have never used the timeout feature.  I have 2 basic questions, please: (1) considering the set-up steps of an XBIS program, where would the call to B$SetServiceTimeout go and (2) where in the program would I construct the "system is taking too long" error message.

Any advice will be greatly appreciated.

Thanks!

Russell H.


#XBIS
#RMCOBOL
#BIS
#SetServiceTimeout

Just checked -- if the COBOL program terminates without responding, for SOAP requests, the OnExit is ignored and BIS will return a SOAP fault and not a redirect. BIS for UNIX has always returned an HTTP status code of 500, not 200 (per "www.w3.org/.../soap11;); BIS for IIS on Windows returned  200 until v12.10, when it was changed to return 500. That's described in the release notes, along with a way to change it back if that causes a backward-compatibility problem.