下载地址:http://sourceforge.net/projects/gsoap2
官方网站:http://genivia.com/Products/gsoap/index.html
本文翻译只是出于学习的目的,中文部分仅代表个人观点,有错误还望指正,英文部分来自gsoap-win32-2.7\doc\soapdoc2.pdf。其中复制可能有误,可以看懂英文的还请到官网下载。如有版权争议,请联系QQ:643166601,本人会及处理。翻译新手,有错是必然的,求高人指点。欢迎同为新手的你共同学习。
7.1.13 How to Specify Anonymous Parameter Names
7.1.13 如何指定匿名参数名称
The SOAP 1.1 protocol allows parameter names to be anonymous.
这个SOAP 1.1协议允许参数命名是匿名的。
That is, the name(s) of the output parameters of a remote method are not strictly required to match a client’s view of the parameters names.
更确切地说,远程方法的输出参数的名称是没有严格需要去匹配参数名称的客户视图。
Also, the input parameter names of a remote method are not strictly required to match a service’s view of the parameter names.
此外,远程方法的输入参数名称是没有严格要求去匹配参数名称的服务端视图。
Although this convention is likely to be deprecated in SOAP 1.2, the gSOAP compiler can generate stub and skeleton routines that support anonymous parameters.
尽管这个约定可能在SOAP 1.2中不赞成使用,SOAP编译器可以生成stub和skeleton程序支持匿名参数。
Parameter names are implicitly anonymous by omitting the parameter names in the function prototype of the remote method.
在远程方法的函数原型通过省略的参数名是隐含匿名的。
For example:
例如:
// Contents of ”getQuote.h”:
typedef char *xsd__string;
typedef float xsd__float;
int ns1__getQuote(xsd__string, xsd__float&);
To make parameter names explicitly anonymous on the receiving side (client or service), the parameter
names should start with an underscore (_) in the function prototype in the header file.
使用参数名称在接收端(客户端或服务端)以明确的匿名,这个参数名称应该在函数原型的头文件中以(_)开始。
For example:
例如:
// Contents of ”getQuote.h”:
typedef char *xsd__string;
typedef float xsd__float;
int ns1__getQuote(xsd__string symbol, xsd__float & return);
Or, alternatively with a response struct:
或者,二者择一的用一个响应结构体:
// Contents of ”getQuote.h”:
typedef char *xsd__string;
typedef float xsd__float;
struct ns1__getQuoteResponse {xsd__float return;};
int ns1__getQuote(xsd__string symbol, struct ns1__getQuoteResponse &r);
In this example, _return is an anonymous output parameter.
在这个例子中,_return是一个匿名的输出参数。
As a consequence, the service response to a request made by a client created with gSOAP using this header file specification may include any name for the output parameter in the SOAP payload.
作为一个结果,这个服务去响应一个客户端创建的SOAP请求使用这个头文件规定的可以包含在SOAP有效载荷的输出参数中。
The input parameters may also be anonymous.
这个输入参数也可以是匿名的。
This affects the implementation of Web services in gSOAP and the matching of parameter names by the service.
这将影响安装启用gSOAP中Web services和这个服务的参数名称匹配。
Caution: when anonymous parameter names are used, the order of the parameters in the function prototype of a remote method is significant.
警告:当匿名阐述名称被使用时, 在远程方法的函数原型中参数的顺序是重要的。