In my previous post I showed you how you can use Ant and XFire to create a client for your webservice. Another, even nicer and easier way, to test your webservice is to make use of soapUI. This is a free tool (I haven’t used the Pro version yet) with which you can easily create a SOAP request and send them to your webservice and see the repsonse that is send back by the webservice. Beside just sending SOAP requests you can also have executed Groovy scripts with which you can prepare the state of your database for instance, so you can create a full and clean test cycle.
I have installed the standalone version of soapUI version 1.7 which can be downloaded here. After installing it, you can start it and create a new WSDL project:

The WSDL I am pointing to, is the WSDL of the service I deployed in this post. Here is the content of the WSDL:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://model.pascalalma.net" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:tns="http://net.pascalalma.services/BookService" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://net.pascalalma.services/BookService"> <wsdl:types> <xsd:schema targetNamespace="http://model.pascalalma.net" elementFormDefault="qualified" attributeFormDefault="qualified"> <xsd:complexType name="ArrayOfBookObject"> <xsd:sequence> <xsd:element name="BookObject" type="ns1:BookObject" nillable="true" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="BookObject"> <xsd:sequence> <xsd:element name="author" type="xsd:string" minOccurs="0" nillable="true" /> <xsd:element name="isbn" type="xsd:string" minOccurs="0" nillable="true" /> <xsd:element name="title" type="xsd:string" minOccurs="0" nillable="true" /> </xsd:sequence> </xsd:complexType> </xsd:schema> <xsd:schema targetNamespace="http://net.pascalalma.services/BookService" elementFormDefault="qualified" attributeFormDefault="qualified"> <xsd:element name="myAnswer" type="ns1:ArrayOfBookObject" /> </xsd:schema> </wsdl:types> <wsdl:message name="getBooksRequest" /> <wsdl:message name="getBooksResponse"> <wsdl:part element="tns:myAnswer" name="myAnswer" /> </wsdl:message> <wsdl:portType name="BookServiceImpl"> <wsdl:operation name="getBooks"> <wsdl:input message="tns:getBooksRequest" name="getBooksRequest" /> <wsdl:output message="tns:getBooksResponse" name="getBooksResponse" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="BookServiceHttpBinding" type="tns:BookServiceImpl"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getBooks"> <wsdlsoap:operation soapAction="urn:getBooks" /> <wsdl:input name="getBooksRequest"> <wsdlsoap:body use="literal" /> </wsdl:input> <wsdl:output name="getBooksResponse"> <wsdlsoap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="BookService"> <wsdl:port binding="tns:BookServiceHttpBinding" name="BookServiceHttpPort"> <wsdlsoap:address location="http://localhost:8080/XFireTest/services/BookService" /> </wsdl:port> </wsdl:service> </wsdl:definitions> |
As you can see it is a simple WSDL:
there are no input parameters for the service and it will return a list (array) of bookObjectTypes. After creation of the soapUI project, you directly create tests for your webservice since the checkbox asking to create a SOAP request for each operation was checked. If you double click the request you can see the content of the SOAP request in the main window:

Since my webservice doesn’t have any input parameters, it is very simple request. When we click the green arrow the request is sent and we will see the SOAP response we got back from the server:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <myAnswer xmlns="http://net.pascalalma.services/BookService"> <ns1:BookObject xmlns:ns1="http://model.pascalalma.net"> <author xmlns="http://model.pascalalma.net">Pascal Alma</author> <isbn xmlns="http://model.pascalalma.net">1313131313</isbn> <title xmlns="http://model.pascalalma.net">XFire Tutorial</title> </ns1:BookObject> <ns1:BookObject xmlns:ns1="http://model.pascalalma.net"> <author xmlns="http://model.pascalalma.net">Pascal Alma</author> <isbn xmlns="http://model.pascalalma.net">1413135316</isbn> <title xmlns="http://model.pascalalma.net">XFire Advanced</title> </ns1:BookObject> </myAnswer> </soap:Body> </soap:Envelope> |
So now we know the webservice is working. To make it a good test case, we need to create a new testsuite in our project and add testcases to it. With these test cases you can send your custom SOAP requests and check the response with asserts. You can do this by right-clicking the BookServiceHttpBinding and choose ‘Generate Testsuite’. You will now get a testsuite with one test case (in my situation). If you expand the Test Steps node and double click at the TestRequestStep getBooks you will see the simple SOAP request again in the main window. But this time you can right-click in the bottom of the window to add assertions:

