How can we implement WSSE plugin for Gsoap in C++/Linux ? This link doesn't give all the information.
The problem is what do I have to include in my header file generated by WSDL , to make it wsse compatible so that soapcpp2 header.h generates sufficient code so that I can compile wsseapi.c successfully ?
Also ,if possible please provide working sample code(C++ only , no C plz) which implements wsse plugin?
To automatically add an #import "wsse.h"
to the wsdl2h-generated header file if it is not already there (wsdl2h detects WS-Security requirements with WS-Policy), then first modify typemap.dat
to include these three lines:
[
#import "wsse.h"
]
Then (assuming C++):
wsdl2h -Iimport -o service.h <your-wsdls-xsds-etc>
and make sure wsdl2h uses the modified typemap.dat
(if it is in the current dir you are OK) and the import option points to the gsoap import
directory with wsse.h
soapcpp2 service.h
soapC.cpp
, soapClient.cpp
(if client), soapServer.cpp
(if server), stdsoap2.cpp
, dom.cpp
, plugin/wsseapi.c
, plugin/smdevp.c
, plugin/mecevp.c
-DWITH_OPENSSL
-DWITH_DOM
-lssl
and -lcrypto
-DWITH_GZIP
and link with -lz
When compiling in C, do all of the above but use wsdl2h option -c
and use the .c files.
See the WSSE documentation and also the gsoap/samples/wssedemo
example in the gsoap package, which shows the API calls to use WS-Security in several possible ways, tells you how to register the plugin etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With