title: Reasons for a HTTP 503 Service unavailable Error
body: <p>At work i have to implement an EDI thing. I have to create an XML message, sign it with a certificate, encode it with <code>Base64</code>, pack it in an XML structure and send it to a server.
  To send the message to the soap service i use <a href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java" rel="nofollow">HTTPSOAPConnection</a>. The problem i ran into is, that i always get a <code>503 service unavailable</code> error.<br>
  I thought okay the service is not started, but for curiosity i tryed to reach it with <code>SoapUi</code>. Sending the same message to the same service endpoint i get a <code>HTTP 200 Ok</code>, with a response message.<br>
  Analyzing this response i have found, that there is a <code>Base64</code> encoed xml inside, like the service documentation said. Decoding this i found out, that the server sent me an error code, saying that the service is unavailable.<br>
  But how can it be, that with my java generated request i get a 503 and with SoapUi i get a service specific response, containing the service specific error code for 503?
  The only thing i can think about is, that something is wrong with my request. But what other reasons can a Http 503 have? How can i analyze the error (for example comparing the <code>MimeHeader</code> of SoapUi with mine...)?
  One more information i can give you is the block in which the error occures: Starting at line 245 of <a href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java" rel="nofollow">HTTPSOAPConnection</a> </p>
  
  <pre><code>responseCode = httpConnection.getResponseCode();
  // let HTTP_INTERNAL_ERROR (500) through because it is used for SOAP faults
  if (responseCode == HttpURLConnection.HTTP_INTERNAL_ERROR) {
      isFailure = true;
  }
  //else if (responseCode != HttpURLConnection.HTTP_OK)
  //else if (!(responseCode &gt;= HttpURLConnection.HTTP_OK &amp;&amp; responseCode &lt; 207))
  else if ((responseCode / 100) != 2) {
      log.log(Level.SEVERE,
      "SAAJ0008.p2p.bad.response",
      new String[] {httpConnection.getResponseMessage()});
      throw new SOAPExceptionImpl(
          "Bad response: ("
          + responseCode
          + httpConnection.getResponseMessage()
      );
  }
  </code></pre>
  
  <p>I am getting this "Bad response", with a 503 response code and no response message.
  I hope this informations are enough to, at least, get some guesses.</p>