Web Services--gSOAP 2.7.6 第七章(7.1.3)

150 篇文章 0 订阅
19 篇文章 0 订阅

下载地址: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 clients view of the parameters names. 

更确切地说,远程方法的输出参数的名称是没有严格需要去匹配参数名称的客户视图。

Also, the input parameter names of a remote method are not strictly required to match a services 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编译器可以生成stubskeleton程序支持匿名参数。

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.

这将影响安装启用gSOAPWeb services和这个服务的参数名称匹配。

 

Caution: when anonymous parameter names are used, the order of the parameters in the function prototype of a remote method is significant.

警告:当匿名阐述名称被使用时, 在远程方法的函数原型中参数的顺序是重要的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值