gsoap-SOAP头中的WS-Addressing元素

gsoap-SOAP头中的WS-Addressing元素,soap,wsdl,header,gsoap,ws-addressing,Soap,Wsdl,Header,Gsoap,Ws Addressing,我需要在Soap头中添加WS-Addressing(我使用的是gsoap框架)。 有没有办法自动添加?我查阅了gsoap文档,但没有找到任何相关信息。 因此,现在我已经手动将WS-Addressing添加到我的SOAP_ENV_头中,如下所示 struct SOAP_ENV__Header { mustUnderstand _wsa__MessageID wsa__MessageID 0; mustUnderstand _wsa__RelatesTo *wsa__RelatesTo

我需要在Soap头中添加WS-Addressing(我使用的是gsoap框架)。 有没有办法自动添加?我查阅了gsoap文档,但没有找到任何相关信息。 因此,现在我已经手动将WS-Addressing添加到我的SOAP_ENV_头中,如下所示

struct SOAP_ENV__Header
{
   mustUnderstand _wsa__MessageID wsa__MessageID 0;
   mustUnderstand _wsa__RelatesTo *wsa__RelatesTo 0;
   mustUnderstand _wsa__From *wsa__From 0;
   mustUnderstand _wsa__ReplyTo *wsa__ReplyTo 0;
   mustUnderstand _wsa__FaultTo *wsa__FaultTo 0;
   mustUnderstand _wsa__To wsa__To 0;
   mustUnderstand _wsa__Action wsa__Action 0;
}; 
但是我想自动生成它,因为我必须向Soap头添加一些其他结构,这些结构是从wsdl/xsd文件自动生成的


谢谢

您可以在typemap.dat中定义SOAP\u ENV\u头,如下所示:

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\
};
wsa=
SOAP_环境___头=\
#导入“wsa.h”\n\
结构SOAP\u环境\u标头\n\
{\n\
mustUnderstand\u wsa\u MessageID wsa\u MessageID 0;\n\
必须理解\u wsa\u RelatesTo*wsa\u RelatesTo 0;\n\
必须从0中理解_wsa\u*wsa\u;\n\
必须理解\u wsa\uuu ReplyTo*wsa\uu ReplyTo 0;\n\
必须理解\u wsa\u FaultTo*wsa\u FaultTo 0;\n\
必须理解从wsa到wsa到0;\n\
必须理解\u wsa\u操作wsa\u操作0;\n\
};

然后使用wsdl2h和选项“-t”指定外部typemap.dat。

您可以在typemap.dat中定义SOAP_ENV_头,如下所示:

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\
};
wsa=
SOAP_环境___头=\
#导入“wsa.h”\n\
结构SOAP\u环境\u标头\n\
{\n\
mustUnderstand\u wsa\u MessageID wsa\u MessageID 0;\n\
必须理解\u wsa\u RelatesTo*wsa\u RelatesTo 0;\n\
必须从0中理解_wsa\u*wsa\u;\n\
必须理解\u wsa\uuu ReplyTo*wsa\uu ReplyTo 0;\n\
必须理解\u wsa\u FaultTo*wsa\u FaultTo 0;\n\
必须理解从wsa到wsa到0;\n\
必须理解\u wsa\u操作wsa\u操作0;\n\
};

然后使用带有选项“-t”的wsdl2h指定外部typemap.dat。

对gSoap使用ws-addressing插件。

对gSoap使用ws-addressing插件