你可以做的是WSA部件添加到您的類型表文件,然後在你的wsdl2h命令-t參數指定。
即:
wsdl2h -o target.h -t EditedTypemap.dat target.wsdl
您可以直接從您的gSOAP的目錄複製標準Typemap.dat,所以它看起來像下面編輯:
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\
};
然後重新運行wsdl2h正如我上面提到。希望這對你有用! gSOAP是一個偉大的工具包,只是有點挑剔。
我認爲我的問題與此有關... http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.messageversion.soap12wsaddressing10.aspx – IslandCow