title: Jersey client calling RESTful service
body: <p>I am new to using Jersey and I am struggling to get my client working against an existing RESTful service.  I have a SOAPUI call that works, here is the raw data from that request.</p>
  
  <pre><code>POST http://localhost/QWJB/WENXrest//getHistory HTTP/1.1
  Accept-Encoding: gzip,deflate
  Content-Type: application/json
  User-Agent: Jakarta Commons-HttpClient/3.1
  Content-Length: 189
  Authorization: Basic VUNRRzE02fr45tDE0d1RQdw==
  Host: localhost
  
  {getHistory:       
  {
  wENXHeader:
  {
  languageCode: "en"
  },
  
  Account: "111111111",
  
      services: 
      [
          {Service: "CE000001"},
          {Service: "CE000002"}
      ]
      }
  
  }
  </code></pre>
  
  <p>At this point I am willing to hard code all the values in just to see it work.  But here is my client code.</p>
  
  <pre><code>import javax.ws.rs.Consumes;
  import javax.ws.rs.POST;
  import javax.ws.rs.core.MediaType;
  import com.sun.jersey.api.client.Client;
  import com.sun.jersey.api.client.WebResource;
  
  public void MakeRestCall() {
    try {
  GetHistory requestData = new GetHistory();
  requestData.setAccount("111111111");
  
  Client client = Client.create();
  WebResource webResource = client
  .resource("http://localhost/QWJB/WNEXrest//getHistory");
  
  webResource.accept("application/json");
  webResource.entity(requestData);
  
  GetHistoryResponse response =       
  webResource.type(MediaType.APPLICATION_XML).post(GetHistoryResponse.class);
  
  } catch (Exception e) {
  logger.error(message);
      e.printStackTrace();
  }
  </code></pre>
  
  <p>When I use SOAPUI I have to set a userid and password, is that what is in the authorization part of the raw request?  What should I use to encrypt it?</p>