title: Http 504 error while accessing URL from websphere
body: <p>I'm trying to hit a URL and get response by using <code>java.net.URL</code> by writing a java class and deploying it in websphere 7.
  I have ran this class successfully on local machine,development server using putty and local websphere server by calling it from a jsp.</p>
  
  <p>Now if I try to run the same on development websphere server, I'm getting the error :
  Server returned HTTP response code: 504 for URL: <a href="http://XX.XX.XX.XX:9080/smcfs/interop/InteropHttpServlet" rel="nofollow">http://XX.XX.XX.XX:9080/smcfs/interop/InteropHttpServlet</a></p>
  
  <p>I'm not able to understand why I'm able to get response in all three scenario but not in the case of development server.
  Do I need to do any configuartion changes in websphere like security or anything ?</p>
  
  <p>Here is the part of code where exception is thrown:</p>
  
  <pre><code>BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                 while ((line = rd.readLine()) != null) {
                     response += line;
                 }
  </code></pre>
  
  <p><code>connection.getInputStream()</code> is throwing the exception.</p>
  
  <p>Thanks in advance !</p>