Websydian v6.1 online documentationOnline documentation - WebsydianExpress v3.0

Service Request Test Tool

Introduction

This document describes a very simple test tool for http-based services.

Where normal web applications can be tested using a browser, service requests can't be generated by the browser and in many cases, the browser will not be able to handle the response from the service.

This means that when you want to test for instance a service where you send a file to the application which then replies with another file, you will have to build an application that can act as an http-client.

As such a test application is not that easy to create, we have chosen to make the very basic tool we use for this purpose available for our customers.

Disclaimer

The tool is delivered as-is. It is not part of the supported product.

While we are of course interested in hearing about errors and improvement proposals, we don't guarantee that the errors or proposals will be handled.

The tool does not handle redirection (http-status 3xx).

Obtaining the tool

The tool is available in the download section of the Websydian homepage.

Go to www.websydian.com and use the "I need an account" link at the top of the page to enter the user registration page.

Register your user information and log in to the site.

Go to the download page and download the http-client test tool.

Using the tool

The basic functionality of the tool is extremely simple, you specify the server you want to connect to, the method you want to use for connecting to the server, the data you want to send to the server and the http-headers you want to send for the request.

Calling the tool

The tool is started by calling the AAvF.EXE program.

This opens the following panel - with the values shown pre-filled:

Server information

The fields Internet ServerName, Port, and URL are used to specify the server you want to call.

Internet ServerName

This is the part of the URL that specifies the server name of the server you want to call.

In a URL, this is the part immediately following "http://".

For example:

http://www.websydian.com/wsyweb20/site/websydian

http://localhost:8090/express30/site/basicsite

Port

This is the port you want to access the server on.

In a URL, the server name can be followed by a colon - which is then followed by the port number.

Note that if no port is specified in a URL, the default port when the URL starts with http:// is 80, when the URL starts with https://, the default port is 443.

For example:

http://www.websydian.com/wsyweb20/site/websydian - specify 80

http://localhost:8090/express30/site/basicsite

URL

The URL field should be filled with the remainder of the URL.

For example:

http://www.websydian.com/wsyweb20/site/websydian

http://localhost:8090/express30/site/basicsite

Http-parameters

HTTP-Version

This specifies which HTTP-version you are using

Unless otherwise specified by the service provider, you should keep the default value (HTTP/1.1).

The entered value must conform to the format described by the HTTP standard:

HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT

Method

The HTTP-standard describes the methods POST and GET.

The GET method is a request that the application returns some information (e.g. a HTML page) that is identified by the URL request.

The POST method transfers some information (e.g. a SOAP request file) to the application, who then can return some information (e.g. a SOAP response file).

You must specify the Method expected by the server or by the service provider will not be able to handle the request.

For most service requests POST will be the correct Method, but there are some cases where you send a URL-encoded request to the application, in this case you should specify GET.

Use SSL

Specifies whether SSL should be used for calling the server.

Http headers

The table in the upper right hand corner specifies which http-headers you want to send to the server.

The values are specified as name/value pairs.

The following example shows an example of the headers you would normally specify for a SOAP-request:

Note that the Content-type header has been changed, as the content is xml, not html - and the character set of the request document has been specified.

The SOAPAction header that is specified by the SOAP standard has been added to the table together with the (fictive) value that specifies a specific SOAP-operation.

Files

Request filename

When testing a service, the most common case is that you want to send a file to a service.

Specify the path and filename in this field.

Response filename

By entering a filename in this field, you specify that you want to save the data content of the response to the file.

Specify the path and filename in this field.

If the file does not exist, it will be created (if the folder exists).

If the file already exists, it will be overwritten (without warnings).

Additional request information

Request String

In some cases you want to send more information as part of the URL (typically in GET situations). When this is the case, you can specify the remaining information here.

So if you for example need to send the following URL:

http://www.websydian.com/express30/site/basicsite?PARM1=ABC&PARM2=DEF

You would specify:

?PARM1=ABC&PARM2=DEF

In the Request String field.

Response fields

The two text boxes in the bottom part of the tool shows the information that is returned by the service.

HTTP Status

This shows the HTTP status returned by the server.

The normal HTTP status for success is 200, but any code starting with 2 can be interpreted as varying degrees of success.

Headers

In this text area, the full set of http-headers returned by the server is shown.

Response

If you have not specified a Response file, the data content of the response will be shown in this text area.

If you have specified a response file, nothing will be shown in this text area.

Example

This screen-shot shows the call of a service that is provided on the URL:

http://localhost:8090/express30/site/basicsiteservice/file

The Http-Method is set to POST - the data content of the request is taken from the file: c:\temp\testout.xml.

The Content-type header has been changed to text/xml;charset=utf-8, and a SOAPAction header has been specified with the value: "http://www.websydian.com/MyAction".

The service is called by pressing "Execute".

The response will be shown as follows:

The HTTP Status 200 indicates that the call was successful.

The headers are shown in the Headers box.

The response document is shown in the Response box (as no response file was specified).

More information

External link: The HTTP standard

Background: Handling service requests