0

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

dev2d
  • 4,245
  • 3
  • 31
  • 54
Adam
  • 884
  • 7
  • 29
  • read this: http://stackoverflow.com/questions/120797/how-do-i-set-the-proxy-to-be-used-by-the-jvm – BMW Apr 06 '14 at 03:15
  • I cannot use System.setProperty() because it has to be per connection approach. From [link](http://docs.oracle.com/cd/E17904_01/apirefs.1111/e13941/weblogic/wsee/jaxws/proxy/ClientProxyFeature.html) I read that this can be done by using ClientProxyFeature class but the header of the request is not proper for proxy which I have to use (as I wrote I has to have "UserAgent" header and request from ClientProxyFeature doesn't have it). – Adam Apr 06 '14 at 10:54

2 Answers2

1

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.

Adam
  • 884
  • 7
  • 29
0

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

Ronald Coarite
  • 4,460
  • 27
  • 31