[[xmlrpc-dataformat]]
= XML RPC DataFormat
:page-source: components/camel-xmlrpc/src/main/docs/xmlrpc-dataformat.adoc

*Available as of Camel version 2.11*


As the XmlRpc message could be request or response, when you use the
XmlRpcDataFormat, you need to specify the dataformat is for request or
not.

[source,xml]
-------------------------------------------------------------------------------------------------------------------------------------------------
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
 
    <!-- we define the xml rpc data formats to be used -->
    <dataFormats>
        <xmlrpc id="xmlrpcRequest" request="true"/>
        <xmlrpc id="xmlrpcResponse" request="false"/>
    </dataFormats>
 
    <route>
        <from uri="direct:request"/>
        <marshal ref="xmlrpcRequest"/>
        <unmarshal>
           <xmlrpc request="true"/>
        </unmarshal>
        <to uri="mock:request" />
    </route>
 
    <route>
        <from uri="direct:response"/>
        <marshal>
            <xmlrpc request="false"/>
        </marshal>
        <unmarshal ref="xmlrpcResponse"/>
        <to uri="mock:response" />
    </route>
</camelContext>
-------------------------------------------------------------------------------------------------------------------------------------------------

== XmlRpc Dataformat Options

// dataformat options: START
The XML RPC dataformat supports 2 options, which are listed below.



[width="100%",cols="2s,1m,1m,6",options="header"]
|===
| Name | Default | Java Type | Description
| request | false | Boolean | Whether to marshal/unmarshal request or response Is by default false
| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc.
|===
// dataformat options: END
// spring-boot-auto-configure options: START
== Spring Boot Auto-Configuration

When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-xmlrpc-starter</artifactId>
  <version>x.x.x</version>
  <!-- use the same version as your Camel core version -->
</dependency>
----


The component supports 5 options, which are listed below.



[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *camel.component.xmlrpc.enabled* | Enable xmlrpc component | true | Boolean
| *camel.component.xmlrpc.resolve-property-placeholders* | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | Boolean
| *camel.dataformat.xmlrpc.content-type-header* | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc. | false | Boolean
| *camel.dataformat.xmlrpc.enabled* | Enable xmlrpc dataformat | true | Boolean
| *camel.dataformat.xmlrpc.request* | Whether to marshal/unmarshal request or response Is by default false | false | Boolean
|===
// spring-boot-auto-configure options: END
ND