2014-07-17 2 views
0

내 로컬 개발 컴퓨터에서 작동하는 모든 SOAP 메시지에 스프링 -ws를 사용하는 스프링 애플 리케이션이 있습니다. 외부 세계에 도달하기 위해 트래픽을 위해 프록시를 사용해야하는 서버에 배포 할 때 나는 갇혀있는 것으로 보입니다. 나는 그런Spring - 프록시를 통한 모든 아웃 바운드 트래픽을 프록시로 연결합니다.

-Dhttp.proxyHost=proxyhostURL 
-Dhttp.proxyPort=proxyPortNumber 
-Dhttp.proxyUser=someUserName 
-Dhttp.proxyPassword=somePassword 

일부 JVM 인수를 설정할 수 있습니다 그러나 클래스 파일이 PROXYUSER과 된 proxyPassword 인수를 기리는 것 같지 않는 인상이었다.

나는 더욱 단계를 가져다가 자바 코드 자체 내에서 구현 :

System.getProperties().put("http.proxyHost", "someProxyURL"); 
System.getProperties().put("http.proxyPort", "someProxyPort"); 
System.getProperties().put("http.proxyUser", "someUserName"); 
System.getProperties().put("http.proxyPassword", "somePassword"); 

하지만 여전히 행운.

나는 다음 사용자 이름과 암호를 설정 java.net.Authenticator를 사용하려했지만 그 일을 나타나지 않습니다 중 하나

Authenticator.setDefault(
        new Authenticator() { 
        public PasswordAuthentication getPasswordAuthentication() { 
         return new PasswordAuthentication(authUser, authPassword.toCharArray()); 
        } 
        } 
       ); 

사람이 어떻게 행 노선의 모든 트래픽을 통해 어떤 제안이 있습니까 Java6, Tomcat 6 및 Spring 3 (스프링 - ws 사용)를 사용하는 프록시

답변

1

내 웹 서비스가 HTTPS를 사용하기 때문에 전달 된 JVM HTTP 인수를 따르지 못하는 것으로 나타났습니다. 플래그를 다음으로 설정 한 후 :

-Dhttps.proxyHost=proxyhostURL 
-Dhttps.proxyPort=proxyPortNumber 
-Dhttps.proxyUser=someUserName 
-Dhttps.proxyPassword=somePassword 

모두 계획 한대로 작동합니다.

+0

나는 이것이 인증 된 서버가 아닌 일반 Proxy Server를 통해서만 작동한다고 생각합니다. 'https.proxyUser'및 'https.proxyPassword'는 JVM args AFAIK가 아닙니다 ... – JoeG

관련 문제