Изменить schemaLocation и soap: расположение адреса в WSDL, созданном во время выполнения с помощью JAX-WS

Можно ли настроить местоположение ( schemaLocation и soap: address location ) в JAX-WSDL?
Когда я развертываю пример ниже, 'servername' будет localhost а serverport - это номер локального порта для веб-приложения.

Однако я хочу перенастроить их на имя прокси-сервера и порт сервера, которые перенаправляют на службу. Возможно ли это и как мне этого добиться?

Среда развертывания - это 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>

Любая помощь будет принята с благодарностью.

8
задан noddy 16 January 2012 в 03:56
поделиться