new DataOutputStream(connection.getOutputStream): connection refused issue
I am trying to send data to a 3rd party service by using below code. I get connection refused at line -wr = new DataOutputStream(connection.getOutputStream());
I am able to see logs before the above line but jumps to exception block once it executes this block.
The application is deployed on Wepsphere Application Server 7 and Websphere Portal Server 7. Have tried hitting the same url and proxy from server through perl script and browser, it works fine with these but breaks only when called from my code.
Any idea why this breaks and what could be the solution on this?
The RequisitionURL has https and have checked with application server and firewall team , they seem to have no issues with them.
final URL url = new URL(RequisitionURL);
connection = (HttpURLConnection) url.openConnection();
LOGGER.info("Before getting output stream");
wr = new DataOutputStream(connection.getOutputStream());