Parasoft SOAtest can be used to test POX (Plain Old XML) services that are not necessarily SOAP web services. Many legacy system integration initiatives have relied on plain XML messaging, or sometimes plain XML is preferred over SOAP web services for performance reasons to reduce complexity. If a schema for the XML messages is available, tests can be generated automatically by SOAtest, without the need to provide sample XML messages.
Parasoft SOAtest support for plain XML services includes emulating a client that sends XML over one of the supported protocols and APIs (for example. HTTP, JMS, and so on), or emulating a server that responds with XML over HTTP.
To generate a set of new tests using a schema:
- Click the Test Suite: Functional Tests node from the previous exercises and click Add Test Suite on the tool bar.
- In the Add Test Suite wizard, expand the SOA node, choose XML Schema, and click Next.
- In the XML Schema dialog, browse to the schema.xsd file that is included in the SOAtest
examples/xsd
directory. - Choose Generate Messaging Clients to send plain XML messages.
- Enter
http://localhost:8080/parabank/echo.jsp
in the Endpoint field. This specifies where XML messages are sent. This field could be left blank if you wanted to use another protocol or if you wanted to provide the URL later. - Click Next. A list of elements that are defined in the schema (directly, as well as indirectly via imports) is shown. If you select one or more of these elements, a Messaging Client test will be generated for each selected element.
- Select all elements.
- Click Finish. Three tests will be created.
Testing Plain XML Services When a Schema is Not Available
If no XML schema is available, you can still test plain XML services given an XML message.
- Right-click the test suite created above and choose Add New > Test.
- Click Standard Test on the left and Messaging Client on the right, then click Finish.
- In the Messaging Client editor that opens, click the Request tab and change the Input Mode to Literal.
- Enter the message
Hello, world!
- Click the Transport tab and enter
http://localhost:8080/parabank/echo.jsp
under Router Endpoint. - Save the Messaging Client.
- Run the Messaging Client.
- Expand the Messaging Client node, then double-click the Traffic Viewer node that is chained to the Messaging Client.
- Note that the Response tab shows that "Hello, world!" was returned as a response.