GSOAP动态数组作为输入参数

gSOAP dynamic array as input parameter

本文关键字:输入 参数 动态 数组 GSOAP      更新时间:2023-10-16

i使用GSOAP工具包生成肥皂服务和客户端,该工具包应该发送一个int数组,该数组被放入结构中,如GSOAP文档中所建议的:

//myservice.h

struct abc {
    int __size;
    int *__myptr;
};
int ns__SetConfiguration(struct abc as, int* result);

这是我生成代码的方式:

soapcpp2 -i -SC myservice.h

然后从客户端我调用服务:

int result;
int *aa = (int*)soap_malloc(&service, 10*sizeof(int));
abc myabc;
myabc.__myptr = aa;
myabc.__size = 10;
service.setConfiguration(myabc, &result);

但是,在服务方面, size 变为。我想念什么?

谢谢。

错误。

结构应像这样定义:

struct abc {
int *__ptr;
int __size;

};