4

We have one webservice which invokes third party webservice. To test this implementation we have different environments.

  • Local Developer Machine: When we run the application, everything works fine and our webservice is able to hit the third party URL. (Local Machine uses Windows OS)

  • Local Development Server: After deploying the application on development server, we are not able to access the third party URL and get Http Proxy 407 error. (We are having Linux, with IBM J9 JVM.)

To get around this problem, we tried setting -Dhttps.proxyUser XXX -Dhttps.proxyPassword XXX, but we continued to get the error. The second option we tried is using Authenticator.setDefault(new CustomImplAuthenticator()). But surprisingly, the JVM didnt invoke getPasswordAuthentication and continued to throw error.

We ran the same application again on local developer machine with authenticator.setdefault code. We could access the URL as said earlier, but this time again JVM didnt invoke getPasswordAuthentication method. After searching over net, we found that through NTLM the authentication data is resolved and hence we feel that the code is working on windows.

Can anyone let me know what settings, we should configure on application deployed in Linux box so that at least implementation assigned for Authenticator.setDefault will be invoked.

Stu Thompson
  • 38,370
  • 19
  • 110
  • 156
CuriousMind
  • 3,143
  • 3
  • 29
  • 54

1 Answers1

1

It depends on how you build up your http connection. if you for example use the Apache HTTPClient you can set the proxy configuration into the DefaultHttpClient by invoking setProxyAuthenticationHandler.

Your implementation that does the http call needs to know about the proxy.

Angelo Fuchs
  • 9,825
  • 1
  • 35
  • 72