4

Basically, I'm trying to make SOAP calls from a Tomcat server via a corporate proxy/ firewall (which I have no direct control over), I've tried to add info to the catalina.properties file as shown:

http.proxyPort=80
http.proxyHost=www-proxy.company.com

I'm still getting timeouts in the stdout logs. Do I need to do anything else and if not is there another way to test the SOAP calls?

2
  • Is your corporate proxy listening on port 80? Does it require authentication?
    – sybreon
    Sep 3, 2010 at 3:16
  • Yes it's listening on port 80, no authentication required.
    – alimack
    Sep 4, 2010 at 13:11

4 Answers 4

8

Create a setenv.sh (or setenv.bat if running windows), if you don't already have one, and add the following java options:

JAVA_OPTS="-Dhttp.proxySet=true -Dhttp.proxyHost=<proxy_hostname> -Dhttp.proxyPort=<port_number> -Dhttp.nonProxyHosts=<domain_one>|<domain two> $JAVA_OPTS"

This should work nicely.

3
  • http.nonProxyHosts (default: localhost|127.*|[::1]) prevents testing localhost APIs, so I am using this setting for that case -Dhttp.nonProxyHosts= (empty value) to override default. See docs.oracle.com/javase/7/docs/api/java/net/doc-files/…
    – David
    Oct 28, 2019 at 5:59
  • '|' will be pasred as pipeline operator, as tomcat using eval
    – WestFarmer
    Oct 15, 2021 at 7:08
  • For Tomcat 9, it fails to read the nonProxyHosts with a "|" in it. Does the value have to be surrounded by quotes to have it work?? Example: -Dhttp.nonProxyHosts=*.google.com|*.yahoo.com
    – dev4life
    Feb 24, 2022 at 14:14
2

You can implement HTTP proxy, https proxy and non-http proxy also in tomcat. You need to update two files i.e, ../bin/Catalina.sh and ../conf/cataliana.properties.

Detailed configuration and steps are mentioned here : http://w3devops.com/add-http-https-proxy-http-non-proxy-jenkins-via-tomcat-server/

0

If you only need soap calls to go via proxy, you can use jproxyloader. With this library you can pass soap calls via proxy and all the other calls will not use proxy. See http://jproxyloader.sourceforge.net/examples/web-application-on-tomcat.html for complete setup.

-1

To get tomcat running inside my docker container I used the following settings:

JAVA_OPTS=-Dhttps.proxyHost=PROXYHOST -Dhttps.proxyPort=PROXYPORT -DproxySet=true -DproxyHost=PROXYHOST -DproxyPort=PROXYPORT

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.