找回密码
 注册
查看: 1687|回复: 0

R语言 SSOAP包 SOAP()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-22 20:56:18 | 显示全部楼层 |阅读模式
SOAP(SSOAP)
SOAP()所属R语言包:SSOAP

                                        Invoke a SOAP method
                                         调用SOAP方法

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

This is used to call a SOAP method in a SOAP server, passing the relevant arguments from S and converting the response into an S object. The communication between S and the SOAP server is handled via connections.
这是用于在SOAP服务器调用SOAP方法,从S有关的参数传递的对象转换成响应。 S和SOAP服务器之间的通信是通过连接处理。


用法----------Usage----------


.SOAP(server, method, ..., .soapArgs = list(), action, nameSpaces = SOAPNameSpaces(),
      xmlns = NULL, handlers = SOAPHandlers(), .types = NULL,
      .convert = TRUE, .opts = list(), curlHandle = getCurlHandle(),
      .header = getSOAPRequestHeader(action, .server = server),
      .literal = FALSE, .soapHeader = NULL, .elementFormQualified = FALSE,
      .returnNodeName = NA)



参数----------Arguments----------

参数:server
a SOAPServer object
SOAPServer对象


参数:method
the name of the SOAP method to invoke
SOAP方法调用的名称


参数:...
name=value arguments to pass to the  
名称=值的参数传递给


参数:.soapArgs
an alternative mechanism for passing arguments to the .SOAP call. This is a list of named or unnamed values which is used as the arguments for the SOAP method invocation.  
一个参数传递给SOAP调用的替代机制。这是一个list的有名或无名的使用SOAP方法调用的参数值。


参数:action
the SOAPAction string to put in the HTTP header. This is required.  If it is an object of class AsIs, it is left exactly as it is.  This allows one to call this function as .SOAP(...., action = I("einfo")) without having to provide a handler to bypass the default action mechanism.
把HTTP头中的SOAPAction字符串。这是必需的。如果它是一个AsIs类的对象,这是留给正是因为它是。这允许一个调用这个函数。(SOAP ......,行动=(“einfo”)),而无需提供处理程序,以绕过默认的行动机制。


参数:nameSpaces
a named character vector giving the XML namespaces to add to the Body. These are given as a named character vector with the names giving the local namespace identifier and the value being the URI corresponding to that namespace identifier. For ease of use, one can identify the collections corresponding to the 1999 or 2001 schema using the simpler strings "1.1" and "1.2" respectively. If nameSpaces is a single string, we use it to index the element in the .SOAPDefaultNameSpaces list.  
一个名为特征向量的XML命名空间添加到身体。这些都是作为一个给当地的命名空间标识符和值,该命名空间标识符对应的URI的名称命名的特征向量。为便于使用,可以识别到1999年或2001年的模式,使用简单的字符串“1.1”和“1.2”分别对应的集合。 nameSpaces如果是一个字符串,我们用它来指数在.SOAPDefaultNameSpaces列表元素。


参数:xmlns
the name space to use for the XML nodes which specify the actual method call, i.e. within the BODY. This is either a single string, or a name-value pair given as a character vector. The name is the namespace identifier and the value is the URI.
使用指定的实际方法调用,即身体内的XML节点的名称空间。这是一个单一的字符串,或作为特征向量给出一个名称 - 值对。这个名字是命名空间标识符和值是URI。


参数:handlers
a collection of functions that, if present, are called at different points in the SOAP invocation to process the input and output. These can be thought of as event callbacks and include action for creating the final form of the SOAPAction string, converter for processing the XML returned by the SOAP server in the case of a successful invocation, and so on.  
收集的,如果存在,被称为SOAP调用在不同的点来处理输入和输出功能。这些可以被认为是事件回调,包括action创建的SOAPAction字符串的最后形式,converter用于处理XML的SOAP服务器返回成功调用的情况下,等。


