To automatically add #import "wsse.h" to the header file created by wsdl2h, if it does not already exist (wsdl2h detects WS-Security requirements with WS-Policy), first modify typemap.dat to include these three lines:
[ #import "wsse.h" ]
Then (assuming C ++):
- run
wsdl2h -Iimport -o service.h <your-wsdls-xsds-etc> and make sure wsdl2h uses the modified typemap.dat (if it is in the current directory where OK is located) and the import option points to the gsoap import directory from wsse.h - run
soapcpp2 service.h - compile the generated
soapC.cpp , soapClient.cpp (if the client), soapServer.cpp (if the server), stdsoap2.cpp , dom.cpp , plugin/wsseapi.c , plugin/smdevp.c , plugin/mecevp.c - when compiling the above, you should use
-DWITH_OPENSSL -DWITH_DOM - link to
-lssl and -lcrypto - to enable HTTP compression, compile with
-DWITH_GZIP and associate with -lz
When compiling in C, do all of the above, but use the wsdl2h -c option and use the .c files.
See the WSSE documentation, as well as the gsoap/samples/wssedemo in the gsoap package, which shows API calls for using WS-Security in several possible ways, tells you how to register a plugin, etc.
Dr. Alex RE
source share