This sample uses SOAP web services to add new todo entries on the todo app system under test. You can read more about the Citrus SOAP features in reference guide


The todo-list sample application manages todo entries. The application provides a SOAP web service endpoint for adding new entries and listing all entries.

The sample tests show how to use this SOAP endpoint as a client. First we define the schema and a global namespace for the SOAP messages.

<citrus:schema-repository id="schemaRepository">
    <citrus:schema id="todoList" location="classpath:schema/TodoList.xsd"/>
  <citrus:namespace prefix="todo" uri=""/>

The schema repository hold all known schemas in this project. Citrus will automatically check the syntax rules for incoming messages then. Next we need a SOAP web service client component:

<citrus-ws:client id="todoListClient"
<bean id="messageFactory" class=""/>

The client connects to the web service endpoint on the system under test. In addition to that we define a SOAP message factory that is responsible for creating the SOAP envelope.

Now we can use the web service client in the Citrus test.

    .payload(new ClassPathResource("templates/addTodoEntryRequest.xml"));
    .payload(new ClassPathResource("templates/addTodoEntryResponse.xml"));

The Citrus test sends a request and validates the SOAP response message. The message payload is loaded from external file resources.


You can run the sample on your localhost in order to see Citrus in action. Read the instructions how to run the sample.