参数:.types
[not yet implemented] allows one to explicitly control the conversion of the arguments to the appropriate/desired SOAP type. This is useful when you know what the server is expecting.  
[尚未实施允许明确控制参数适当/ SOAP类型的转换。这是有用的,当你知道什么服务器期待。


参数:.convert
a function, a logical value or a SOAPType. If this is a function, it should take two arguments: the content to be converted from SOAP format to R and the target type described as a SOAPType object. This should return an R object representing the SOAP content. If, alternativley, this is supplied as a logical value, this controls whether the default converters are used (TRUE) or not (FALSE). These converters are taken from the handlers argument. And finally, if .convert is a SOAPType object, we call convertFromSOAP with the  
一个函数,逻辑值或SOAPType。如果这是一个函数,它应该采取两个参数:从SOAP格式转换为R和目标类型作为SOAPType对象描述的内容。这应该返回一个R对象表示SOAP内容。如果一种可能的选择,这是提供一个逻辑值,是否使用默认的转换器的控制(TRUE)或不(FALSE)。这些转换器handlers参数。最后,如果.convert是SOAPType对象,我们称之为convertFromSOAP


参数:.opts
a named list of elements that are passed to the curlPerform function which actually invokes the SOAP method. These options control aspects of the HTTP request, including debugging information that is displayed on the console, e.g. .opts = list(verbose = TRUE)
一个被传递到curlPerform的功能,实际上调用SOAP方法的元素命名名单。这些选项控制HTTP请求的各个方面,包括调试信息,在控制台上显示,例如: .opts = list(verbose = TRUE)


参数:curlHandle
this is passed to curlPerform as the curlHandle argument. By providing this as a parameter here, the user can reuse an existing curl handle with options explicitly set just once. Additionally, one can control the connection to the Web server using keep-alive connections, etc. to improve performance.  
这是传递给curlPerformcurlHandle参数。通过提供作为参数在这里,用户可以重用现有卷曲手柄只是一次明确设置的选项。此外,一个可以控制的连接到Web服务器使用keep-alive连接等,以提高性能。


参数:.header
a named character vector of elements which are used in the HTTP header for the SOAP request. These are calculated by default within the .SOAP call, but the parameter allows them to be pre-computed and supplied in the call.  
一个用于在SOAP请求的HTTP头元素的命名的特征向量。这些计算内。SOAP调用的默认,但使他们能够预先计算并在呼叫提供的参数。


参数:.literal
a logical value indicating whether to use the literal encoding for serializing the data being sent to and from the server.
一个逻辑值,该值指示是否使用文字编码序列被发送到从服务器的数据。


参数:.soapHeader
this allows the caller to specify the SOAP content for the Header part of the SOAP request. This is sometimes used to supply information such as login and password or other forms of authentication and authorization. The value for this parameter can be the text of the XML header node, an XML node itself, or alternatively a function that returns such a node (or text with the XML content). The function is called with the SOAP document being created and the name of the SOAP method.  
这允许调用者指定的SOAP请求头部分的SOAP内容。这有时被用来提供信息,如登录名和密码或其他形式的身份验证和授权。此参数值可以是文本的XML头节点,一个XML节点本身,或者一个函数,返回这样一个节点(或XML内容的文本)。该功能被称为与正在创建的SOAP文档和SOAP方法的名称。


参数:.elementFormQualified
a logical value. If this is FALSE, only the XML element identifying the method  call in the Body of the SOAP request uses the target namespace. The XML nodes representing the arguments in the method call do not use this namespace but are global. Alternatively, if this is TRUE, the target namespace of the schema is defined as the default name space on the XML element for the method call and so is inherited by the elements for the parameters.  
一个逻辑值。如果这是FALSE,只有确定在身体的SOAP请求的方法调用的XML元素的目标命名空间使用。代表在方法调用的参数的XML节点不使用此命名空间,而且是全球性的。另外,如果TRUE,该架构的目标命名空间定义上的方法调用的XML元素的默认名称空间等参数的元素继承。


参数:.returnNodeName
the name of the node in the SOAP response that is the container for the content of the response. This is often "return"  but can be any legal XML node name and is often given to us in a WSDL.  
在SOAP响应,响应的内容是集装箱节点的名称。这通常是"return"但可以是任何合法的XML节点的名称,并经常给我们在WSDL。


值----------Value----------

An S object representing the return value from the SOAP method invocation.
一个S代表从SOAP方法调用的返回值的对象。


作者(S)----------Author(s)----------


Duncan Temple Lang <duncan@wald.ucdavis.edu>



参考文献----------References----------

http://www.omegahat.org/SSOAP, http://www.omegahat.org/bugs.

参见----------See Also----------

writeSOAPMessage isHTTPError curlPerform postForm  
writeSOAPMessageisHTTPErrorcurlPerformpostForm


举例----------Examples----------


## Not run: [#无法运行:]
.SOAP(SOAPServer("services.xmethods.net", "soap"),
       "getRate", country1="England", country2 = "Japan",
       action="urn:xmethods-CurrencyExchange")

.SOAP(SOAPServer("services.xmethods.net", "soap/servlet/rpcrouter"),
      "getPrice", "0596000278",
      action="urn:xmethods-BNPriceCheck")

s <- SOAPServer("http://services.xmethods.net/soap")
.SOAP(s,
      "getQuote", "AMZN",
      action="urn:xmethods-delayed-quotes#getQuote")[getQuote的“)]


.SOAP(SOAPServer("services.soaplite.com", "temper.cgi"),
       "c2f", 37.5,
      action="http://www.soaplite.com/Temperatures")


# Different action and namespace.[不同的动作和命名空间。]
# Specify handlers=NULL to avoid the additional processing of the[指定处理程序= NULL,以避免额外的处理]
# SOAPAction string, i.e. the appending of the method name.[SOAPAction的字符串,即追加的方法的名称。]
# This kills off all the handlers. If we want to remove only the[这杀死了所有的处理程序。如果我们想只删除]
# "action" element, we have to be more explicit.[“行动”的元素,我们必须更加明确。]

s1 <- SOAPServer("services.soaplite.com", "interop.cgi")
.SOAP(s1,
      "echoString", "From R",
      action="urn:soapinterop",
      xmlns=c(namesp1="http://soapinterop.org/"),
      handlers =NULL)

## End(Not run)[#结束(不运行)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-22 16:10 , Processed in 0.028941 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表