You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by cexbrayat <ce...@sqli.com> on 2011/09/28 10:36:49 UTC
CXF endpoint and properties
Hi,
I'm trying to do a very simple thing : externalize a few properties of my
endpoints in a file (some properties such as the endpoint's address depends
on the target platform) but I can't get it done.
Here's my camel-context.xml
<bean id="referentielProperties"
class="org.apache.camel.component.properties.PropertiesComponent">
<property name="location" value="classpath:endpoint.properties" />
</bean>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<package>com.groupemb</package>
</camelContext>
<cxf:cxfEndpoint id="referentielOut" address="{{referentiel.address}}"
wsdlURL="{{referentiel.wsdl}}" serviceName="tns:PanierApiService"
endpointName="tns:PanierApiPort" xmlns:tns="{{referentiel.namespace}}">
<cxf:properties>
<entry key="dataFormat" value="PAYLOAD" />
</cxf:properties>
</cxf:cxfEndpoint>
I thought it would be pretty straightforward but I might be missing
something as my properties aren't replaced. I also tried to use a Spring
PropertyPlaceholder instead of Camel PropertiesComponent. I shall add that
everything works fine without properties.
Any ideas ?
--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-and-properties-tp4848384p4848384.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: CXF endpoint and properties
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jan 25, 2013 at 11:39 PM, jdev.hari <jd...@gmail.com> wrote:
> Hi,
>
> I am using 2.10.1. Is it possible to you spring place holders? something
> like
>
> <cxf:cxfEndpoint id="referentielOut" address="${Props:WSUrl}"
> ....
> ....
>
> Regards,
> Hari
>
Why don't you just try it?
Though if inside the <camelContext> then you cannot. See this FAQ
http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html
Its a limitation in Spring itself.
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-and-properties-tp4848384p5726303.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: CXF endpoint and properties
Posted by "jdev.hari" <jd...@gmail.com>.
Hi,
I am using 2.10.1. Is it possible to you spring place holders? something
like
<cxf:cxfEndpoint id="referentielOut" address="${Props:WSUrl}"
....
....
Regards,
Hari
--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-and-properties-tp4848384p5726303.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: CXF endpoint and properties
Posted by Willem Jiang <wi...@gmail.com>.
No, it is only supported in Camel 2.9.0.
On Tue Nov 22 20:53:38 2011, kafe wrote:
> Is the same thing possible with camel 2.8.2 ?
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-and-properties-tp4848384p5013449.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang
Re: CXF endpoint and properties
Posted by kafe <er...@gmail.com>.
Is the same thing possible with camel 2.8.2 ?
--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-and-properties-tp4848384p5013449.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: CXF endpoint and properties
Posted by cexbrayat <ce...@sqli.com>.
It's working great with 2.9-SNAPSHOT and the following context
(propertyPlaceholder needs to be declared in the camel context)
<camelContext xmlns="http://camel.apache.org/schema/spring">
<propertyPlaceholder id="properties"
location="classpath:endpoint.properties"/>
<package>com.groupemb</package>
</camelContext>
<cxf:cxfEndpoint id="referentielOut" address="{{referentiel.address}}"
wsdlURL="{{referentiel.wsdl}}" serviceName="{{referentiel.service}}"
endpointName="{{referentiel.endpoint}}">
<cxf:properties>
<entry key="dataFormat" value="PAYLOAD" />
</cxf:properties>
</cxf:cxfEndpoint>
Thanks Willem !
--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-and-properties-tp4848384p4848812.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: CXF endpoint and properties
Posted by Willem Jiang <wi...@gmail.com>.
Hi
If you are using Camel 2.9.0-SNPSHOT, the cxfEndpoint support
placeholders out of box.
As the cxfEndpoint can't deal with the xmlns:tns with the placeholder,
You have to use the placeholders on the serviceName and endpointName
like this
<cxf:cxfEndpoint id="referentielOut" address="{{referentiel.address}}"
wsdlURL="{{referentiel.wsdl}}"
serviceName="{referentiel.serviceName}"
endpointName="{referentiel.endpointName}" />
You can find more information about the issue CAMEL-4351[1]
[1]https://issues.apache.org/jira/browse/CAMEL-4351
On Wed Sep 28 16:36:49 2011, cexbrayat wrote:
> Hi,
>
> I'm trying to do a very simple thing : externalize a few properties of my
> endpoints in a file (some properties such as the endpoint's address depends
> on the target platform) but I can't get it done.
>
> Here's my camel-context.xml
>
> <bean id="referentielProperties"
> class="org.apache.camel.component.properties.PropertiesComponent">
> <property name="location" value="classpath:endpoint.properties" />
> </bean>
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> <package>com.groupemb</package>
> </camelContext>
>
> <cxf:cxfEndpoint id="referentielOut" address="{{referentiel.address}}"
> wsdlURL="{{referentiel.wsdl}}" serviceName="tns:PanierApiService"
> endpointName="tns:PanierApiPort" xmlns:tns="{{referentiel.namespace}}">
> <cxf:properties>
> <entry key="dataFormat" value="PAYLOAD" />
> </cxf:properties>
> </cxf:cxfEndpoint>
>
> I thought it would be pretty straightforward but I might be missing
> something as my properties aren't replaced. I also tried to use a Spring
> PropertyPlaceholder instead of Camel PropertiesComponent. I shall add that
> everything works fine without properties.
>
> Any ideas ?
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-and-properties-tp4848384p4848384.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang