You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Fernando Cesar da Silva <fs...@synchro.com.br> on 2014/03/12 20:02:49 UTC

How to consume a Rest Web Service passing through a proxy server

Hi, 

I'm using CXFRS Component to consume a Rest Web Service and everything is working fine so far. 

Now I have to make the connection go through a proxy server. 

Using the HTTP Component, I have explicitly set the proxy in CamelContext and the connection reach the proxy as expected, but the CXFRS Component seems to ignore these settings. 





CamelContext context = obterCamelContext() 
context.getProperties().put("http.proxyHost","cavmtapp99") 
context.getProperties().put("http.proxyPort","3128") 




How / where could I set my proxy host and port to the CXFRS Component? 




Thanks! 
Fernando Cesar 


Re: How to consume a Rest Web Service passing through a proxy server

Posted by dan carter <da...@vodafone.com>.
Hi,

I have a similar problem.

I can see how in the cxf component i would configure the proxy server, but i
cannot see how to configure the component from camel.

How do i configure the cxf component using the java DSL?

here is my route

return new RouteBuilder() {

            public void configure() {
                from("direct:start")
                .process(sp)
               
.to("cxf:http://examplehost.com:8088/mockEstimateWebServiceBinding?dataFormat=PAYLOAD")
                .to("mock:result");
            }
        };

Thanks in advance,
Dan.



Aki Yoshida-3 wrote
> If you are using the cxf component, you will need to configure the
> client setting in the cxf component.
> Here is the link:
> https://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-Theclientelement
> 
> regards, aki





--
View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-a-Rest-Web-Service-passing-through-a-proxy-server-tp5748722p5749359.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to consume a Rest Web Service passing through a proxy server

Posted by Richard Kettelerij <ri...@gmail.com>.
You should be able to just specify the username and password in the URL
since Camel 2.12.3. See available options: http://camel.apache.org/cxf.html.
E.g.

to("cxf://.....&username=foo&password=bar");

Regards,
Richard
http://richardlog.com


On Thu, Apr 3, 2014 at 4:38 PM, Fernando Cesar da Silva <
fsilva@synchro.com.br> wrote:

>
>
> Thanks for the help.
>
> One more question, what if my proxy (not NTLM) require user/pass to
> authenticate? The CXF Client Element doesn't have these attributes.
>
> Regards.
> Fernando Cesar
>
> ----- Mensagem original -----
> De: "Aki Yoshida" <el...@gmail.com>
> Para: users@camel.apache.org
> Enviadas: Quarta-feira, 12 de março de 2014 18:15:57
> Assunto: Re: How to consume a Rest Web Service passing through a proxy
> server
>
> If you are using the cxf component, you will need to configure the
> client setting in the cxf component.
> Here is the link:
>
> https://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-Theclientelement
>
> regards, aki
>
> 2014-03-12 20:02 GMT+01:00 Fernando Cesar da Silva <fsilva@synchro.com.br
> >:
> > Hi,
> >
> > I'm using CXFRS Component to consume a Rest Web Service and everything
> is working fine so far.
> >
> > Now I have to make the connection go through a proxy server.
> >
> > Using the HTTP Component, I have explicitly set the proxy in
> CamelContext and the connection reach the proxy as expected, but the CXFRS
> Component seems to ignore these settings.
> >
> >
> >
> >
> >
> > CamelContext context = obterCamelContext()
> > context.getProperties().put("http.proxyHost","cavmtapp99")
> > context.getProperties().put("http.proxyPort","3128")
> >
> >
> >
> >
> > How / where could I set my proxy host and port to the CXFRS Component?
> >
> >
> >
> >
> > Thanks!
> > Fernando Cesar
> >
>

Re: How to consume a Rest Web Service passing through a proxy server

Posted by Fernando Cesar da Silva <fs...@synchro.com.br>.

Thanks for the help.

One more question, what if my proxy (not NTLM) require user/pass to authenticate? The CXF Client Element doesn't have these attributes.

Regards.
Fernando Cesar

----- Mensagem original -----
De: "Aki Yoshida" <el...@gmail.com>
Para: users@camel.apache.org
Enviadas: Quarta-feira, 12 de março de 2014 18:15:57
Assunto: Re: How to consume a Rest Web Service passing through a proxy server

If you are using the cxf component, you will need to configure the
client setting in the cxf component.
Here is the link:
https://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-Theclientelement

regards, aki

2014-03-12 20:02 GMT+01:00 Fernando Cesar da Silva <fs...@synchro.com.br>:
> Hi,
>
> I'm using CXFRS Component to consume a Rest Web Service and everything is working fine so far.
>
> Now I have to make the connection go through a proxy server.
>
> Using the HTTP Component, I have explicitly set the proxy in CamelContext and the connection reach the proxy as expected, but the CXFRS Component seems to ignore these settings.
>
>
>
>
>
> CamelContext context = obterCamelContext()
> context.getProperties().put("http.proxyHost","cavmtapp99")
> context.getProperties().put("http.proxyPort","3128")
>
>
>
>
> How / where could I set my proxy host and port to the CXFRS Component?
>
>
>
>
> Thanks!
> Fernando Cesar
>

Re: How to consume a Rest Web Service passing through a proxy server

Posted by Aki Yoshida <el...@gmail.com>.
If you are using the cxf component, you will need to configure the
client setting in the cxf component.
Here is the link:
https://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-Theclientelement

regards, aki

2014-03-12 20:02 GMT+01:00 Fernando Cesar da Silva <fs...@synchro.com.br>:
> Hi,
>
> I'm using CXFRS Component to consume a Rest Web Service and everything is working fine so far.
>
> Now I have to make the connection go through a proxy server.
>
> Using the HTTP Component, I have explicitly set the proxy in CamelContext and the connection reach the proxy as expected, but the CXFRS Component seems to ignore these settings.
>
>
>
>
>
> CamelContext context = obterCamelContext()
> context.getProperties().put("http.proxyHost","cavmtapp99")
> context.getProperties().put("http.proxyPort","3128")
>
>
>
>
> How / where could I set my proxy host and port to the CXFRS Component?
>
>
>
>
> Thanks!
> Fernando Cesar
>