Override Glassfish Generated WSDL Service Endpoint Address

送分小仙女□ 提交于 2019-12-03 08:53:26
Vinnie

It turns out there is a Server Name parameter on the HTTP Listener where the service is deployed. You can specify this value from the Glassfish administration console and Glassfish will use this name rather than the host name in the request URL.

Unfortunately, this parameter will not allow you to override the port or protocol (http to https) if your app server and proxy server do not use the same ones (ours don't).

What I did instead was write a simple servlet filter for my service to handle this for me.

I discovered what I consider to be a very simple way to deal with the issue: use mod_substitute in Apache. Since those of us with this problem are already using Apache, and it's built in and simple, I liked this approach best.

I put a block similar to the below in one of my Apache conf files and found joy:

<Location />
   AddOutputFilterByType SUBSTITUTE text/xml
   Substitute "s|http://internal:8080/xxx|https://external/xxx|ni"
</Location>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!