Public | Automated Build

Last pushed: 7 hours ago
Short Description
CARMIN_R2S (CARMIN Rest server to Soap server)
Full Description


CARMIN_R2S (CARMIN Rest server to Soap server) <img src="">

Assuming that your server is based on CARMIN rest (carmin.yaml in,
CARMIN_R2S module is used for translating the rest server to the soap server (api.wsdl,

Build from Source

For the moment, this tutorial is only tested on Ubuntu 14.04 TLS.


Ubuntu Dependencies

$ sudo apt-get install bison flex
$ sudo apt-get install libcurl4-gnutls-dev

This module is based on gsoap. Therefore we first download the source of

Try to download the version if it exists.

We don't propose to use the latest version of 2.8 since the license has been changed to GPL.

Extract into ~/local/sources

$ SOURCES=/root/local/sources
$ INSTALL_PREFIX=/root/local
$ mkdir -p $SOURCES
$ mkdir -p $INSTALL_PREFIX
$ unzip -d $SOURCES
$ cd $SOURCES/gsoap-2.7

Add the below codes in the beginning of the header file ./gsoap/stdsoap2.h


It is used for enabling the cookie module in gsoap.

$ ./configure --prefix=$INSTALL_PREFIX

you may miss some packages, please install them and re-run ./configure --prefix=$INSTALL_PREFIX.

$ make
$ make install

You can add your installed path bin in your PATH enviroment variable with ~/.bashrc

$ echo "export PATH=$INSTALL_PREFIX/bin:\$PATH" >> ~/.bashrc
$ echo "export LD_LIBRARY_PATH=$INSTALL_PREFIX/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc


$ SOURCES=/root/local/sources
$ INSTALL_PREFIX=/root/local

$ git clone ${SOURCES}/rapidjson
$ ln -s ${SOURCES}/rapidjson/include/rapidjson ${INSTALL_PREFIX}/include/


On ubuntu, you can install it via apt-get

$ apt-get install libcurl4-gnutls-dev
$ apt-get install libcurl4-openssl-dev

or built it from sources

$ SOURCES=/root/local/sources
$ INSTALL_PREFIX=/root/local

$ wget
$ tar -xvf curl-7.50.0-20160705.tar.gz
$ cd curl-7.50.0-20160705
$ ./configure --prefix=$INSTALL_PREFIX
$ make
$ make install

If you build libcurl from source, you have to modify TARGET_LINK_LIBRARIES as below in the CMakeLists.txt from the project CARMIN_R2S.



$ SOURCES=/root/local/sources
$ INSTALL_PREFIX=/root/local

$ git clone ${SOURCES}/CARMIN_R2S
$ cp CMakeLists.txt.origin CMakeLists.txt

Modify LOCAL_INSTALL_PREFIX's value as the gsoap and rapidjson location in CMakeLists.txt.

set(LOCAL_INSTALL_PREFIX "/root/local")
$ mkdir builds
$ cd builds
$ cmake ..
$ make

Hope there is no error during compilation.

If there is no error, you can start the server as below:

$ ${SOURCES}/CARMIN_R2S/builds/carmin_server ${SOURCES}/CARMIN_R2S/config_template/config_demo.ini

How to update the .h file from a .wsdl file

For example, you can start with a wsdl file for example api.wsdl.

The api.h file can be producced by the command below:

$ wsdl2h api.wsdl

By default, the wsdl2h will generate the function such as

int ns2__xxxxx(xxx xxxx, xxxx xxxx);

which has a prefix ns2__. This prefix could be changed by adding the below line in the file which called typemap.dat.

api = ""

typemap.dat can be found in the source of gSoap.

Put this file typemap.dat within the same directory of api.wsdl. You can generate the api.h again.

$ wsdl2h api.wsdl

Therefore all the prefixes will be changed as below:

int api_xxxxx(xxx xxxx, xxxx xxxx);

How to generate .cpp file

soapcpp2 -I/path/to/share/gsoap/import -S -x api.h
Docker Pull Command
Source Repository

Comments (0)