Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mock SOAP web services in java [closed]

Tags:

java

soap

mocking

There is web-application in which SOAP web services are used. Various tools are present in the market in order to test SOAP web service even if web service client is not developed. For e.g. SOAP-UI, tcpmon

But I want the vice-verse of it. I want to perform unit testing on my application by some hard coded response. Actually,in my project there are separate teams for development of client side web service & server side web service. I am at client side. So, sometimes I cannot perform my testing because server side development is not complete.

I want to develop an application by which I can test my application even the web service server is not ready.Is there an easy way to set up some kind of fake web service? What could be the possible options of doing that?

like image 733
Infotechie Avatar asked Oct 05 '12 16:10

Infotechie


2 Answers

You are mentioning Soap UI which does exactly what you want. It starts small web servers on specified port and handles requests matching given WSDL.

You can either use static, hard-coded responses and employ Groovy to make mock web service more dynamic. It gets even better: Soap UI can wrap the whole mock in a single self-contained WAR that you can deploy on any servlet container.

like image 112
Tomasz Nurkiewicz Avatar answered Nov 11 '22 08:11

Tomasz Nurkiewicz


Here is another webservice mocking tool:

https://sourceforge.net/projects/soaprest-mocker/

You can deploy it on a server and use it's webservice interface to setup resposes and verify recorded requests.

like image 3
Jacek Obarymski Avatar answered Nov 11 '22 09:11

Jacek Obarymski