<xml-rpc-call></xml-rpc-call>
Provided by module: Tags: Additional RXML tags
Perform a synchronous XML-RPC call. The content specifies the
call parameters, and the result of the tag is the return parameters
(if the call is successful). The result is expressed using the same
kind of tags that specifies the parameters (this is a more compact
and rxml-friendly format than the actual XML-RPC form; see
below).
If the call fails on a high level, i.e. if the remote side returns
a fault, then the result is empty and the fault code and string gets
stored in the variables specified by the "fault-code" and
"fault-string" attributes (if they exist).
If the call fails on a low level, i.e. connection error or due to
some kind of syntactic error in the result, then an RXML run error is
thrown.
The boolean status is set to true if the call is successful, false
otherwise.
Example:
<set variable='var.xml-rpc-result'>
<xml-rpc-call href='http://xmlrpchost.foo.com/xmlrpc/'
method='service.doSomething'
fault-code='var.fault-code'
fault-string='var.fault-string'>
<string>abc</string>
<if variable='var.rpc-use-float'>
<float>3.14159</float>
</if>
<else>
<int>3</int>
</else>
<array>
<int>1</int>
<string>&page.path;</string>
</array>
<struct>
<member name='x'><float>-37.45</float></member>
<member name='y'><float>0.055</float></member>
</struct>
<iso-date-time><date type='iso'/></iso-date-time>
</xml-rpc-call>
</set>
<then>
<p>XML-RPC call successful: &var.xml-rpc-result;</p>
</then>
<else>
<p>XML-RPC call failed: &var.fault-string; (code &var.fault-code;)</p>
</else> |
Attributes
- href="URL"
-
URL to the server to make the call to.
- method="string"
-
The name of the method.
- fault-code="variable"
-
If this attribute is present, the variable it specifies will
receive the fault code if the call fails.
- fault-string="variable"
-
If this attribute is present, the variable it specifies will
receive the fault string if the call fails.