2
在Linux系統上,我想使用gSOAP-2.8.8創建客戶端應用程序,該應用程序與基於WCF的SOAP服務構建進行交互。因此,我通過以下去:無法使用WS-Security支持編譯gSOAP(即wsse-plugin)
wsdl2h -t typemap.dat -o myService.h myService.wsdl
soapcpp2 -Igsoap/import -CLix myService.h
而在wsseapi.h與soapcpp2生成soapH.h如wsseapi.h提到
然後,關鍵的步驟 '的#include 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(),這是在自定義的實現/ duration.c
然而,任何人都可以給我一個提示怎麼回事這裏錯了嗎?!在此先感謝
我沒有明白你的意思,我已經包含了soapmyServiceProxy.h,它又包含soapH.h 那麼,這應該如何幫助? – user696597
對不起,我沒有意識到,但包括你也得到這個錯誤意味着它的一些事情來處理頭文件和你調用方法的方式。當我開始使用gsoap 2.8.8時,我遇到了類似的問題,我可以修復它,所以如果你能提供一些你正在做的細節代碼,我可以嘗試修復它。我知道很難解決這些問題,我在這方面掙扎很多。請提供詳細的代碼,我會盡力幫助你弄明白。 – krishna555