This sample uses SOAP web services with WSAddressing SOAP header elements. Clients must use proper addressing header elements.
You can read more about the Citrus SOAP features in reference guide
The sample project uses WSAddressing feature for requests sent to sample SOAP server. The Citrus SOAP web service
server endpoint validates incoming requests and expects WSAddressing headers to be present in all requests.
First of all we add the WSAddressing header conversion to the client component.
The client message converter automatically adds WSAddressing headers to the SOAP header. The resulting request look as follows.
The WSAddressing information goes to the header section and contains several elements. One of the elements is marked as SOAP-ENV:mustUnderstand.
The server component has to add the SOAP-ENV:mustUnderstand handling explicitly in order to support the incoming WSAddressing headers:
The server is now ready to receive the request and validate the WSAddressing header information.
We do this by adding the complete SOAP header as expected XML structure. The header information is loaded from external file resource.
Citrus automatically performs XML comparison and validation on all header elements. As you can see we ignore the MessageID element with @ignore@. This is
simply because this is a generated UUID value that is newly generated on the client side for each request.
In general we can overwrite WSAddressing header information in each send operation by setting the special WSAddressing message headers.
The sample application uses Maven as build tool. So you can compile, package and test the
sample with Maven.
mvn clean install
This executes the complete Maven build lifecycle. During the build you will see Citrus performing some integration tests.
Execute all Citrus tests by calling
You can also pick a single test by calling
mvn integration-test -Ptest=TodoListIT
You should see Citrus performing several tests with lots of debugging output.
And of course green tests at the very end of the build.
Of course you can also start the Citrus tests from your favorite IDE.
Just start the Citrus test using the TestNG IDE integration in IntelliJ, Eclipse or Netbeans.