gsoap-linux c++/结构失败传递



charint,返回值传递良好。

但是结构被传递为失败。

服务器:

soapcpp2 -2 -SLix ...

客户端:

wsdl2h -f -s -o ... ...
soapcpp2 -i -C ...

struct{
  char * value;
}USER_ITEM

服务器:

int Service::GetValue(struct USER_ITEM * item)
{
  item->value = new char[100];
  item->value = "example";
}

客户端:

....
ns2__useritemresponse user;
proxy.Getvalue(user)
user.user_item->value  // user.user_item address is null;
....

窗户很好。但不是在Linux c++上。

与上述格式相同。

我需要一套单独的选项吗?

如果您怀疑零件有问题,请提供帮助。

对不起,我英语说得不好。

感谢阅读。

不能使用赋值运算符复制char指针,这不是std::string:

item->value = new char[100];
strcpy(item->value, "example");

最新更新