You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ychawla <pr...@yahoo.com> on 2012/03/05 23:03:39 UTC

RE: CXF endpoint's address dynamically modified?

Hello All,
I think this would be a great feature to have available with a cxf bean URI
configuration.  Consider the use case where Camel is acting as an
intermediary broker/facade for other services.  The broker and the services
it fronts all share the same WSDL and service definition.  The only
difference is the address.

Currently, you can use the URI format of:

cxf://someAddress[?options]

However, then you have have to manually configure CXF features using the CXF
bus.  However, if you could have a URI interface like below, you can
configure your CXF features and interceptors on the bean:

cxf:myCXFBean?address=${in.headers.addressToSendTo}

This header can be set dynamically and only one CXF bean would be need to
act as a client for multiple services.  For now, I will set up one cxf bean
per address that I am sending to.  

Thanks,
Yogesh

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5539094.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF endpoint's address dynamically modified?

Posted by Claus Ibsen <cl...@gmail.com>.
See this FAQ
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

On Tue, Dec 8, 2015 at 8:08 AM, Shekh <sh...@gmail.com> wrote:
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
>
> Is not working.
>
> I have deployed same service one or more places, Service is same only
> address is defferent.
> I want to provide service address at runtime.
>
> when i get value from header which is i have set get following exception
>
> Caused by: java.net.URISyntaxException: Illegal character in path at index
> 1: ${in.headers.ServiceUri}
>         at java.net.URI$Parser.fail(URI.java:2848)[:1.8.0_45]
>         at java.net.URI$Parser.checkChars(URI.java:3021)[:1.8.0_45]
>         at java.net.URI$Parser.parseHierarchical(URI.java:3105)[:1.8.0_45]
>         at java.net.URI$Parser.parse(URI.java:3063)[:1.8.0_45]
>         at java.net.URI.<init>(URI.java:588)[:1.8.0_45]
>         at
> org.apache.cxf.transport.http.HTTPConduit.getURI(HTTPConduit.java:734)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
>         at
> org.apache.cxf.transport.http.HTTPConduit.getURI(HTTPConduit.java:722)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
>         at
> org.apache.cxf.transport.http.HTTPConduit.setupAddress(HTTPConduit.java:678)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
>         at
> org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:487)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
>         ... 85 more
>
> In my camel route
>
> <to pattern="InOut"
> uri="cxf:bean:SpWebService?address=${in.headers.ServiceUri}"/>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5774808.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

RE: CXF endpoint's address dynamically modified?

Posted by Shekh <sh...@gmail.com>.
Finally I Found the solution.

here my Service CXf endpoint is 

 <cxf:cxfEndpoint id="SpWebService" 
	       serviceClass="in.gov.mit.sp.service.SEI.ConnectSubmitPortType">
	       <cxf:properties>
        		<entry key="dataFormat" value="POJO"/>
        		<entry key="operationName" value="processSubmitDocument"/>
        		<entry key="operationNamespace"
value="http://www.mit.gov.in/eGov/schema/ConnectorServices/wsdl"/>
    	   </cxf:properties>  	   
</cxf:cxfEndpoint>	

than, i have create a header called serviceuri and use recipientList

<recipientList>
		<simple>cxf:bean:SpWebService?address=${header.ServiceUri}</simple>
</recipientList>

provide service addree at run time.








--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5775859.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: CXF endpoint's address dynamically modified?

Posted by Shekh <sh...@gmail.com>.
cxf:myCXFBean?address=${in.headers.addressToSendTo}

Is not working.

I have deployed same service one or more places, Service is same only
address is defferent.
I want to provide service address at runtime.

when i get value from header which is i have set get following exception

Caused by: java.net.URISyntaxException: Illegal character in path at index
1: ${in.headers.ServiceUri}
        at java.net.URI$Parser.fail(URI.java:2848)[:1.8.0_45]
        at java.net.URI$Parser.checkChars(URI.java:3021)[:1.8.0_45]
        at java.net.URI$Parser.parseHierarchical(URI.java:3105)[:1.8.0_45]
        at java.net.URI$Parser.parse(URI.java:3063)[:1.8.0_45]
        at java.net.URI.<init>(URI.java:588)[:1.8.0_45]
        at
org.apache.cxf.transport.http.HTTPConduit.getURI(HTTPConduit.java:734)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
        at
org.apache.cxf.transport.http.HTTPConduit.getURI(HTTPConduit.java:722)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
        at
org.apache.cxf.transport.http.HTTPConduit.setupAddress(HTTPConduit.java:678)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
        at
org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:487)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
        ... 85 more

In my camel route

<to pattern="InOut"
uri="cxf:bean:SpWebService?address=${in.headers.ServiceUri}"/>










--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5774808.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: CXF endpoint's address dynamically modified?

Posted by Jens <sm...@dzbank.de>.
ychawla wrote
> 
> Currently, you can use the URI format of:
> 
> cxf://someAddress[?options]
> 
> However, then you have have to manually configure CXF features using the
> CXF bus.  However, if you could have a URI interface like below, you can
> configure your CXF features and interceptors on the bean:
> 
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
> 

Just use cxf:bean:myEp where myEP is a cxfEndpoint.

Best,
Jens

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5540241.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: CXF endpoint's address dynamically modified?

Posted by Jens <sm...@dzbank.de>.
ychawla wrote
> 
> Currently, you can use the URI format of:
> 
> cxf://someAddress[?options]
> 
> However, then you have have to manually configure CXF features using the
> CXF bus.  However, if you could have a URI interface like below, you can
> configure your CXF features and interceptors on the bean:
> 
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
> 

Just use "cxf:bean:myEp" where myEP is a cxfEndpoint.

Best,
Jens

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5540234.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: CXF endpoint's address dynamically modified?

Posted by Jens <sm...@dzbank.de>.
ychawla wrote
> 
> Currently, you can use the URI format of:
> 
> cxf://someAddress[?options]
> 
> However, then you have have to manually configure CXF features using the
> CXF bus.  However, if you could have a URI interface like below, you can
> configure your CXF features and interceptors on the bean:
> 
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
> 

Just use cxf:bean:myEp where myEP is a cxfEndpoint.

Best,
Jens

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5540239.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: CXF endpoint's address dynamically modified?

Posted by Jens <sm...@dzbank.de>.
ychawla wrote
> 
> Currently, you can use the URI format of:
> 
> cxf://someAddress[?options]
> 
> However, then you have have to manually configure CXF features using the
> CXF bus.  However, if you could have a URI interface like below, you can
> configure your CXF features and interceptors on the bean:
> 
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
> 

Just use cxf:bean:myEp where myEP is a cxfEndpoint.

Best,
Jens

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5540235.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: CXF endpoint's address dynamically modified?

Posted by Jens <sm...@dzbank.de>.
ychawla wrote
> 
> Currently, you can use the URI format of:
> 
> cxf://someAddress[?options]
> 
> However, then you have have to manually configure CXF features using the
> CXF bus.  However, if you could have a URI interface like below, you can
> configure your CXF features and interceptors on the bean:
> 
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
> 

Just use cxf:bean:myEp where myEP is a cxfEndpoint.

Best,
Jens

--
View this message in context: http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5540238.html
Sent from the Camel - Users mailing list archive at Nabble.com.