WebService Mock is a very simple yet powerful tool for mocking WebServices.
- Mocking is achieved in a non intrusive way, without writing even a single line of code, which means no need to mock the service stubs.
- Can be used for stress or load testing the applications without hitting the actual WebServices. Your service providers may not agree always.
- You want to simulate different test scenarios or conditions without engaging/involving your service providers.
- Download the binary distribution from http://webservice-mock.googlecode.com/files/webservice-mock-1.0-BETA-bin.zip, which contains the main jar and the required libraries.
- Download the json configuration from http://webservice-mock.googlecode.com/files/services.json and configure the service endpoint. Refer to the below section on how to configure.
- Extract the zip from step 1 and run the below. I promise, you will definitely love this little tool.
java -jar webservice-mock-1.0-BETA.jar 2345 / /home/dchakr/testDir /home/dchakr/testDir/services.json
Below is a sample JSON configuration.
[
{ "hostName": "www.webservicex.net","port": 80,"contextPath": "/globalweather.asmx", "refreshInterval": 3,"mirrorEnabled": false,"detachHeader":true,"detachElementList":["Envelope/Body/GetCitiesByCountry/CountryName"],"ignoreOperationList":["GetWeather"],"directoryBrowsing":true},
{ "hostName": "graphical.weather.gov","port": 80,"contextPath": "/xml/SOAP_server/ndfdXMLserver.php", "refreshInterval": 5,"mirrorEnabled": true,"detachHeader":true,"detachElementList":[""],"ignoreOperationList":[""],"directoryBrowsing":true}
]
- hostName -
- port -
- contextPath -
- refreshInterval -
- mirrorEnabled -
- detachHeader -
- detachElementList -
- ignoreOperationList -
- directoryBrowsing -
Darimireddi Chakravarthi