[英]gsoap linux c++ / struct failure delivery
char或int,返回值傳遞正確。
但是struct被傳遞失敗。
服務器:
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");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.