This way it is not only checking whether the service is reached, but it also checks if the content of the reponse is what you would expect to be returned by the service. This is just a small example of all the things you can do with soapUI but I hope when you play around with it, you will get enthousiastic about the tool as I am.
Hi,
I have multiple webservices with multiple endpoints behaving in a synchronous manner.Is there a possible way that I can use soap ui to call the two webservices in the same test suite using multiple endpoints.
Hi,
I am using SoapUI Tool to test our webservices.
i have multiple webservices. i am executing all those webservices at a time by creating test suite.
Is it possible to save Request & Response (together) in SoapUI tool.
Can any body help me out to do this.
Thanks
Vidya Rekha B
I have a mainframe web service on port 8080, which I can connect to with my .Net applications (and currently use) as well as through IE and Firefox. However when I try to connect through SoapUI, it fails to connect. I am specifying the same address I put into IE and Firefox (which includes the port, e.g. http://mainframe:8080/'path/service?wsdl).
I used WireShark (previously Etherreal) to inspect the packets and I found that SoapUI is trying to connect on port 80 regardless of specifying port 8080.
So, I did some further investigation and tried connecting to a web service that was on port 80 and 8888 and both worked great.
SoapUI is an excellent tool and I hope I can use it with my mainframe web services.
Does anyone know what I can do to fix the issue and force SoapUI to use the port I specify?
@Gary:
Yes, that is possible. Someone else asked the same in the comments. Check might check them for a possible solution
@Vidya:
I haven’t done that before, so I don’t know. But it looks possible to me. Otherwise you have to log it at the serverside (in some protected area, so you can control who is using the service). Most Webservice frameworks have a solution for that.
@Brock:
I am also using port 8080 in SoapUI so that doesn’t seem to be the problem here. Could it be a problem that Soap UI is doing a http POST request and the browser are doing GET requests? You might check that.
Hi Pascal,
Thanks for your quick response. One more question, I have done webservice load testing using SoapUI is it possible to export the graphs from the tool?
Hi Pascal,
Thanks for your blog. It is very informative.
I am using soapUI 2.0.2 (free download) trying to get my mock service to use a keystore. I have generated the keystore file and placed the proper configurations in the settings. When I launch the mock service, the performance on my box suffers horribly, to the point if I click on the “I” to get a look at the WSDL, it takes minutes for a browser to pop up, and I have not yet had the patience to wait to see if the WSDL is ever displayed. When I remove the SSL settings, performance is back to what is expected. Any ideas on what might be causing this?
Thanks,
Paul
@Girish
I am not aware of any export functionality, other then the print screen one ;-). But please keep in mind I am only a simple (and enthousiastic) user of SoapUI and I do not know all things about it (yet).
@Paul
It looks like the used SSL port is blocked and SoapUI is waiting for it or something. I must say I haven’t seen this behaviour before, so I am afraid I can’t help you with this.
I am using SOAP UI 2.0.2(latest) for by SOAP load testing. I loaded WSDL files to tool and written Groovy script to vary the contact name(for contact addition example) for each and every contact add sent to server in load test. But the problem is i need to verify the response, since failure response is also a SOAP body the tool is taking the response as success and not showing it as error. Some times i see no response sent from my server but still tool doesn’t capture it as failure(err). If i send 100 ContactAdd requets(delay of 1 sec with each req) i see only 80 to 90 conatcts are added successfully in database but my SOAP UI tool still shows it as no error and all 100 success. Pls help me asap in this regard and i tried hard to come out of this but couldn’t. Pls reply ASAP.
Thank u.
Back to this from June 08. I have looked closer a the wireshark trace, the client is presenting no client certificates to the Web service. I wonder what it takes to make it do so – I will keep changing wheels till I find the flat one.
@Raghavendra:
I have had similar behaviour too in a testcase. And although I was told it had something to do with soap UI it appeared to be a bug in our web service implementation. Our implementation was not completely thread safe. So maybe you can check that in your case too??
Another option is to add ‘Assertions’ to your response so that SoapUI will check the content of the repsonse for a specific tag/text and/or it will validate the response against the schema configured in the WSDL.
Hi,
I’m new to SoapUI and I am trying to insert the values dynamically in request by reading the values from external source, so anybody can tell me how I can do this?
@Amruta:
You can take this post as an example:
http://www.pascalalma.net/2007/07/11/another-common-issue-solved-with-soap-ui/
The first step (properties step) can also be based on the contents of an external property file.
I hope this helps.
Thanx pascal, adding assertion to response solved my issue.
I pascal,
I have configured 6 proxies in my ALSB console and i want to test them in SOAPUI. When i import the WSDL using http://localhost:7001/proxyname?WSDL i am able to do it for 5 of them. But one service returns an error “Unexpected element TAG_END”. Can you help me with it?
Thanks
sandeep
Hi Sandeep,
I haven’t seen this before in Soap UI. It looks like it is an issue with the 6th proxy. What do you get as WSDL when you open it in a web browser? Do you see the term ‘TAG_END’ there??
Hi Pascal,
I am trying to perform Load testing using SOAP UI tool wherein we have to send multiple requests to one web service each after some time interval, I have added three steps in the test case 1. Data Source 2. Test Request 3. Data loop
I have to submit the multiple Test requests each one after some time interal say 6 sec. but “step 2. – Test Request” itself takes 20 sec. to get the response from WSDL so it will wait for 20sec. to move to nest step i.e. “step 3. -Data loop” and then again it will initiate request with different Inputs parameters from Data Source. So in this way we will not be able to send the multiple requests every 6 secs. (regardless of response for each run)
Could you please help me our here, how can I simulate this scenario?
Thanks!
Hi Pascal,
Please help me out here ASAP…. I am in need of it.
I want to send multiple requests asynchronously how would I be able to do this using SOAP UI?
Hi Niranjan,
You might take a look at this post:
http://www.pascalalma.net/2007/07/11/another-common-issue-solved-with-soap-ui/
In this post I use the load test option of SoapUI to run many threads simultaneously. But I am not sure if this is what you want with your test case.
But when processing a SOAP request takes 20 seconds and you want your web service to receive a request every 6 seconds from the same client you might want to change the implementation of your web service, so it is not processing calls in a synchronized way but asynchrone.
Hope this helps.
Thanks Pascal for your reply,
I can not use threads as every time I want to send the request with different input parameters and also I cannot change the web service as it is not designed by me….but I am going to test the same.
Do you think, is there any other way to achive this?
hi pascal, i need it asap plz if u could help me out? thanks
Hi,
I usually test my soapui project files with Ant and provide a ‘-e’ flag with testRunner.sh that I use in build.xml file.
I need to make a groovyScript Test Step in few of my test cases that are supposed to be run on different endpoint than defined in ‘-e’ flag.
Is there a way to enforce change of endpoint dynamically while my tests are running through Ant?
Can you please provide a groovyScript Code Snippet for the same solution.
Here is what I tried but didn’t worked:
def currentTestStep = testRunner.testCase.getTestCaseByName(“XxxTestStepName”);
currentTestStep.setEndPoint(“http://localhost/soapapp/appId=3″);
There is no such thing like testStep.setEndPoint(). Can please tell me how to go about it as I can’t figure this out in SoapUI API Docs.
I tried following code and it did work in SoapUI but when i used it from Ant with ‘testRunner.sh’, it became useless. Looks like testRunner.sh ‘-e’ flag overrides everything…
GroovyScript Snippet:
def currentTestSuite = testRunner.testCase.getTestSuite()
log.info(currentTestSuite.getLabel())
def prj = currentTestSuite.getProject()
log.info(prj.getPath())
def iface = prj.getInterfaceByName(“InquireServiceHttpBinding”)
iface.changeEndpoint(“http://localhost/soap/oldEndpoint”,”http://localhost/soap/newEndpoint”)
Well, I’ve another idea of using my persistent properties file for the same cause… It would definitely work, but can you please give me some hint in code to SET endpoint on testStep level instead of CHANGING it on Interface level…
Awaiting Response…
Is it possible to use soapUI from java code? I mean, to use some soapUI jars?
I have about 80 webservices running and what i want to do is write a java servlet that constantly send and recieve soap messages to and from webservices – some sort of soapUI load test but the interface is accessed from the web browser.
I’ve managed to do that without soapUI, but its a lot of work to prepare a single servlet for a given webservice.
I’ve read about soapUI sources that have to be built with maven. I’ve started to play with it but i had to gave up because it took me too much time to make maven (really odd tool:) start compiling sources and i cant afford to play whit it any longer.
Maybe there are ready-to-use soapUI jars somewhere and I cant see them?? Please, help me.
Hey Pascal… I found out simple way of using multiple endpoints through use of external properties file to soapui project file and then using property expansion within suite. All this, without using any ‘-e’ flag with ‘testRunner.sh’ because I am having similar effect with property expansion within suite this time with multiple endpoints unlike ‘testRunner.sh’ ‘-e’ flag.
Thanks anyways… :)
@All:
Sorry I didn’t reply sooner to your questions, but I have been out for a while ( on a wel deserved holiday ;) )
@Pablo:
I haven’t tried that but it seems to me it must be possible. I know it is possible to run SoapUI projects with Maven, but based on your comment I guess you are not a big fan of Maven?? May be you should give it another try with Maven because I think it is a great ‘tool’, not only for this specific purpose but for your complete build/test and deploy cycle of your application.
@Tamoor:
I understand you have it working now?? This is also a thing I haven’t needed before but I am still learning this way :-)
@Sudhansu:
I would suggest to set up a load test as described in the Soap UI manual. If you run into any problem with that you can ask here if someone can help you with it.
@Niranjan:
I am not sure how to solve your problem. If you can’t use the multiple thread option somehow of SoapUI you might run several threads of Soap UI it self???
Otherwise it might be handier to build your own web service client so you have full control of it.
Folks,
Wonder if anyone has encountered a problem with NLS/Non Ascii Characters in the URL?
http://jacro12w2k3:9082/P303/S_VIEWS_IM_EX_ÃÑÑÖÏÑG_BeanService?wsdl
Regarding my post Time: 25 September 2008, 8:15 am
I’ve made it to run soapUI API and its really fun but poorly documented. I’ve searched all soapUI sourceforge forum and i havent found a way to set request values :( But i ll keep on trying.
Hi Pascal,
I have a query on data parametrization in SoapUI. I have a requirement where i need to use a unique values in the “Request” every time i execute the test case (as a part of Load Testing”. I tried adding the values in the “input-property file” and importing the values but the soapui system is loading only the one value from the entire file. is there any defined way of adding values in the input-property file before importing the values or is there any other better way/workaround for this?? could you pls help me in this.
Hi Pascal,
I have test cases where it it necessary to send a request, get a response and then base the next request on values from the response (e.g TransactionId).
So my question is … Is it possible to automatically via scripts or java to capture a response and use the data from the response to populate the data from the request.
@Sriram
@MP
You should both have a look at this post:
http://www.pascalalma.net/2007/07/11/another-common-issue-solved-with-soap-ui/
Both your problems should be answered by using the construction I showed their by combining properties with Groovy step and property transfers.
Hope this helps.
hello, i am stucked with a problem that, for load test if suppose i have 1000 requests to send in a 1 minute, after hitting this i am seeing among these 1000 only one 1 request is getting processed multiple times, plz help me how to proces all the requests in cerain limit.
can somebody let us klnow what are the protocols supported by SOAP UI
@Priya:
I found this in the user guide:
“Internally, soapUI abstracts the actual nature of projects and their contained interfaces, tests, etc… opening the possiblity of support for other service definitions or protocols than WSDL / SOAP (check out the com.eviware.soapui.model package). Currently though, the only implementation for these interfaces is for WSDL 1.1 and the SOAP/HTTP binding (as required by Basic Profile 1.0). Therefore, all actions and functionality described will be in regard to this implementation.”
Hi pascal ,
if i make a project in soap ui and test suites for it . can i run all the test suits at a time ??? for a same endpoint ….
Hi pascal ,
if i make a project in soap ui and test suites for it . can i run all the test suits at a time ??? for a same endpoint ….
Hi Prasad,
So I understand correctly: you want to execute all test suites at the same moment to test your service as if you have multiple clients calling the web service?
I would just run your test suite with multiple threads in a load test. Is that an option?
Hi Prasad,
So I understand correctly: you want to execute all test suites at the same moment to test your service as if you have multiple clients calling the web service?
I would just run your test suite with multiple threads in a load test. Is that an option?
Hi pascal ,
Thx for your reply , but actually let me put a question in a diff way .. i want to run all projects or multiple projects with each project having single test suite which covers the funcinality of that WSDL. Is this possible in a single click and to get the reports for all the projects separatley .
Hi pascal ,
Thx for your reply , but actually let me put a question in a diff way .. i want to run all projects or multiple projects with each project having single test suite which covers the funcinality of that WSDL. Is this possible in a single click and to get the reports for all the projects separatley .
Hi Pascal,
I have a query on Data Parameterization and template driven testing in SoapUI. I have written a groovy first script to import the data from external file and i was able to successfully import data into SoapUI from an external file. however i am stuck up with the second script where i am not sure how to transfer the imported value to the test case. Could you please help me with this.
Hi Pascal,
I have a query on Data Parameterization and template driven testing in SoapUI. I have written a groovy first script to import the data from external file and i was able to successfully import data into SoapUI from an external file. however i am stuck up with the second script where i am not sure how to transfer the imported value to the test case. Could you please help me with this.
Hi pascal,
I want to automate the steps done in Soap uI , i wanted to automatically collect the required data from database and want to place in the test case. and i should be able to loop it . so in just click i can execute test case for more than one data . I tried data source loop but there also you have to click number of times to execute all the steps plz help me out
Hi pascal,
I want to automate the steps done in Soap uI , i wanted to automatically collect the required data from database and want to place in the test case. and i should be able to loop it . so in just click i can execute test case for more than one data . I tried data source loop but there also you have to click number of times to execute all the steps plz help me out
Hey guys i just want to confirm tht whether we can make an xml file of soap-ui that will consist of both the request and the response
Currently i m getting an xml file that is containing the request and the wsdl
So can anyone help me in generating the xml file
Thanks in advance
Hey guys i just want to confirm tht whether we can make an xml file of soap-ui that will consist of both the request and the response
Currently i m getting an xml file that is containing the request and the wsdl
So can anyone help me in generating the xml file
Thanks in advance
Pingback: Using StAX with Spring WS | Redstream Blog
Pingback: Using StAX with Spring WS | Redstream Blog
Pingback: 'Error import WSDL' in SoapUI | Redstream Blog
Pingback: 'Error import WSDL' in SoapUI | Redstream Blog
Iam using SOAP UI for Performance Testing.Iam using an ssl certificateprovided by the client.Iam getting the response time sometimes,but sometimes iam getting an error message with javax.net.ssl.sslexception:Recieved fatal alert:Unexpected_message.Please help and provide a solution.