java – 使用JAX-WS更改运行时生成的WSDL中的schemaLocation和so
发布时间:2020-12-15 03:08:21 所属栏目:Java 来源:网络整理
导读:是否可以在JAX-WS WSDL中配置位置(schemaLocation和soap:地址位置)? 当我部署下面的示例时,’servername’将是localhost,’serverport’将是Web应用程序的本地端口号. 但是,我想将这些重新配置为代理服务器名称和重定向到服务的服务器端口.这是可能的,我将
是否可以在JAX-WS WSDL中配置位置(schemaLocation和soap:地址位置)?
当我部署下面的示例时,’servername’将是localhost,’serverport’将是Web应用程序的本地端口号. 但是,我想将这些重新配置为代理服务器名称和重定向到服务的服务器端口.这是可能的,我将如何实现它? 部署环境是Tomcat和Apache. 我有以下服务类: @WebService public class AuthenticationService { .... public AuthenticationService(){} @WebMethod public AuthenticationResult checkAuthentication( @WebParam(name = "authentication") Authentication authentication,@WebParam(name = "privilege") Privilege privilege) { .... } } 运行时,WSDL看起来像这样: <definitions targetNamespace="http://authentication.service.ws.ijs/" name="AuthenticationServiceService"> <types> <xsd:schema> <xsd:import namespace="http://authentication.service.ws.ijs/" schemaLocation="http://servername:serverport/WebAppName/AuthenticationService?xsd=1"/> </xsd:schema> </types> <message name="checkAuthentication"> <part name="parameters" element="tns:checkAuthentication"/> </message> <message name="checkAuthenticationResponse"> <part name="parameters" element="tns:checkAuthenticationResponse"/> </message> <portType name="AuthenticationService"> <operation name="checkAuthentication"> <input wsam:Action="http://authentication.service.ws.ijs/AuthenticationService/checkAuthenticationRequest" message="tns:checkAuthentication"/> <output wsam:Action="http://authentication.service.ws.ijs/AuthenticationService/checkAuthenticationResponse" message="tns:checkAuthenticationResponse"/> </operation> </portType> <binding name="AuthenticationServicePortBinding" type="tns:AuthenticationService"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <operation name="checkAuthentication"> <soap:operation soapAction=""/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> <service name="AuthenticationServiceService"> <port name="AuthenticationServicePort" binding="tns:AuthenticationServicePortBinding"> <soap:address location="http://servername:serverport/WebAppName/AuthenticationService"/> </port> </service> </definitions> 任何帮助将不胜感激. 解决方法
如果您在请求中保留原始主机名(例如,如果您使用mod_proxy,则使用ProxyPreserveHost On)如果您使用相同的协议,则应该修复您的URL.如果您的代理在https和http之间切换,您可能仍会遇到问题.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- java – maven-assembly-plugin MojoExecutionEx
- java – 如何将一个Ctrl-Break发送到正在运行的L
- Eclipse 导出可执行Java工程/可执行Jar文件(包含
- 详解利用SpringCloud搭建一个最简单的微服务框架
- java – 如何返回类型返回类型也是方法参数的上限
- Struts2拦截器Interceptor的原理与配置实例详解
- 当我们在Java中将Integer分配给int时,为什么编译
- java – 生产中的ServletRequestWrapper或Servle
- 多线程 – 让多个线程将相同的值写入相同的变量是
- 算法 – 有效地从链接哈希表中挑选一个随机元素?
热点阅读