How To Create a Web Service
In Less Then 5 Minutes?

How can I set up Web Services?

You can easily set up new web services in less then 5 minutes. Actually DataMinder has a web service installed in the default Runnables configuration delivered with DataMinder for you to start with.

It is a very simple Web Service that returns JSON data imported from a file.

Set up your own Web Service

To set up a web service you just need to:

  1. Add a "HTTP Web service" to runnables in case you don't already have one
  2. Create a process that does something e.g. returns a user list.
  3. Add a Listener to the process that listen to any HTTP Web Service calls to the chosen path e.g. /GetUsers

When Should I use Web Services?

When you want to hide complex processes and complex systems behind a well defined simple API. Then Web Services provide great possibilities.

You just make available a number of URLs, as part of a web based API, where others can call your system in a well defined way. They can call from a web browser or from other systems making explicit HTTP/S calls. The data used to move information is JSON which is simple and easy data format to work with.

Simple Web Service Example

Here we can imagine we have a need to expose some part of our user management to other systems. It may be a web application showing user data or it may be other systems updating user data e.g. when new customers sign up we store them in a backend database.

The advantage of above design is that we can easily build reusable business logic in DataMinder by grouping processes and Drag’n’Drop plugins into process. We can quickly set up a Web Service API interface allowing others to start developing with it.

We have also managed to hide all complexities of business process by a rather simple API.

Back to top

Demo Web Service

The default configuration contains a demo web service at: http://127.0.0.1:9080/GetUsers

The port is the web service http port set during DataMinder installation. There is HTTPS port too. The returned JSON looks like.

{
"columns":["FirstName","LastName"]
,
"data":[
["Alice","Hill"]
,["Bob","King"]
,["Anne","Hart"]
,["Joe","Sims"]
,["Ieo","Bass"]
,["Jane","Riley"]
,["Linda","Sutton"]
,["Larry","Davis"]
,["Mary","Blake"]
,["Jack","Holt"]
,["Gustaf","Dalén"]
,["Åsa","Sjöström"]
]
,
"results":[
{"index":"1","objectType":"Task","objectName":"{INSTALL_DIR_ROOT}\/testdata\/csv\/users.csv","objectId":"8J","result":{"status":"OK","info":""}},
{"index":"2","objectType":"Task","objectName":"FirstName,LastName","objectId":"8V","result":{"status":"OK","info":""}},
{"index":"3","objectType":"Process","objectName":"Get users web service","objectId":"8H","result":{"status":"OK","info":""}}]}
  

You can easily parse the data on a web client or parse it on some other system. Please see references at the end of this page for tools to help you with that.

Secure connection

You can set up the web service to only answer to HTTPS and require password to be accessed. To make sure only authenticated and authorized users/services are allowed access.

Build your own plugins

If you need to build custom plugins to implement your use cases you can get started in 5 minutes. For more information how please see DataMinder Help Plugin Development (also accessible from the main Support page).

Useful Links and Resources

Web Services

JSON

Java Tools

JavaScript Tools

When calling web services asynchronously from a web page.

Back to top
Email:   Address: LucidArt AB Visby Sweden