此内容没有您所选择的语言版本。

Chapter 338. XML RPC DataFormat


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.

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

338.1. XmlRpc Dataformat Options

The XML RPC dataformat supports 2 options which are listed below.

Expand
NameDefaultJava TypeDescription

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.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部