title: Spring RestTemplate Client - connection refused exception
body: <p>I am new to webservices and trying to write a RESTFul webservice's client using RestTemplate. 
  I am using org.springframework.http.converter.xml.MarshallingHttpMessageConverter as message converter and org.springframework.oxm.xstream.XStreamMarshaller as marshaller.</p>
  
  <p>Is there any way to debug this further or find out the root cause of this issue? </p>
  
  <p>My consumer class looks like this - </p>
  
  <pre><code>@SuppressWarnings("unchecked")
  public List&lt;Deal&gt; getClientInformation() throws RestClientException {
      return restTemplate.getForObject(webServiceURL, List.class);
  </code></pre>
  
  <p>}</p>
  
  <p>Exception : </p>
  
  <pre><code>Exception in thread "main" org.springframework.web.client.ResourceAccessException: I/O error: Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
  at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:359)
  at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:307)
  at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:177)
  at main.java.com.sample.consumer.DealConsumer.getClientInformation(Consumer.java:35)
  at main.java.com.client.WebserviceConsumerTestClient.main(WebserviceConsumerTestClient.java:16)
  </code></pre>
  
  <p>Caused by: java.net.ConnectException: Connection refused: connect
      at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:359)</p>