1
我在NetBeans中爲SOAP Web服務創建了一組代理類。如何將HTTP標頭添加到JAXWS創建的代理類
我想爲傳出的請求添加一個HTTP標頭。
Map<String, Object> requestHeaders = new HashMap<>();
requestHeaders.put("X-Header", header);
AccountManagementService service = new AccountManagementService();
AccountManagementServiceSoap soap = service.getAccountManagementServiceSoap();
GetMembershipSummaryResponse.GetMembershipSummaryResult membershipSummary = soap.getMembershipSummary("[email protected]");
我看到一堆JAX-WS頭部示例,用於從服務中獲取單個端口。有更容易的方法嗎?我可以將標題添加到服務或肥皂對象上的某個集合嗎?