soapUI is such a specialized tool, which offers both a free as well as a pro version. The free version supports the testing web services with a lot of convenient functionalities.

Thanks to the standardization through web services, a tool such as soapUI can create the right requests for a service just by analyzing the provided WSDL of the service. SoapUI creates requests for each operation of the service. These requests are persisted in the soapUI project and they can be combined into a test suite. This allows them to be automatically executed, that is, they can be used together with continuous integration.

To perform this recipe, soapUI needs to be downloaded and installed. We can get it from here:
http://www.soapui.org.

In order to test the service from soapUI, we need to know the WSDL URL of the deployed proxy service.

The URL is constructed by the OSB at deployment time, based on the location of the OSB server (http://[OSBServer]:[Port]) and the endpoint URI specified in the proxy service (that is, /basic-osb-service/proxy/CustomerService). We need to concatenate the two and add the suffix ?wsdl to get the WSDL URL of the OSB proxy service:

http://localhost:7001/basic-osb-service/proxy/CustomerService?wsdl.

In soapUI, perform the following steps:

1. In the File menu, select New soapUI Project.

2. Enter the URL of the WSDL, for the service to be tested (http://localhost:7001/basic-osb-service/proxy/CustomerService?wsdl) into the Initial WSDL/WADL field.

3. Enter CustomerService into the Project Name field.

4. Click on the OK button.

SoapUI will analyze the WSDL and creates a project with some initial requests for all operations defined by the WSDL. Still in soapUI, perform the following steps:

5. Expand the project in the Navigator on the left.

6. Double-click on the Request 1 entry of the RetrieveCustomerByCriteria operation.


7. A new window for the Request 1 will open in the details section.

8. Replace the ? character in the request message on the left by the input parameter values for the test. The following screenshot shows the request with the ? characters replaced:


9. Click on the green arrow to start the test.

10. Check that a valid customer is returned in the response window on the right.

11. Save the soapUI project so that it is available to use later.

Validate that the response is correct


In soapUI, perform the following steps to validate the response from the proxy service against
the XML schema in the WSDL:

1. Right-click on the response message window and select Validate.

2. Either a pop-up window will appear indicating that the XML message is valid or the validation errors will be displayed in a window below the response message, as shown in the following screenshot:


Creating another request for the same operation


SoapUI supports more than one request per operation, so that a request can be created for each test case to be executed. It's recommended to properly name the different requests in order to be able to identify them later and to clearly indicate the case tested by a given request.

To rename a request, just right-click on the request and select Rename.

An existing request can also be cloned. This reduces the amount of work necessary to correctly set up all the information in the request message. To create a copy of a request, right-click on the request and select Clone Request.

To create a new request from scratch, right-click on the operation and select New request.

{ 1 comments... read them below or add one }

  1. Awesome, Thank You for giving me this of the sites which are easy to use and it is very easy way to access the block sites with the help of the proxies. Mp3lemon UK proxy

    ReplyDelete

About This Site

Howdy! My name is Suersh Rohan and I am the developer and maintainer of this blog. It mainly consists of my thoughts and opinions on the technologies I learn,use and develop with.
Powered by Blogger.

- Copyright © My Code Snapshots -Metrominimalist- Powered by Blogger - Designed by Suresh Rohan -