I am creating a web service. The client sends information in XML to a RETURN URL via POST. The client is supposed to only receive “Success” or “Fail” which is just a status indicator to confirm that the RETURN URL did received the POST message.
After that, the RETURN URL (host) will process the XML data that the client sent.
The problem I am having is that the processing may take minutes. I want to send the status message right away, then continue with processing the XML data.
Any advice on how to tackle this?
There are probably several ways to do this. The first one that comes to mind is to store the XML in a database record and return the “success” status to the client.
Set up a process to run every few seconds or minutes that checks for new records in the database and processes them until there are no more.
I implemented a group texting service in ASP this way once. Incoming SMS messages (like your incoming XML files) were stored in a database. A process ran every minute or two that looked for new messages and did whatever the message told them to do. If the message was a command to send a new message to the group, those outgoing messages were put into another database and another process ran periodically that sent those messages. It would send messages until it reached a limit prescribed by the carriers on how many messages per minute it could send, then it would terminate.
This was all done in classic ASP with a third-party scheduler running on the server. Worked great.