【发布时间】:2012-05-16 10:32:41
【问题描述】:
在 linux 系统上,我想使用 gSOAP-2.8.8 创建一个客户端应用程序,该应用程序与基于 WCF 的 SOAP 服务进行交互。因此,我经历了以下:
wsdl2h -t typemap.dat -o myService.h myService.wsdl
soapcpp2 -Igsoap/import -CLix myService.h
并将 wsseapi.h 中的“#include soapH.h”替换为 wsseapi.h 中提到的 soapcpp2 生成的 soapH.h
然后,关键步骤是手动将以下几行添加到 myService.h
#import "wsse.h"
struct SOAP_ENV__Header"
{
mustUnderstand // must be understood by receiver
_wsse__Security *wsse__Security; ///< TODO: Check element type (imported type)
};
...并像
这样编译这些文件g++ -DWITH_DOM -DWITH_OPENSSL -Igsoap -Igsoap/import -Igsoap/plugin -o test \
myService.cpp soapC.cpp soapmyServiceProxy.cpp gsoap/stdsoap2.cpp gsoap/dom.cpp \
gsoap/custom/duration.c gsoap/plugin/wsseapi.cpp gsoap/plugin/smdevp.c gsoap/plugin/mecevp.c \
-L/usr/lib -lssl -lcrypt
我确实获得了所有源的目标文件;-) 但在链接阶段仍然出现两个错误。
soapC.cpp:203: undefined reference to `soap_in_ns4__duration(soap*, char const*, long long*, char const*)'
soapC.cpp:676: undefined reference to `soap_in_ns4__duration(soap*, char const*, long long*, char const*)'
编辑:作为一种解决方法,我目前将 soap_in_ns4__duration() 替换为 soap_in_xsd__duration(),它在 custom/duration.c 中实现
尽管如此,谁能给我提示这里出了什么问题?!提前致谢
【问题讨论】:
标签: ws-security gsoap