If you have any question left, please drop a note with the discussion link of this page.

Little tutorial for SoapUI and the zanox webservices

From Wiki.zanox.com

Jump to: navigation, search

With Soap UI you can retrieve extremly fast your first responses from the zanox web services. It is a very good tool, to test your soap envelops and to inspect the response. Use it before you start programming in your favourite language and you will reduce your build time a lot. You can copy and paste the requests and responses and build your own application on them. Here is a little tutorial on how to use SoapUI especially for the zanox webservices. Try and relieve your developement time.

Contents

Installing and Running SoapUI

As SoapUI is completly written in JAVA you can use it on nearly any platform. First download SoapUI from http://www.soapui.org/ (∼25MB) and unzip it.

SoapIU 2.5 Beta 1 main folder

Now open a console window (Terminal on MAC, Bash or any other on Linux, or run command cmd on Windows), go to the path where you downloaded SoapUI to (cd /path/to/soapui-2.5-beta1) and run the included installation script bin\soapui.bat (for Windows platforms) or bin/soapui .sh for linux/unix-based platforms (including e.g. MacOS X)

Notes

  • You will need Java in your path.
  • On UNIX-based platforms you may first need to make the script executable. Run chmod a+x soapui.sh in the terminal.
  • On Mac OS X you can run commands using sudo and a dot-slash-construction: sudo ./soapui.sh

Alternatively you can also double click on the file lib/soapui.jnlp but this is not recommended. While the script runs SoapUI user interface opens and you are ready to start. You should now see a screen like this:

SoapUI start screen

Getting Started

The first thing to do now, is to start a new project. Go to the Menu and click "File", there select "New SoapUI Project". Alternativly press your command key and N. Enter the information on how to name your project and provide the link to the zanox webservice WSDL: http://api.zanox.com/wsdl. Make sure that you check "Create sample requests for all operations".

Creating a new project in SoapUI

Press OK and see SoapUI working and downloading all needed information from the zanox Web Services. Now you should see all possible zanox Web Services listed on the left pane:

SoapUI left pane displaying all possible zanox Web Services

So let's start making our first request!

Request without authorization

Go to the entry SearchProducts and click on the little plus sign. Now double click on "Request 1". This is the automatically created sample request SoapUI created during defining the new project and checking the checkbox "Create sample requests" (see above). An new inline window opens and shows a non-filled but ready build soap envelope:

Non-filled but ready build soap envelope in SoapUI

Now start filling in the needed information. Delete the question-marks and fill in your own data. Items named optional may be left out. But for completeness I will fill all items in this example. Now, start your first request by clicking on the green arrow on the top left corner of your request-window.

Filled soap envelope in SoapUI

SoapUI connects now with the zanox Web Service and displays on the right hand side of your request window the result of your product search:

Result of a zanox Web Services product search in SoapUI

You may now inspect the structure of the result xml and start building your application with this information.

Request with authorization

The process for making request wich require authorization is as simple as the one without, but you have to fill in the right date and signature. The signature cann not be calculated by SoapUI of course, but you may use this service for quickly get to your signature for testing purposes. As an example I will show an request with authorization for the GetAdspace method. Click on little plus nearby "GetAdspaces" and double click on "Request 1". Now you have to fill in a timestamp, your applicationID and the signature. To calculate the signature for SOAP-Request have a look at SOAP_API_authentication. To calculate the signature for REST-Request have a look at RESTful_API_authentication. If you don't have coded a signature-calculating-routine yet, or want to verify your signature you may use the ClearClicks Signature Tool.

Now fill in the data you have calculated or copy and paste it from the ClearClicks Signature Tool. Click again on the the green arrow (top left corner) and your done!

Authorized zanox Web Service request in SoapUI

Personal tools