soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with...

16
soapUI Client Testing eCRV Web Services with soapUI Revision Status Index Rev. Date Description Prepared 1 9/20/2012 First edition soapUI-x32-4.0.1 eCRV Development Team 2 3/8/2013 Added notes on where to find other wsdls eCRV Development Team 3 9/19/2014 Recommend soapUI version 5 eCRV Development Team

Transcript of soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with...

Page 1: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

soapUI Client Testing eCRV Web Services with soapUI

Revision Status Index

Rev. Date Description Prepared

1 9/20/2012 First edition – soapUI-x32-4.0.1 eCRV Development Team

2 3/8/2013 Added notes on where to find other wsdl’s eCRV Development Team

3 9/19/2014 Recommend soapUI version 5 eCRV Development Team

Page 2: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

1 | P a g e

CONTENTS

Preface ........................................................................................................................................................................... 2

What is soapUI? ......................................................................................................................................................... 2

soapUI Tutorial .............................................................................................................................................................. 3

Page 3: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

2 | P a g e

PREFACE

WHAT IS SOAPUI?

soapUI is an open source web service testing tool for service-oriented architectures (SOA). Its functionality covers web service inspection, invoking, development, simulation and mocking, and functional, load and compliance testing.

To learn more about soapUI visit http://www.soapui.org/about-soapui/what-is-soapui.html.

We recommend that you download and install the version, 5.0.0, for your testing purposes at this time:

http://sourceforge.net/projects/soapui/files/soapui/5.0.0/

Click the link Download SoapUI-x32-5.0.0.exe will automatically start the process. When a dialog bar appears in the bottom of the download page, click Run button to run it or Save button to save SoapUI-x32-5.0.0.exe file and run it by double-clicking on the saved file. You'll see the following starting screen. Click Next to continue. A setup wizard will walk you through the SoapUI 5.0.0 installation.

SOAPUI TUTORIAL

Below is the initial screen of the soapUI application. To create a new project, right click on Projects in the Navigator pane and select New Soap Project from the menu as shown in Figure 1.

Page 4: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

3 | P a g e

Figure 1

A new project dialog box appears, requesting a project name and a Web Services Description Language (wsdl) location along with other options as shown in Figure 2. You may assign it any project name you like - for this tutorial, which will be testing our eCRV sandbox, we will enter “eCRV Sandbox DownloadService” for the project name. Paste in, or browse to, the wsdl location you wish to access – in this case, we will be requesting data from the wsdl located at https://www.dortest.mdor.state.mn.us/ecrv_ws/services/DownloadService.wsdl. Verify that the Create Requests box is checked and click OK. To use a different region or wsdl for testing please refer to the API documentation or the web service home page for the URL to the wsdl.

Figure 2

Page 5: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

4 | P a g e

The soap project is now created and you should have a project structure similar to that shown in Figure 3 (expand the Projects tree structure by clicking the + in front of the Download operation to see Request 1). At this point, we have a sample request (Request 1) for each Download operation ( Download or DownloadPar).

Figure 3

The next step is to set up the authentication piece of the request. To access the security configuration, right click the project name and click the Show Project View menu option as displayed in Figure 3.

Page 6: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

5 | P a g e

On selection, you will see the project view with the tabs Overview, TestSuites, WS-Security Configurations and Security Scan Defaults as shown in Figure 4.

Figure 4

Page 7: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

6 | P a g e

Click on the WS-Security Configurations tab to access the security settings. On the sub-tab Outgoing WS-Security Configurations, click the plus sign icon just beneath the sub-tab name to add a new outgoing WSS (Web Services Security) configuration (circled and highlighted in Figure 5).

Figure 5

A dialog box should appear, requesting a unique configuration name – we entered “eCRV security” for this example (Figure 6).

Figure 6

Page 8: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

7 | P a g e

After you have created your configuration entry, you will need to add WSS entries for timestamp and username. To add a WSS Entry, click the plus sign icon highlighted in Figure 7.

Figure 7

When asked for the type of entry to be added, click the drop-down arrow on the right of the entry box, select a type (we will choose to add a timestamp entry first, Figure 8) and click OK.

Figure 8

Page 9: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

8 | P a g e

Your timestamp entry is now available to be configured. Enter a value in the Time To Live entry which will specify how long this message will be valid - we entered 300 seconds for this example. This means that if our request needs more than 5 minutes (300 seconds) to retrieve our eCRV(s), parameters will need to be changed to complete the process successfully.

