0

char or int, return value is passed well.

But struct is passed to fail.

server:

soapcpp2 -2 -SLix ...

client:

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

and

struct{
  char * value;
}USER_ITEM

server:

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

client:

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

The windows are good. But not on Linux c++.

Are in the same format as above.

Do I need a separate set of options?

Please help if you suspect parts.

Sorry, I did not speak English well.

Thanks for reading.

AKUMA
  • 13
  • 3
  • If you compile with -Wall and -Werror do you get any warnings? Is the method `GetValue` or `Getvalue` and what does its declaration look like in the proxy base class. – Paul Rooney Apr 06 '15 at 10:39

1 Answers1

1

You cannot copy a char pointer by using the assignment operator, this is not an std::string:

item->value = new char[100];
strcpy(item->value, "example");
nvoigt
  • 75,013
  • 26
  • 93
  • 142
  • Thank you for answers. But it is not a problem. server: `cout << item-> value << endl; // Output is fine.` but server: `user.user_item // null` and `user.user_item-> value // not found` – AKUMA Apr 06 '15 at 05:07
  • 1
    Your code seems fishy. Shouldn't it read `proxy.Getvalue(user.user_item);`? Please post your *real* code. The one that compiles. – nvoigt Apr 06 '15 at 05:14