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 [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
