Information Technology Reference
In-Depth Information
Web service addition
One very common request that most companies have due to internal policies is to provide a
SOAP-based web service interface to interact with the BPM system. The KIE Workbench
provides a RESTful interface by default, mainly because it can be accessed through web
service clients as well as from other tools, such as JavaScript client APIs or mobile devices.
Adding a SOAP-based web service, however, is far simpler than it would seem.
In the code bundle of this chapter, there is a project called
web-service-module
. In-
side this project, you will find the definition for a simple web service. It uses a rather
simple interface, which, for the simplicity of demonstration, only exposes two important
methods: the
startProcess
and
signalEvent
methods of the KIE session. It defines
a JAX-WS-based web service that will interact directly with a runtime engine (specified by
the release ID passed as a parameter to the web service invocations).
Its configuration is rather simple. To have it added to our KIE Workbench, we need to do
the following two things:
1. Add the compiled JAR file from the
web-service-module
project to the
lib
folder under
WEB-INF
of the KIE Workbench.
2. Add the corresponding servlet mapping to the
WEB-INF/web.xml
file of the
KIE Workbench:
<servlet>
<display-name>rmWebService</display-name>
<servlet-name>rmWebService</servlet-name>
<servlet-class>com.wordpress.marianbuenosayres.service.RuntimeManagerWebService</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>rmWebService</servlet-name>
<url-pattern>
/RuntimeManagerWebServiceImpl
</url-pattern>
</servlet-mapping>
Once that configuration is added to the application, we will have the web service exposing
our internal services. As the web service is going to look for any runtime manager con-