0
我喜歡在我的CXF端點定義中爲布爾屬性使用屬性佔位符。我已閱讀關於http://camel.apache.org/using-propertyplaceholder.html中的佔位符前綴的文檔,但ik無法弄清楚將其應用於我的端點配置。字符串佔位符正常工作。在下面的示例中,我使用布爾屬性$ {ws-logging},並且XML不會進行驗證。如何在CXF端點配置中爲布爾屬性使用屬性佔位符?駱駝:在CXF端點配置中使用布爾屬性的屬性佔位符
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:prop="http://camel.apache.org/schema/placeholder"
xmlns:camel-cxf="http://camel.apache.org/schema/blueprint/cxf"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://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">
<property-placeholder persistent-id="test.config" id="test.config.placeholder" xmlns="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">
<default-properties>
<property name="ws-logging" value="true"/>
</default-properties>
</property-placeholder>
<camel-cxf:cxfEndpoint id="update"
address="http://someaddress"
endpointName="ssp:someendpoint"
serviceName="ssp:someservice"
wsdlURL="http://someaddress/wsdl?targetURI=sometargeturi"
xmlns:ssp="somenamespace"
loggingFeatureEnabled="${ws-logging}">
<camel-cxf:properties>
<entry key="dataFormat" value="PAYLOAD"/>
</camel-cxf:properties>
</camel-cxf:cxfEndpoint>
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="timerToLog">
<from uri="timer:foo?period=5000"/>
<to uri="mock:result"/>
</route>
</camelContext>
</blueprint>
嘗試用負面結果解決您的問題。它看起來像布爾類型屬性只接受真正的布爾值,並且在camelcontext外部定義時沒有佔位符。所以,只接受true,false,0或1的值。 – Ewout