Getting reply document back after publishing services times out URGENT

One of our web portal has a requirement to invoke a sevice, say “A”, (via http)on IS 6.1 which calls two BAPI services SEQUENTIALLY. First BAPI will create an IDOC in SAP and 2nd BAPI service will get its status back from SAP. The requirements includes if both BAPI services do not finish in specified time, service A should time out and return a “PENDING” status to web portal however the SAP response should be saved in portal db when it is available later.

By design both BAPI services will be implemented in publish-subcribe fashion and will use either publishAndWait (or publish and waitForReply) to publish the “request” document to broker 6.1. The subscribing services will connect to SAP via SAP adaptor and return information via a “reply” document.

The catch is that if publishing service does not receive a reply within specified time, it will time out and return response back to web portal and quits in which case the the “reply” documents returned afterwards by subcribing service will be discarded as the publishing services is no more waiting for this “reply” docuemnt. THIS IS NOT A DESIREABLE BEHAVIOUR.

Can service “A” return a “PENDING” status back to web portal and still continue to wait for “reply” document from SAP (instead of quitting). If not, how to get the “reply” document from subscrining service after publishing service is no more waiting for reply.

Any quick comments are appreciated.

This is just an idea i am throwing to you.

  1. Use waitForReply within a REPEAT step. Set REPEAT step properties as follows:

Count = -1
Repeat Interval = Some interval in seconds
Repeat on = FAILURE

  1. Put a Branch step and Check whether the receivedDocument is null or not. If null then Exit from the parent and signal FAILURE (Use EXIT step) else continue processing your receivedDocument.

When the null condition is executed then EXIT step will exit from the BRANCH step and signals failure, because of this the REPEAT step will get Repeated every time after the REPEAT INTERVAL.

Let me know if this works.
Shahul.

I tried the idea i suggested to you and it is not working. I get the following error:

[ISS.0098.0036E] webM IS RequestReplyHandler encountered Transport Exception: com.wm.app.b2b.server.dispatcher.exceptions.CommException: [ISS.0098.9010] No waiting thread for Document Id: 15. Requestor might have timed out.

Therefore you may have to look for some other option.
Shahul.