You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Attila Vasarhelyi <dz...@freemail.hu> on 2012/03/29 13:04:21 UTC
Why do I get 407: Proxy Authentication Required
Hi,
I'm trying to write a simple ws client (maven, wsdl2java, client bean in an
osgi bundle), however I keep getting a 407 error:
org.apache.cxf.transport.http.HTTPException: HTTP response '407: Proxy
Authentication Required' when communicating with
http://10.211.250.79:8080/workflow/Authentication
Funny thing is, that with axis, or even SoapUI it does work (without hint to
any proxy).
My code is:
JaxWsProxyFactoryBean proxyFactory = new
JaxWsProxyFactoryBean();
proxyFactory.setServiceClass(Authentication.class);
proxyFactory.setAddress("http://"+flowerServer+"/workflow/Authentication");
Authentication authenticationPort = (Authentication)
proxyFactory.create();
String token = authenticationPort.login(remoteUserDomain,
remoteUser, remotePassword);
The request doesn't reach the target server (no trace in the access-log).
Suspecting that request are routed somehow via the company proxy I also
tried:
JaxWsProxyFactoryBean proxyFactory = new
JaxWsProxyFactoryBean();
proxyFactory.setServiceClass(Authentication.class);
proxyFactory.setAddress("http://"+flowerServer+"/workflow/Authentication");
Authentication authenticationPort = (Authentication)
proxyFactory.create();
Client client = ClientProxy.getClient(authenticationPort);
HTTPConduit http = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setAllowChunking(false);
httpClientPolicy.setProxyServer("cache.xxxx.intra");
httpClientPolicy.setProxyServerPort(3128);
httpClientPolicy.setProxyServerType(
org.apache.cxf.transports.http.configuration.ProxyServerType.HTTP);
ProxyAuthorizationPolicy policy = new
ProxyAuthorizationPolicy();
policy.setUserName("username");
policy.setPassword("password");
http.setProxyAuthorization(policy);
http.setClient(httpClientPolicy);
String token = authenticationPort.login(remoteUserDomain,
remoteUser, remotePassword);
I get the same result, regardless of valid/invalid proxy server, port,
username, password.
thanks
Attila Vasarhelyi
--
View this message in context: http://cxf.547215.n5.nabble.com/Why-do-I-get-407-Proxy-Authentication-Required-tp5603402p5603402.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Why do I get 407: Proxy Authentication Required
Posted by Daniel Kulp <dk...@apache.org>.
Any chance you could use Wireshark or similar to grab the raw "on the wire"
messages to see the headers that are being sent in each of the cases? I'd
like to be sure the proxy related headers are at least properly being sent.
Dan
On Thursday, March 29, 2012 04:04:21 AM Attila Vasarhelyi wrote:
> Hi,
>
> I'm trying to write a simple ws client (maven, wsdl2java, client bean in
> an osgi bundle), however I keep getting a 407 error:
>
> org.apache.cxf.transport.http.HTTPException: HTTP response '407: Proxy
> Authentication Required' when communicating with
> http://10.211.250.79:8080/workflow/Authentication
>
> Funny thing is, that with axis, or even SoapUI it does work (without hint
> to any proxy).
>
> My code is:
>
> JaxWsProxyFactoryBean proxyFactory = new
> JaxWsProxyFactoryBean();
> proxyFactory.setServiceClass(Authentication.class);
>
> proxyFactory.setAddress("http://"+flowerServer+"/workflow/Authentication")
> ; Authentication authenticationPort = (Authentication)
> proxyFactory.create();
>
> String token = authenticationPort.login(remoteUserDomain,
> remoteUser, remotePassword);
>
> The request doesn't reach the target server (no trace in the access-log).
> Suspecting that request are routed somehow via the company proxy I also
> tried:
>
> JaxWsProxyFactoryBean proxyFactory = new
> JaxWsProxyFactoryBean();
> proxyFactory.setServiceClass(Authentication.class);
>
> proxyFactory.setAddress("http://"+flowerServer+"/workflow/Authentication")
> ; Authentication authenticationPort = (Authentication)
> proxyFactory.create();
>
> Client client = ClientProxy.getClient(authenticationPort);
> HTTPConduit http = (HTTPConduit) client.getConduit();
>
> HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
> httpClientPolicy.setAllowChunking(false);
> httpClientPolicy.setProxyServer("cache.xxxx.intra");
> httpClientPolicy.setProxyServerPort(3128);
> httpClientPolicy.setProxyServerType(
>
> org.apache.cxf.transports.http.configuration.ProxyServerType.HTTP);
>
> ProxyAuthorizationPolicy policy = new
> ProxyAuthorizationPolicy();
> policy.setUserName("username");
> policy.setPassword("password");
>
> http.setProxyAuthorization(policy);
> http.setClient(httpClientPolicy);
>
> String token = authenticationPort.login(remoteUserDomain,
> remoteUser, remotePassword);
>
> I get the same result, regardless of valid/invalid proxy server, port,
> username, password.
>
> thanks
> Attila Vasarhelyi
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Why-do-I-get-407-Proxy-Authentication-Req
> uired-tp5603402p5603402.html Sent from the cxf-user mailing list archive
> at Nabble.com.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: Why do I get 407: Proxy Authentication Required
Posted by Michael Clark <em...@yahoo.com>.
Hi,
I am also having same problem as you mentioned and no way to resolve it.
Any change you got the resolution.
Thanks,
Michael.
--
View this message in context: http://cxf.547215.n5.nabble.com/Why-do-I-get-407-Proxy-Authentication-Required-tp5603402p5710695.html
Sent from the cxf-user mailing list archive at Nabble.com.