Figure 9

Now add another WSS Entry, this time selecting Username for the type (Figure 10), then click OK .

Figure 10

Page 10: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

9 | P a g e

As requested, enter your eCRV user ID and password (hidden by placeholder dots in the box). Verify that the Add Nonce box is checked (necessary for security purposes), uncheck the Add Created box (click in box) and select PasswordText for the password type (Figure 11 shows these tasks completed).

Figure 11

Page 11: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

10 | P a g e

Next, right click on Request 1 of Download in the project tree and click the Show Request Editor menu (Figure 12).

Figure 12

This displays the actual request text (Figure 13) in the request editor. We can now proceed to establish an authentication configuration and modify this request text to meet our needs.

Figure 13

Page 12: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

First, we will assign eCRV security, the outgoing security configuration we configured earlier (Figures 5 – 11), to this request. On opening Request 1 in the editor (Figure 13), you may need to maximize the editor window, making the tab names near the bottom visible. Click on the first tab, named Auth. If “No Authorization” is displayed, change it to “Add New Authorization” from the drop-down list (see Figure 14). A dialog box should appear (see Figure 15). Click OK button.

Figure 14

Figure 15

11 | P a g e

Page 13: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

12 | P a g e

Figure 16

The Auth tab gives you the option to select an Outgoing WSS configuration from a list of existing configurations produced by clicking the drop-down arrow on the right of the box (Figure 16) – we’ll select the configuration we created earlier, eCRV security.

Now, we need to modify the actual XML body of our request (Request 1 of Download) to contain a valid type and CrvId. Locate the following line of code in your request editor window:

<dow:CrvId type="?">?</dow:CrvId>

The type refers to the version of an eCRV you wish to retrieve. Valid types are:

O C M S

- Original - County - Municipality/City- State

Page 14: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

13 | P a g e

If we want to get information from the County version of an eCRV, as we will do in our example, the first ? in the line of XML code will be replaced (simply edit in the editor window as you would any text file) with a C (MUST use capital letters, since case-sensitive) as follows:

<dow:CrvId type="C">?</dow:CrvId>

To enter a valid CrvID, the second ? (between the > < signs) will be replaced with a legitimate eCRV ID #, such as 2539 in our example. The xml code line now reads as follows:

<dow:CrvId type="C">2539</dow:CrvId>

Your completely modified request should look similar to that shown in the left pane of the request editor below (Figure 17).

Figure 17

This completes the creation of a simple Web Services request which may be used to retrieve information from a specific version (designated by the “type” supplied) of one specific eCRV (designated by the eCRV ID # supplied) via the soapUI client.

If you click on the green play button (circled and highlighted in Figure 17), you will receive your results as displayed in the right pane of the request editor (Figure 17).

Page 15: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

14 | P a g e

If the requested eCRV does not exist, this response will contain an error similar to that shown in Figure 18. To review, the left side of the request (Request 1) pane displays highlighted code requesting the County version of the eCRV with an ID of 1. The right side of the request pane shows the error message returned if not found.

Figure 18

To retrieve information from multiple eCRVs in one request (up to 100 at a time), simply copy the single line of XML code we edited in our example (<dow:CrvId type="?">?</dow:CrvId>), and enter the type and ID for each new eCRV requested, 1 per copied line as shown below.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dow="http://schemas.ecrv.mdor.state.mn.us/downloadService"> <soapenv:Header/> <soapenv:Body> <dow:DownloadRequest> <!--1 to 100 repetitions:--> <dow:CrvId type="C">2536</dow:CrvId> <dow:CrvId type="C">2537</dow:CrvId> <dow:CrvId type="C">2538</dow:CrvId> <dow:CrvId type="C">2539</dow:CrvId> </dow:DownloadRequest> </soapenv:Body> </soapenv:Envelope>

Page 16: soapUI Client - dortest.mdor.state.mn.us€¦ · soapUI Client Testing eCRV Web Services with soapUI Revision Status Index . Rev. Date Description Prepared . 1 9/20/2012 First edition

15 | P a g e

Finally, remember to save your project. To do so, right click on the project (eCRV Sandbox DownloadService in our example) and click the Save Project As menu option (Figure 19).

Figure 19

Click the Save button at the bottom of the pop-up dialog box (Figure 20). By accepting the values provided in the Save In, File Name and Files of Type fields, your project will automatically open the next time you open soapUI.

Figure 20