I am having problem with jax-ws making it work if the server return 301 on http to https. I got an exception, and after debugging it with charles it seems that the redirect doesn't work. I also noticed that there is some trick for http to https[*], but i am not sure if it still apply to java8
That's the pseudo-code that i would like to use with a dirty fix that i found online
TestImplService service = new TestImplService();
Test test = service.getTestImplPort();
Map<String, Object> tmp = ((BindingProvider) test).getRequestContext();
/*dirty fix*/
tmp.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, tmp.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY).toString().replace("http:", "https:")
);
test.dosomething();
Replacing http with https work, but i am not 100% sure that's the correct way.
Let's suppose that the server decide to stop to support https, disable the 301 for http, then my fix won't work anymore.
Can i force the follow redirect in another way?
BindingProvider class BindingProvider.ENDPOINT_ADDRESS_PROPERTY property is usable for change endpoint URL; Sometimes HTTPS connection ended with network switches/routers. Therefor application server cannot realize the path of https.