JAX-WS 엔드 포인트를 호출 할 때 HTTP 응답 코드는 어떻게 얻을 수 있습니까?JAX-WS 응답을 얻는 방법 HTTP 상태 코드
아래 예제 코드에서 웹 서비스를 port.getCustomer(customerID);
으로 호출하면 401
또는 500
과 같이 예외가 throw 될 수 있습니다.
그런 경우 어떻게 HTTP 응답에서 HTTP 상태 코드를 얻을 수 있습니까?
@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
}
}
예외를 캡처하려고 시도 했습니까? – efekctive