嗨 我们开始使用 J2EE 创建我们的应用程序。我们现在创建了一个 Web 服务并将其部署到 Glassfish Server。我们已经编写了一个 apache 代理规则来通过 https://our.server.com/webservice-war 访问它(只有 https 端口对该服务器开放):
ProxyRequests Off
ProxyPass /webservice-war http://our.server.com:8080/webservice-war
ProxyPassReverse /webservice-war http://our.server.com:8080/webservice-war
现在一切正常,但是当我们转到 ServiceEndpoint 页面(自动生成)时,会出现一个指向 WSDL 页面的链接: http://our.server.com:8080/webservice-war/HostaliasSearchImplService?wsdl
这是明显错误的(Glassfish 监听端口 8080)。并且 https 也更改为 http
任何人都知道我该如何修复它,自动生成的链接是:
https://our.server.com/webservice-war/HostaliasSearchImplService?wsdl
BR,雷内
最佳答案
我发现了我认为是处理该问题的一种非常简单和优雅的方法:使用 mod_substitute。由于我们这些遇到这个问题的人已经在使用 Apache,而且它内置且简单,所以我最喜欢这种方法。
我在我的一个 Apache conf 文件中放置了一个类似于下面的 block ,并发现了乐趣:
<Location />
AddOutputFilterByType SUBSTITUTE text/xml
Substitute "s|http://internal:8080/foo|https://external/foo|ni"
</Location>
关于java - Apache HTTP Server 背后的 Glassfish Server Webservice,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4949840/