title: How to get JAX-WS response HTTP status code
body: <p>When calling a JAX-WS endpoint, how can I get the HTTP response code?</p>
  
  <p>In the sample code bellow, when calling the web service at <code>port.getCustomer(customerID);</code> an Exception may be thrown, such as <code>401</code> or <code>500</code>. </p>
  
  <p>In such cases, how can I get the HTTP status code from the HTTP response?</p>
  
  <pre><code>@Stateless
  public class CustomerWSClient {
  
      @WebServiceRef(wsdlLocation = "/customer.wsdl")
      private CustomerService service;
  
      public void getCustomer(Integer customerID) throws Exception {
          Customer port = service.getCustomerPort();
          port.getCustomer(customerID); // how to get HTTP status           
      }
  
  }
  </code></pre>