cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Attila Vasarhelyi <dz...@freemail.hu>
Subject Why do I get 407: Proxy Authentication Required
Date Thu, 29 Mar 2012 11:04:21 GMT
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.

Mime
View raw message