This example demonstrates how to start a process via a SOAP webservice-server generated using CXF in a Spring application.
The example BPMN 2.0 process is triggered by a SOAP call. The SOAP webservice-server starts the process by submitting a start form.
- BPMN source code
- WSDL / XSD webservice definition
- Spring context
- BankAccountService and BankService services
- beans.xml and engine.xml
- JUnit tests
The webservice bindings are generated using the maven plugin cxf-codegen-plugin. The Camunda engine is configured via Spring.
The webservice context is loaded from beans.xml, including two services:
BankAccountService- SOAP endpoint server.BankService- spring service, performing some logging. i.e. dummy service.
The BankAccountService endpoint is secured in two ways
- Basic Authentication
- SOAP header containing secret value
The BPMN 2.0 process is started with two variables:
accountNumber- account number targeted by the operationaccountName- name which is to be set on the account
A custom validator makes sure the accountNumber value consists only of digits.
The SOAP request consists of a SetAccountNameRequest body and BankRequestHeader header. It starts the process using FormService.submitStartForm(..).
As the process service task executes, it invokes setAccountName(..) on the BankService Spring service, performing a logging statement.
The BankAccountService service translates start node form-validation exceptions to SOAP faults. The SOAP fault contains information on which field failed to validate.
- Checkout the project with Git
- Read and run the JUnit tests
- Build with maven and deploy .war file.
- Access the WDSL using credentials 'user'/'password' using for example SoapUI.
