Table Of Contents
- Use case
- General description
- The different parts of the XML-RPC Transformer
Use case
The function of an XML-RPC Transformer is to interact with an XML-RPC API end-point with the implementation of an entity transformer. This can be used to collect data from an XML-RPC endpoint based on previously obtained data.
General description
The XML-RPC Transformer can be used to interact with an XML-RPC web service. The service is able to call certain methods that are registered on the server. These methods may or may not include arguments, which are added to the request parameters.
XML-RPC Transformer is a transformer that acts the same way as HTTP Transformer and SOAP Transformer do. They replace the whole entity with the value it returns (response to the request). So, if we want to merge the response with the current entity, you should use it inside a Merger Transformer, such as the below picture.
The different parts of the XML-RPC Transformer
-
Request URI (required field)
This field describes the location where the service can be found. Fill in this field with the XML-RPC endpoint that is going to be called. -
Request parameters
This defines the payload that is sent along with the request, which consists of the arguments of the called remote method. It will be mapped to themethodCall
→params
element of the XML-RPC request payload. You can refer to this topic about How to map with Serialize: XML to guide you on how to fill in the field as JSON object so it can be correctly transformed to the XML payload you need for the XML-RPC request. -
Remote Procedure (required field)
This specifies the name of the method that needs to be executed on the target endpoint. It will be mapped to themethodCall
→methodName
element of the XML-RPC request payload. -
HTTP Client (required field)
This is the HTTP client that is used to communicate with the endpoint. While the default is used as the standard, if additional configuration or authentication is required then a custom client can be configured.
The sample XML-RPC Transformer usage we attached in the picture above executes the HTTP request below.
Sample data
Input data
{ "identifier": 1234 }
Request URI
https://example.org/xml-rpc
Remote Procedure
GetProductById
Request parameters
{ "identifier": "&{identifier}" }
Result
{ "identifier": 1234, "name": "T-Shirt", "price": 19.95 }