骆驼蓝图中使用cxfendpoint的基本身份验证

时间:2020-05-19 17:18:09

标签: apache-camel cxf jbossfuse blueprint-osgi

我在aries蓝图文件xml中定义了一个cxf bean,我想使用基本身份验证从外部调用它。骆驼版本是2.15.1.redhat-621084。我有以下xml:

    <?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:camel="http://camel.apache.org/schema/blueprint"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
           xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
           xmlns:cxfcore="http://cxf.apache.org/blueprint/core"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 
                        https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd 
                        http://camel.apache.org/schema/blueprint 
                        http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">

    <cxf:cxfEndpoint id="myCxf"
                     address="http://0.0.0.0:57559/service"
                     serviceClass="com.example.PortType">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD"/>
        </cxf:properties>
    </cxf:cxfEndpoint>
    <camelContext id="id1" autoStartup="true" trace="false" useMDCLogging="false"
                  xmlns="http://camel.apache.org/schema/blueprint">

        <route>
            <from id="f1" uri="cxf:bean:myCxf?username=admin&amp;password=admin"/>
            <to uri="log:request"/>
        </route>
    </camelContext>
</blueprint>

问题在于用户名和密码被跳过,因此我可以在没有凭据的情况下调用服务。如何使用cxf执行基本身份验证?

0 个答案:

没有答案