gsoap返回结果是一个结构体编译报错
如下定义
//gsoap ns service name: struct
//gsoap ns service style: rpc
//gsoap ns service encoding: encoded
//gsoap ns service namespace: http://localhost/struct.wsdl
//gsoap ns service location: http://localhost
//gsoap ns service executable: struct.cgi
//gsoap ns schema namespace: urn:struct
typedef struct JobStatusDetail {
int jobId;
int status;
char cpuTime[10];
char wallTime[10];
} testType;
typedef testType *xsd__JobStatusDetailPointer;
struct ns__JobStatusPointer {
xsd__JobStatusDetailPointer *__ptr;
int __size;
};
int ns__StructArrayTest(char *cmd, struct ns__JobStatusPointer *structResult);
编译的时候老是报如下错误,是什么问题
1>structServer.cpp
1>d:\gsoap\struct\soapstub.h(45) : error C2011: 'JobStatusDetail' : 'struct' type redefinition
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soapstub.h(77) : error C2011: 'ns__JobStatusPointer' : 'struct' type redefinition
1> d:\gsoap\struct\struct.h(17) : see declaration of 'ns__JobStatusPointer'
1>d:\gsoap\struct\soaph.h(543) : error C2027: use of undefined type 'ns__JobStatusPointer'
1> d:\gsoap\struct\struct.h(17) : see declaration of 'ns__JobStatusPointer'
1>d:\gsoap\struct\soaph.h(543) : error C2227: left of '->__ptr' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(544) : error C2027: use of undefined type 'ns__JobStatusPointer'
1> d:\gsoap\struct\struct.h(17) : see declaration of 'ns__JobStatusPointer'
1>d:\gsoap\struct\soaph.h(544) : error C2227: left of '->__size' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(637) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(637) : error C2227: left of '->jobId' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(638) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(638) : error C2227: left of '->status' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(639) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(639) : error C2227: left of '->cpuTime' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(640) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(640) : error C2227: left of '->wallTime' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(654) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(654) : error C2227: left of '->jobId' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(655) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(655) : error C2227: left of '->status' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(656) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(656) : error C2227: left of '->cpuTime' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(657) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(657) : error C2227: left of '->wallTime' must point to class/struct/union/generic type
1>Build log was saved at "file://d:\gSoap\struct\Server\Server\Debug\BuildLog.htm"
1>Server - 22 error(s), 0 warning(s)
//gsoap ns service name: struct
//gsoap ns service style: rpc
//gsoap ns service encoding: encoded
//gsoap ns service namespace: http://localhost/struct.wsdl
//gsoap ns service location: http://localhost
//gsoap ns service executable: struct.cgi
//gsoap ns schema namespace: urn:struct
typedef struct JobStatusDetail {
int jobId;
int status;
char cpuTime[10];
char wallTime[10];
} testType;
typedef testType *xsd__JobStatusDetailPointer;
struct ns__JobStatusPointer {
xsd__JobStatusDetailPointer *__ptr;
int __size;
};
int ns__StructArrayTest(char *cmd, struct ns__JobStatusPointer *structResult);
编译的时候老是报如下错误,是什么问题
1>structServer.cpp
1>d:\gsoap\struct\soapstub.h(45) : error C2011: 'JobStatusDetail' : 'struct' type redefinition
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soapstub.h(77) : error C2011: 'ns__JobStatusPointer' : 'struct' type redefinition
1> d:\gsoap\struct\struct.h(17) : see declaration of 'ns__JobStatusPointer'
1>d:\gsoap\struct\soaph.h(543) : error C2027: use of undefined type 'ns__JobStatusPointer'
1> d:\gsoap\struct\struct.h(17) : see declaration of 'ns__JobStatusPointer'
1>d:\gsoap\struct\soaph.h(543) : error C2227: left of '->__ptr' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(544) : error C2027: use of undefined type 'ns__JobStatusPointer'
1> d:\gsoap\struct\struct.h(17) : see declaration of 'ns__JobStatusPointer'
1>d:\gsoap\struct\soaph.h(544) : error C2227: left of '->__size' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(637) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(637) : error C2227: left of '->jobId' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(638) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(638) : error C2227: left of '->status' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(639) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(639) : error C2227: left of '->cpuTime' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(640) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(640) : error C2227: left of '->wallTime' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(654) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(654) : error C2227: left of '->jobId' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(655) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(655) : error C2227: left of '->status' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(656) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(656) : error C2227: left of '->cpuTime' must point to class/struct/union/generic type
1>d:\gsoap\struct\soaph.h(657) : error C2027: use of undefined type 'JobStatusDetail'
1> d:\gsoap\struct\struct.h(9) : see declaration of 'JobStatusDetail'
1>d:\gsoap\struct\soaph.h(657) : error C2227: left of '->wallTime' must point to class/struct/union/generic type
1>Build log was saved at "file://d:\gSoap\struct\Server\Server\Debug\BuildLog.htm"
1>Server - 22 error(s), 0 warning(s)
...全文
相关推荐
gsoap_返回值为结构体数组
当服务返回结构体数组时,gSOAP会生成一个处理数组的函数,通常以“_array”结尾。
gSOAP 入门实践(一)
gSOAP 教程实践(一) gSOAP下载:https://www.genivia.com/downloads.html 编译安装:请自行查看源码包里的 INSTALL.txt 教程:Getting Started with gSOAP 之 Hello world: getting started with SOAP APIs 创建 hello.h ,代码如下: // hello.h int ns__hello(std::string name, std::string& greeting);
gsoap输入输出结构体参数demo
**实现服务端**: 在服务端,你需要实现Web服务操作,处理结构体输入和返回结构体结果。gSOAP提供了`soap_serve`函数,你可以在这个函数中插入自定义的服务处理逻辑。5.
linux 下 gsoap 用webservice 通信
例如,我们可以有一个获取表格数据的接口,该接口接受请求并返回一个`Table`结构体: ```c++ struct _ns1__getTable { @param }; struct ns1__getTableResponse
gSoap c++ 结构体
当你有一个C++结构体需要在网络间传递时,gSOAP会生成必要的代码来处理结构体到XML的转换,以及从接收到的XML数据恢复结构体。这个过程称为序列化和反序列化。


其它技术问题
