Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/157.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ gSOAP动态数组作为输入参数_C++_Web Services_Gsoap - Fatal编程技术网

C++ gSOAP动态数组作为输入参数

C++ gSOAP动态数组作为输入参数,c++,web-services,gsoap,C++,Web Services,Gsoap,我使用gSOAP toolkit生成soap服务和客户端,gSOAP toolkit应该发送一个int数组,该数组被放入结构中,如gSOAP文档中所建议的: //myservice.h struct abc { int __size; int *__myptr; }; int ns__SetConfiguration(struct abc as, int* result); 以下是我如何生成代码: soapcpp2 -i -SC myservice.h 然后从客户端调用服务

我使用gSOAP toolkit生成soap服务和客户端,gSOAP toolkit应该发送一个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);
但是,在服务端,大小变为。 我错过了什么

谢谢。

输入错误

结构的定义应如下所示:

struct abc {
int *__ptr;
int __size;
})