gsoap databinding, how to access a sequence within the .h file generated by gsoap
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 = "N开发者_运维百科ame";
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
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
精彩评论