Weblogic setting for proxy

2019-08-21 11:08发布

I have a problem with configuration of proxy to connect to WebService on Weblogic 10.3.5. I cannot use System.setProperty() because it has to be per connection aproach. Proxy which I have to use has to have "UserAgent" header.

I have tried two options:

  1. ClientProxyFeature but it doesn't work because it generate request to proxy without "UserAgent header".
  2. ProxySelector: this approach work great on JUnit test but when I run it on Weblogic I receive following error

error: java.net.SocketException: Unknown proxy type : HTTP at...

Is there any way to work this around? Many Thanks in advance

Adam

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-08-21 11:46

To configure WebLogic proxy file is modified setDomainEnv.cmd (Windows) that is located in the bin folder of the domain.

For example for the integrated server is here

C: \ Users \ [YOUT USER NAME] \ AppData \ Roaming \ JDeveloper \ system11.1.1.4.37.59.23 \ DefaultDomain \ bin

The following property must be placed on file with the details of your proxy

@REM Estableciendo proxi 
set JAVA_OPTIONS=%JAVA_OPTIONS% -Dhttp.proxySet=true -Dhttp.proxyHost=192.168.101.11 -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=localhost

See the next link

Proxi in WebLogic

查看更多
劫难
3楼-- · 2019-08-21 11:51

We are able to do this with ProxySelector. The only thing which we have changed was server start parameter: -DUseSunHttpHandler=true. Now it works and send User-Agent header.

查看更多
登录 后发表回答