gsoap 数据绑定,如何访问 gsoap 生成的 .h 文件中的序列

发布于 2024-10-04 20:22:18 字数 1044 浏览 0 评论 0原文

我不知道如何访问 FilenameType_sequence

class ns1__FilenameType
{ 
 public:

   // SEQUENCE OF ELEMENTS <xs:sequence minOccurs="1" maxOccurs="unbounded">
    $int                                  __size_FilenameType_sequence   1;  
    class __ns1__FilenameType_sequence
    {   
       // std::string with length 1
       std::string filename                       1;
    }                                   *__FilenameType_sequence       ;
    //  END OF SEQUENCE
    // A handle to the soap struct that manages this instance (automatically set)
    struct soap                         *soap                          ;
};

我尝试使用它的新函数,然后将 ns1_FilenameType->_FilenameType_sequence = 设置为我的新对象,但这不起作用。

ns1__FilenameType_sequence * fnSeq = soap_new__ns1__FilenameType_sequence(soap, -1);
fnSeq->filename = "Name";
s1__FilenameType->__FilenameType_sequence = fnSeq;

我还认为 .push_back 函数可能会起作用,但初始测试没有成功。所以现在我没有主意了。任何新的将不胜感激。 请告诉我

谢谢乔希

如果您需要更多信息,

I have no idea how to access FilenameType_sequence

class ns1__FilenameType
{ 
 public:

   // SEQUENCE OF ELEMENTS <xs:sequence minOccurs="1" maxOccurs="unbounded">
    $int                                  __size_FilenameType_sequence   1;  
    class __ns1__FilenameType_sequence
    {   
       // std::string with length 1
       std::string filename                       1;
    }                                   *__FilenameType_sequence       ;
    //  END OF SEQUENCE
    // A handle to the soap struct that manages this instance (automatically set)
    struct soap                         *soap                          ;
};

I tried using its new function and then setting ns1_FilenameType->_FilenameType_sequence = to my new object but that didn't work.

ns1__FilenameType_sequence * fnSeq = soap_new__ns1__FilenameType_sequence(soap, -1);
fnSeq->filename = "Name";
s1__FilenameType->__FilenameType_sequence = fnSeq;

I also thought that maybe the .push_back function would work but initial testing didn't pan out. So now im all out of ideas. Any new ones would be greatly appreciated. Let me know if you need more information

Thanks

Josh

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如何视而不见 2024-10-11 20:22:18

如果您遇到与我相同的问题,代码如下,

ns1__FilenameType_sequence * fnSeq = soap_new__ns1__FilenameType_sequence(soap, 2);
fnSeq[0].filename = "Becky";
fnSeq[1].filename = "Jen";
fnSeq[1].filename = "Cindy";

ns1__FilenameType->__size_FilenameType_sequence = 3;
ns1__FilenameType->__FilenameType_sequence = fnSeq;

有点直观,但不是真的,希望这会有所帮助

In case you're having the same problem as me the code is as follows

ns1__FilenameType_sequence * fnSeq = soap_new__ns1__FilenameType_sequence(soap, 2);
fnSeq[0].filename = "Becky";
fnSeq[1].filename = "Jen";
fnSeq[1].filename = "Cindy";

ns1__FilenameType->__size_FilenameType_sequence = 3;
ns1__FilenameType->__FilenameType_sequence = fnSeq;

so kinda intuitive but not realy, hope this helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文