Webservice Follow Redirect False - Error 302 (JAXWS)

心不动则不痛 提交于 2019-12-11 15:48:49

问题


This is a link to a question I had asked two days back,

How to make a Webservice request follow a redirect?

I am using jaxws library.

The service forms the URL, and then internally creates the HTTPURLConnection. If I can grab hold of the connection I would be able to set the followRedirect to true.

But not getting a handle of the same. Its urgent, any help would be highly appreciated.


回答1:


You can set

requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, _url);

where url is the real URl (after redirection).




回答2:


Get a handle of HttpUrlConnection.setforwardRedirect(true)



来源:https://stackoverflow.com/questions/2581486/webservice-follow-redirect-false-error-302-jaxws

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!