【问题标题】:gsoap - WS-Addressing elements in the SOAP Headergsoap - SOAP Header 中的 WS-Addressing 元素
【发布时间】:2010-10-11 04:14:21
【问题描述】:

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

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 Header 添加一些其他结构,这些结构是从我的 wsdl/xsd 文件自动生成的。

谢谢

【问题讨论】:

    标签: soap wsdl header gsoap ws-addressing


    【解决方案1】:

    您可以像这样在 typemap.dat 中定义 SOAP_ENV_Header:

    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\
    };
    

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

    【讨论】:

      【解决方案2】:

      为 gSoap 使用 ws 寻址插件。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-08-19
        • 2017-08-14
        • 1970-01-01
        • 2015-08-29
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多