How to debug if your calls to external resources (web services calls) are passing through a proxy

JavaProblem

You need to consume an external resource via a web service and you are getting the next error on your server logs or in your browser:

Unable to tunnel through proxy. Proxy returns “HTTP/1.1 503 Service Unavailable”

proxy_doTunneling

And you don´t have any kind of access or documentation of the environments where your code is running that can tell you if there is a proxy configured or not.

How can you be sure that in fact there is a proxy? and that the Proxy is blocking the communication?, you can add next lines to your code to determine that:

if (LOG.isLoggable(WsLevel.INFO)) {
    if ( connection.usingProxy() ) {
        LOG.log(WsLevel.INFO, '-- doPost() -- Connection is using proxy');
    }
     
    String proxyHost = System.getProperty('http.proxyHost');
    if (null != proxyHost) {
        LOG.log(WsLevel.INFO, '-- doPost() -- http.proxyHost: ' + proxyHost);
    }
    String proxyPort = System.getProperty('http.proxyPort');
    if (null != proxyPort) {
        LOG.log(WsLevel.INFO, '-- doPost() -- http.proxyPort: ' + proxyPort);
    }
}

Kudos to my teammate Xavier Muniz by discover this solution.

I really hope you find this information useful.

Base22, LLC transforms enterprise portal design

Base22CreedFlagBase22 builds its solution on IBM Digital Experience technology. “What we’ve created is a software framework composed of building blocks designed to use the IBM platform, because we’ve found it to be the best available to support the dynamic, enterprise-scale solutions our customers expect.”Cody Burleson

You can read the full story here: Base22, LLC transforms enterprise portal design

I really hope you find this information useful.

IBM Digital Experience vNext Technical T3 sessions

WebSphereLogoAll of the presentations and replays of the IBM Portal v8.5 tech talks from April 23rd have been posted to Partner World

Hope you find this information useful!!