0
我正在将libxmlrpc实现到C++项目中,无论如何,我的RPC服务器已经返回一个包含52个成员结构的struct。libxmlrpc迭代遍历struct
我不知道密钥是什么,因为它们是不透明的引用,所以我不能依赖它们。
我如何能够通过结构重复,我还以为这是用下面的代码:
XmlRpcValue param_array = XmlRpcValue::makeArray();
param_array.arrayAppendItem(XmlRpcValue::makeString(this->sessionKey));
param_array.arrayAppendItem(XmlRpcValue::makeString("petabytes"));
XmlRpcValue result = ServerCall("Charter.getDataWarehouse.storage.capacity", param_array, url);
int index = 0;
while(index < result.structSize())
{
XmlRpcValue Data = result.getStruct();
//Would have thought it would work with this ;(shit documentation libxmlrpc has, grrrr
//Data.structGetKeyAndValue(index);
//This for example works, because I know the opaque reference, but in real life I wont
cout << Data.structGetValue("OpaqueRef:d4e60db6-2271-b0ac-d362-1b51220980af").structSize() << endl;
index++;
}
然而,Data.structGetKeyAndValue(指数)与错误:
no matching function for call to 'XmlRpcValue::structGetKeyAndValue(int&)
哪个好吧,我知道这不是一个公众(嗯,我认为它不是一个公共成员函数)xmlrpcvalue
,但我找不到任何可以让我这样做的东西。
任何人都有这方面的经验?
感谢您的..它并没有解决这个问题,原来这直接libxmlrpc是有点令人生畏的我的任务,我结束了去与fastrpc(我需要快速完成项目不幸..),以及... fastrpc是..快! –