2015-05-04 29 views
1

我生成皁服務和客戶端使用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。 我錯過了什麼?

謝謝。

回答

0

錯誤類型。

STRUCT恰好應該被定義如下:

struct abc { 
int *__ptr; 
int __size; 

};