1

我正在尝试使用 gSoap 库与带有 WSHttpBinding 的 WCF 服务器通信。我似乎遇到了 gSoap 的 WS-Addressing 插件的问题。当我启用 WS-Addressing 插件时,通过使用 #import "wsa5.h" 我无法再编译。现在,soapC.cpp 中有未解析的符号。第一个错误在soap_getelement(soap*, int*) 中。错误是 SOAP_TYPE_ wsa5 _IsReferenceParameter。这是我第一次尝试使用 gSoap。任何建议表示赞赏。

gSoap 版本 2.8.4

4

1 回答 1

1

What you can do is add the WSA part to your Typemap file, then in your wsdl2h command specify it with the -t parameter.

i.e:

wsdl2h -o target.h -t EditedTypemap.dat target.wsdl

You can just copy the standard Typemap.dat from your gSOAP directory and edit it so it looks like the following:

wsa = <http://schemas.xmlsoap.org/ws/2004/08/addressing>

SOAP_ENV__Header =\
#import "wsa.h"\n\
struct SOAP_ENV__Header\n\
{\n\
   mustUnderstand _wsa__MessageID    wsa__MessageID 0;\n\
   mustUnderstand _wsa__RelatesTo *  wsa__RelatesTo 0;\n\
   mustUnderstand _wsa__From *       wsa__From      0;\n\
   mustUnderstand _wsa__ReplyTo *    wsa__ReplyTo   0;\n\
   mustUnderstand _wsa__FaultTo *    wsa__FaultTo   0;\n\
   mustUnderstand _wsa__To           wsa__To        0;\n\
   mustUnderstand _wsa__Action       wsa__Action    0;\n\
};

Then rerun wsdl2h as I mentioned above. Hope this works for you! gSOAP is a great toolkit, just a little finnicky to get into.

于 2011-11-10T08:21:26.830 回答