Sunday, October 30, 2011

Verify the result of REST web-service


Problem Statement:
Customer has given an URL and said the following information.  The URL acts as a web-service.  We need to pass a ZIP file name as an argument along with this URL.  The URL verifies that whether the specified ZIP file is available in the system or not.  If it is available, the URL will give the response as a string with the same ZIP file name.  Otherwise, it throws an exception.  

Ok, what is the difficulty here?
The system is not having any sample ZIP files.  We should not do any more testing with the URL as the URL is related to production system.  We should deliver the code that should be suitable for the requirement and the same code will be tested in live environment only once.

How did overcome the problem?
First, I have gone through the Utility packages that are available in the project source code.  I found the code that is useful to access REST web-service URL.  Now, I want to check whether the URL is related to REST web-service or Web-service.  We know that we can see the result of the REST web-service by specifying the URL in the browser.  Then, I specified it in browser.  Present browser is not displaying anything.  I felt that this might be because of proxy settings.  Then, I tried with another browser.  Then, I found “FileNotFoundException” in the browser.  Then, I confirmed that the URL is related to REST web-service but not related to web-service.  As webservice is more secured, we cannot trace the result of URL by using the browser.

Solution provided:

Quick solution provided:  -NA-

Suggested solution: 
We have implemented the code based on REST web-service access.