Java and J2EE Tutorials, Jsp and Servlet Tutorials, Spring MVC, Solr, XML, JSON Examples, Hibernate & Struts 2 Hello World projects



Thursday, 2 May 2013

Spring Web Services - Part 3 (Test Web Services without a Client Application)

Welcome to third and final part of Java Web Services using Spring tutorial series. Today we will discuss web services testing tools so that web services can be tested before developing a client application for them. In our previous tutorials on ‘Spring Web Services’ Series, we came to know What are Spring Web Services and how to create Spring Web Services. Till now we are done with creating a Spring Web Service that will save a user’s details in database. In this particular tutorial we will cover 4th and last step of Create Spring Web Services, we will test our Web Service and will coma to know ‘How to test a Web Service without using a client’.

The importance of web services testing tools is that we can test web services without using a client application and this makes web services development more easies and smart. Let’s starts with our 4th and final step, and see step by step testing procedure of a Web Service without using a client Application. There are a number of web services testing tools available, in our case we will use ‘Soap UI’ to test web services. All steps are listed below.

1)      Download SoapUI and install it to your machine as per the Documentation.
2)      Run your Web Service application on server and get the wsdl url.
3)      Run SoapUI and setup quick project with required WSDL URL.
4)      See and verify the output on SoapUI dashboard.

Now see the detailed explanation step by step :

1) Download SoapUI and install it to your machine as per the Documentation.

Soap UI is a functional testing tool it enables to test Web Services on the fly without requiring a Client application. It comes in two forms Commercial and Trial. If you guys are learner than try its free edition and install in your machine. Download and Installation is simple in case of trouble see the documentation.

2) Run your Web Service application on server and get the wsdl url.

Till now we are done with SopaUI installation process, now run your Web Services Application on server. From step 3 of previous tutorial we have seen the Welcome page as follows :


Here we can see two links, these links represents two services lets test for GetUser Service , just click on ‘GetUserSrrvice.wsdl’. You will see a WSDL as shown in the figure below.



Keep the application running on Server and copy the url, in our case http://localhost:8080/spring-server-final/endpoints/GetUserService.wsdl


3) Run SoapUI and setup quick project with required WSDL URL.

Go to your Programs and run SoapUI from there, you will see a welcome screen something like :



Click on File>New Soap UI Project , you will get a project setup wizard something like this, give a name to the project and pase WSDL url that was copied in step 3 to Initial WSDL. Click Ok to finish.


4) See and verify the output on SoapUI dashboard.

You will see your project listed at left side under ‘Projects’ menu, expand the project hierarchy and click on ‘request’ . A request screen will open as shown in the figure below.



Now enter the required value and click on green button at upper-left corner to see the response. Here request part is displayed at left side and its response is displayed at right window.



This way we are done with a short introduction to web services testing tools and how to test spring web services without using a client application. In next blogs we will discuss other topics on web services development and will create a Client application in Spring MVC.










Thanks for reading !
Being Java Guys Team



4 comments:

  1. please correct a minor spelling mistake..it 'come' and not 'coma'..thanks..

    ReplyDelete
  2. nice web services article ... could please post the web services with Client application

    ReplyDelete
  3. I would be very interested in hearing your comparison to SOAPSonar http://www.crosschecknet.ca/soapsonar-introduction-series-2-functional-testing/

    ReplyDelete
  4. I have the error I ws.server.EndpointNotFound. some solution?

    ReplyDelete

Search Tutorials
Like Us on Facebook

Like Us On Google+