java Change schemaLocation和soap:使用JAXWS在运行时生成的WSDL中的地址位置
是否可以在JAX-WS WSDL中配置位置(schemaLocation
和soap:address
location
)
当我部署下面的示例时,“servername”将是本地主机,“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>
任何帮助都将不胜感激
共 (0) 个答案