gSOAP的动态数组作为输入参数
问题描述:
我生成皂服务和客户端使用gSOAP的这是应该发送其放在一个结构作为在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);
但是,在服务方面,大小变成ZERO。 我错过了什么?
谢谢。
答
错误类型。
STRUCT恰好应该被定义如下:
struct abc {
int *__ptr;
int __size;
};