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 (e.g. HTTP, JMS, etc.), or emulating a server that responds with XML over HTTP.
To generate a set of new tests using a schema:
- Select the Test Suite: Functional Tests node from the previous exercises and click the Add Test Suite button.
- In the Add Test Suite wizard, expand the SOA node, select XML Schema, and click the Next button.
- In the XML Schema dialog, browse to the schema.xsd file that is included in the SOAtest examples/xsd directory.
- Select Generate Messaging Clients to send plain XML messages.
http://localhost:8080/parabank/echo.jspin 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 the Next button. A list of elements that are defined in the schema (directly, as well as indirectly via imports) displays. If you select one or more of these elements, a Messaging Client test will be generated for each selected element.
- Select all elements.
- Click the Finish button. 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, then choose Add New> Test.
- Select Standard Test on the left, select Messaging Client on the right, then click Finish.
- In the Messaging Client editor that opens, go to the Request tab and change the Input Mode to Literal.
- Enter the message
- Go to the Transport tab and enter
http://localhost:8080/parabank/echo.jspunder 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.