The HTTP Proxy related functionalities of JBoss Web Services are provided by the Apache CXF http transport layer.
The suggested configuration mechanism when running JBoss Web Services is explained below; for further information please refer to the Apache CXF documentation.
The HTTP proxy configuration for a given JAX-WS client can be set in the following ways:
- through the http.proxyHost and http.proxyPort system properties, or
- leveraging the org.apache.cxf.transport.http.HTTPConduit options
The former is a JVM level configuration; for instance, assuming the http proxy is currently running at http://localhost:9934, here is the setup:
The latter is a client stub/port level configuration: the setup is performed on the HTTPConduit object that's part of the Apache CXF Client abstraction.
The ProxyAuthorizationPolicy also allows for setting the authotization type as well as the username / password to be used.
Speaking of authorization and authentication, please note that the JDK already features the java.net.Authenticator facility, which is used whenever opening a connection to a given URL requiring a http proxy. Users might want to set a custom Authenticator for instance when needing to read WSDL contracts before actually calling into the JBoss Web Services / Apache CXF code; here is an example: