WSDL binding URL changes protocol to HTTP when behind an SSL termination

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 02:05:47

问题


We have a simple jax-ws SOAP server backed by Apache CXF 3.2.6 in standalone (self-hosted) mode that uses an embedded Jetty. The server was generated wsdl-first using CXF's wsdl2java. WSDL is a file on the classpath, and that physical WSDL file has https://.... in the location attribute of the soapbind:address element.

When started, the server publishes to http://0.0.0.0:8080. The server also sits behind an SSL termination that routes https://external-name -> SSL termination -> http://internal-name:8080, so externally the service and its WSDL are available at https://external-name.

The problem is that when the WSDL is requested from the deployed server through https://external-name?wsdl, CXF changes the location attribute of the soapbind:address element in the resulting file to http://external-name (changes the protocol to HTTP from HTTPS and retains everything else ), which causes problems with generating client proxies, Soap UI, etc.

What's worst, our service can't be consumed by our partner's SOA which enforces the usage of published location from WSDL exclusively.

How can we solve this, short of removing SSL termination and having CXF handle SSL on its own? (which is horrible, due to Java keystore maintenance nightmare and having to store the company-wide certificate + private key in the server instance).


回答1:


You can set the desired address as publishedEndpointUrl in the configuration. See: http://cxf.apache.org/docs/jax-ws-configuration.html



来源:https://stackoverflow.com/questions/52078544/wsdl-binding-url-changes-protocol-to-http-when-behind-an-ssl-termination

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