我找到了解决方案。
拨打电话后,可以使用以下方法获取响应头:
((BindingProvider)port).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
查找
Set-cookie标题并存储其值。
然后,在下一个请求(在任何Web服务中)之前,您可以设置cookie标头:
((BindingProvider)port).getRequestContext().put( MessageContext.HTTP_REQUEST_HEADERS, Collections.singletonMap("cookie", Collections.singletonList(cookievalue) ) );


