.SOAP                 package:SSOAP                 R Documentation

_I_n_v_o_k_e _a _S_O_A_P _m_e_t_h_o_d

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     .SOAP(server, method, ..., .soapArgs = list(), action, nameSpaces = SOAPNameSpaces(),
           xmlns = NULL, handlers = SOAPHandlers(), .types = NULL,
           .convert = TRUE, .opts = NULL)

_A_r_g_u_m_e_n_t_s:

  server: a 'SOAPServer' object

  method: the name of the SOAP method to invoke

     ...: 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. 

  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.

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.

   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.

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. 

  .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. 

.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

   .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)'

_D_e_t_a_i_l_s:

_V_a_l_u_e:

     An S object representing the return value from the SOAP method
     invocation.

_A_u_t_h_o_r(_s):

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

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.w3.org/TR/SOAP/> <URL:
     http://www.omegahat.org/SSOAP>, <URL:
     http://www.omegahat.org/bugs>.

_S_e_e _A_l_s_o:

     'writeSOAPMessage' 'isHTTPError' 'curlPerform' 'postForm'

_E_x_a_m_p_l_e_s:

     ## 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")

     .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
      # SOAPAction string, i.e. the appending of the method name.
      # 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)

