下载地址:http://sourceforge.net/projects/gsoap2
官方网站:http://genivia.com/Products/gsoap/index.html
本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版权争议,请联系QQ:643166601,本人会及处理。翻译新手,有错是必然的,求高人指点。欢迎同为新手的你共同学习。
7.1.14 How to Specify a Method with No Input Parameters
7.1.14 如何指定一个没有输入参数的方法
To specify a remote method that has no input parameters, just provide a function prototype with one parameter which is the output parameter.
去指定一个没有输入参数的远程方法,只需要提供一个带有一个输出参数的函数原型。
However, some C/C++ compilers (notably Visual C++TM) will not compile and complain about an empty struct.
然而,一些C/C++编译器(尤其是Visual C++TM)将不能编译和抱怨一个空的结构体。
This struct is generated by gSOAP to contain the SOAP request message.
这个结构体是gSOAP生成的去包含SOAP请求消息。
To fix this, provide one input parameter of type void* (gSOAP can not serialize void* data).
要解决这个,提供一个void* (gSOAP can not serialize void* data)类型的输入参数。
For example:
例如:
struct ns3__SOAPService
{
public:
int ID;
char *name;
char *owner;
char *description;
char *homepageURL;
char *endpoint;
char *SOAPAction;
char *methodNamespaceURI;
char *serviceStatus;
char *methodName;
char *dateCreated;
char *downloadURL;
char *wsdlURL;
char *instructions;
char *contactEmail;
char *serverImplementation;
};
struct ArrayOfSOAPService {struct ns3__SOAPService *__ptr; int __size;};
int ns getAllSOAPServices(void *_, struct ArrayOfSOAPService &_return);
The ns__getAllSOAPServices method has one void* input parameter which is ignored by the serializer
to produce the request message.
这个ns__getAllSOAPServices方法是一个void*输入参数,序列化将被忽略产生请求的消息。
Most C/C++ compilers allow empty structs and therefore the void* parameter is not required.
大多数C/C++编译器允许空结构体,因此void*参数不是必须的。