Last post Nov 20, 2015 02:27 PM by holdorfs
Nov 17, 2015 06:09 PM|holdorfs|LINK
I am creating a .net web service that is receiving input requests in XML format. The web service's function is to parse the XML initial request and send it's own post request to a third party organization which does a look-up for the request and if available
they send a response back in XML format to the web service for processing. If the response does find the data in the look-up the information it sends back as XML and is parsed by the web service then saved as a .pdf file. Once the .pdf file is created the
web service packages a response XML message and along with the identifying information a link to the .pdf is part of the message sent back to the calling client. Now, if the search for the information is not found a XML message is sent back to the client indication
the third party did not have the information ready with a status as pending. For all of the requests for the third party information the web service will create a folder on the server with a XML status file and if the .pdf file is created it will be in this
Now comes the tricky part of the design. There is another application located on the same server that needs to be running in a loop that and every 30 second it needs to call the web service on it's own and if the server folder created by each new request does
not contain the .pdf that program will make the web service call to retry the initial call and see if third party does now responds with the XML message that contains the valid information so it can create the .pdf and send a message back to the original client.
Now, if I am using a IIS what type of application should I create that does the 30 second looping? The server does have a MS SQL database. How should I have the 30 second looping application communicate with the web service? Finally, if the looping application
does make a successful call to the web service what is the best way to cause a trigger from the looping application to make the web service send the successful response to the original calling client?
Finally, if the looping application does make a successful call to the web service what is the best way to cause a trigger from the looping application to make the web service send the successful response to the original calling client? One note is that the
30 second loop must scan the new request folder tree and retry for any of the requests that have not succeeded.
Nov 20, 2015 09:14 AM|holdorfs|LINK
I have given this problem a lot of thought and I think I might have a solution. I think I could create another web service that runs on the same site and have it handle the 30 timing process. What I think might work is that I use a 30 second sleep then
cycle through the process again. Does anyone see any problems with doing this? Any problems with resources or having a separate web service running like a different thread in the application?
Nov 20, 2015 01:09 PM|holdorfs|LINK
I think I have a better solution. I think I can start a separate thread to handle the observation of the primary web services output. Does anyone see any problems doing things that way? Resource problems, communicating with the
web service or anything other then that?
Nov 20, 2015 01:40 PM|PatriceSc|LINK
A bit hard to follow. How would you contact back the original "client" (is this the service caller, a mail message or what) ? Try to explain perhaps the real purpose.
It seems to me I would do what seems to do already this 3rd party service ie a service which allow to submit requests and that allows to retrieve the result at a later time such as what is done for example to process videos.
If you really need to trigger something it seems a Windows service or a scheduled console app would be enough.
For now my understanding is basically that you have a first call and the the response may not be availlable right now but at a later time. Would the client stay connected just waiting for the response? To me it seems more that the client should query a
response and be responsible for coming back until he can get a final response or maybe an error status.
It might be easier to explain first the real world scenario so that we can understand the big picture rather than presenting us technical détails about how you are thinking to do something we don't really know about to start with.
Nov 20, 2015 02:27 PM|holdorfs|LINK
The client requesting the information sends a XML web service request to the checkForDataRequest web method. What the checkForDataRequest web method does is immediately call the third party service to see if that data is available. If the third party finds
the data it replies back with a XML response that is used by the checkForDataRequest for it to reply back to the caller. What the web method creates a new folder on the server, with the name of the original request's Id and creates a pdf file from the data in
the returned response and saves it in the new folder. Once that takes place the checkForDataRequest method packages a XML response with some response data and a link to the pdf and sends it back to the original client. That is the initial process. If; however,
the checkForDataRequest method does not get an immediate response from the third party service then methods creates a empty folder and replies to the client a data not found XML response. That is all of the communication from the first exchange. Now, at that
point I need to have a worker thread calling the checkForDataRequest method to call the third party service and check if it does now have the requested data ready. If this time the web service method receives the data back then at point it sends a successful
response back to the original client that now contains a link to the pdf it created. The website client is being done by someone else and I am not sure how is operates. I hope that this makes sense.