You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Aniruddha <an...@gmail.com> on 2014/11/12 04:43:25 UTC

How to configure proxy settings for cxf endpoint used in recipientList

Hi,

I am using recipientList to dynamically invoke an external webservice as
follows:

<camel:recipientList>
			
<camel:simple>cxf:${headers.callback.endpoint}?wsdlURL=classpath:adapters/communication/eventmanager/wsdls/event-notify-v1-0.wsdl&amp;dataFormat=PAYLOAD&amp;portName={http://xyz.com/event-notify-v1-0.wsdl}EventNotifySOAP12Port&amp;serviceName={http://xyz.com/event-notify-v1-0.wsdl}EventNotifyService</camel:simple>
			</camel:recipientList>

I want this cxf call to go through a proxy server. How to configure proxy
setting for cxf used in recipientlist?

I tried configuring "http-conf:conduit" but it didn't go through the proxy
server.

Could you please help?



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to configure proxy settings for cxf endpoint used in recipientList

Posted by Aniruddha <an...@gmail.com>.
Hi camel experts,

could you pls help with this problem?

On Wed, Nov 12, 2014 at 9:26 PM, Aniruddha [via Camel] <
ml-node+s465427n5758975h97@n5.nabble.com> wrote:

> I can;t modify the wsdl to configure http client since its external
> service and i am calling that service.
> I also tried using camel-jetty and camel-http which have
> proxyHost,proxyPort proerpties set but they return me 503 http error code
> even though the target service is up and running.
>
> Configuration with camel-http:
>
> <camel:route id="event-notify-route">
>
>                         <camel:from uri="seda:eventNotifyRequestQueue" />
>
>                         <camel:to
> uri="bean:eventManagerUtils?method=setInHeaderProperties"/>
>                         <camel:to
> uri="xslt://transformation/notify-event-request.xsl"/>
>                         <camel:log message="Event notify request:
> ${body}"></camel:log>
>                         <camel:setHeader headerName="CamelHttpMethod">
>                           <camel:constant>POST</camel:constant>
>                         </camel:setHeader>
>                         <camel:recipientList>
>                                 <camel:simple>
> http://10.1.107.71:8080?proxyHost=bhuxegpx.corp.dmz&proxyPort=8080
> </camel:simple>
>                         </camel:recipientList>
>                         <camel:log message="Event notify response:
> ${body}"></camel:log>
>                         <camel:to
> uri="seda:eventNotifyResponseProcessingQueue" />
>
>
>                 </camel:route>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5758975.html
>  To unsubscribe from How to configure proxy settings for cxf endpoint used
> in recipientList, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5758947&code=YW5pcnVkZGhhLmRpeGl0QGdtYWlsLmNvbXw1NzU4OTQ3fDEzNTgzNzA2Mjc=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5759010.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to configure proxy settings for cxf endpoint used in recipientList

Posted by Willem Jiang <wi...@gmail.com>.
10.1.107.71 is an internal network address, are you sure you need to use proxy to access it?

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 12, 2014 at 6:27:44 PM, Aniruddha (aniruddha.dixit@gmail.com) wrote:
> I can;t modify the wsdl to configure http client since its external service
> and i am calling that service.
> I also tried using camel-jetty and camel-http which have proxyHost,proxyPort
> proerpties set but they return me 503 http error code even though the target
> service is up and running.
>  
> Configuration with camel-http:
>  
>  
>  
>  
>  
>  
>  
>  
> POST
>  
>  
>  
> http://10.1.107.71:8080?proxyHost=bhuxegpx.corp.dmz&proxyPort=8080  
>  
>  
>  
>  
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5758975.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  


Re: How to configure proxy settings for cxf endpoint used in recipientList

Posted by Aniruddha <an...@gmail.com>.
I can;t modify the wsdl to configure http client since its external service
and i am calling that service.
I also tried using camel-jetty and camel-http which have proxyHost,proxyPort
proerpties set but they return me 503 http error code even though the target
service is up and running.

Configuration with camel-http:

<camel:route id="event-notify-route">
		
			<camel:from uri="seda:eventNotifyRequestQueue" />		
			<camel:to uri="bean:eventManagerUtils?method=setInHeaderProperties"/>
			<camel:to uri="xslt://transformation/notify-event-request.xsl"/>
			<camel:log message="Event notify request: ${body}"></camel:log>
			<camel:setHeader headerName="CamelHttpMethod">
			  <camel:constant>POST</camel:constant>
			</camel:setHeader>
			<camel:recipientList>
			
<camel:simple>http://10.1.107.71:8080?proxyHost=bhuxegpx.corp.dmz&amp;proxyPort=8080</camel:simple>
			</camel:recipientList>
			<camel:log message="Event notify response: ${body}"></camel:log>
			<camel:to uri="seda:eventNotifyResponseProcessingQueue" />
											
		</camel:route>



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5758975.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to configure proxy settings for cxf endpoint used in recipientList

Posted by Aniruddha <an...@gmail.com>.
Could you pls point me to the example of  configuring http client from the
wsdl?
On 12 Nov 2014 18:28, "Willem.Jiang [via Camel]" <
ml-node+s465427n5758958h70@n5.nabble.com> wrote:

> When you use the http-conf:conduit, camel-cxf can pick up right CXF bus
> which holds the reference the Spring application context from thread local
> variable. But if you use recipientList, the camel-cxf endpoint could be
> create in different thread other then the thread which creates the Spring
> application context.
>
> As CXF support to configure the http client from the WSDL[1], you can try
> to do it that way.
>
> In Camel 2.15.0 we introduce a CxfEndpointConfigurer which supports to
> configure the CXF client or the server from Java code.
>
> [1]
> https://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-UsingWSDL
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> Web: http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
> On November 12, 2014 at 1:58:04 PM, Aniruddha ([hidden email]
> <http://user/SendEmail.jtp?type=node&node=5758958&i=0>) wrote:
>
> > Hi,
> >
> > I am using recipientList to dynamically invoke an external webservice as
> > follows:
> >
> >
> >
> >
> cxf:${headers.callback.endpoint}?wsdlURL=classpath:adapters/communication/eventmanager/wsdls/event-notify-v1-0.wsdl&dataFormat=PAYLOAD&portName={
> http://xyz.com/event-notify-v1-0.wsdl}EventNotifySOAP12Port&serviceName={
> http://xyz.com/event-notify-v1-0.wsdl}EventNotifyService
> >
> >
> > I want this cxf call to go through a proxy server. How to configure
> proxy
> > setting for cxf used in recipientlist?
> >
> > I tried configuring "http-conf:conduit" but it didn't go through the
> proxy
> > server.
> >
> > Could you please help?
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947.html
>
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5758958.html
>  To unsubscribe from How to configure proxy settings for cxf endpoint used
> in recipientList, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5758947&code=YW5pcnVkZGhhLmRpeGl0QGdtYWlsLmNvbXw1NzU4OTQ3fDEzNTgzNzA2Mjc=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5758959.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to configure proxy settings for cxf endpoint used in recipientList

Posted by Willem Jiang <wi...@gmail.com>.
When you use the http-conf:conduit, camel-cxf can pick up right CXF bus which holds the reference the Spring application context from thread local variable. But if you use recipientList, the camel-cxf endpoint could be create in different thread other then the thread which creates the Spring application context.

As CXF support to configure the http client from the WSDL[1], you can try to do it that way.

In Camel 2.15.0 we introduce a CxfEndpointConfigurer which supports to configure the CXF client or the server from Java code.

[1]https://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-UsingWSDL

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 12, 2014 at 1:58:04 PM, Aniruddha (aniruddha.dixit@gmail.com) wrote:
> Hi,
>  
> I am using recipientList to dynamically invoke an external webservice as
> follows:
>  
>  
>  
> cxf:${headers.callback.endpoint}?wsdlURL=classpath:adapters/communication/eventmanager/wsdls/event-notify-v1-0.wsdl&dataFormat=PAYLOAD&portName={http://xyz.com/event-notify-v1-0.wsdl}EventNotifySOAP12Port&serviceName={http://xyz.com/event-notify-v1-0.wsdl}EventNotifyService  
>  
>  
> I want this cxf call to go through a proxy server. How to configure proxy
> setting for cxf used in recipientlist?
>  
> I tried configuring "http-conf:conduit" but it didn't go through the proxy
> server.
>  
> Could you please help?
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  


Re: How to configure proxy settings for cxf endpoint used in recipientList

Posted by Aniruddha <an...@gmail.com>.
HI Experts,

Could you please help with this problem?



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-configure-proxy-settings-for-cxf-endpoint-used-in-recipientList-tp5758947p5758956.html
Sent from the Camel - Users mailing list archive at Nabble.com.