Web services JAX-WS:两个或多个端点作为一个服务和WSDL的端口

Web services JAX-WS:两个或多个端点作为一个服务和WSDL的端口,web-services,binding,wsdl,jax-ws,endpoint,Web Services,Binding,Wsdl,Jax Ws,Endpoint,是否可以在单个WSDL:Service下将两个或多个JAX-WS端点发布为WSDL:Port,以获得具有以下内容的单个WSDL <definitions ...> ... <service name="Airport"> <port name="Cargo" binding="tns:CargoBinding"> <soap:address location="http://localhost:99

是否可以在单个WSDL:Service下将两个或多个JAX-WS端点发布为WSDL:Port,以获得具有以下内容的单个WSDL

<definitions ...>
    ...
    <service name="Airport">
        <port name="Cargo" binding="tns:CargoBinding">
            <soap:address location="http://localhost:9999/"/>
        </port>
        <port name="Civil" binding="tns:CivilBinding">
            <soap:address location="http://localhost:9999/"/>
        </port>        
    </service>
</definitions>

其思想是将两个逻辑上相似的服务合并到一个服务下。我想知道如何使用Endpoint.publish实现这一点?

是的。在WSDL定义中,服务是相关端点的集合,端点必须具有由URI标识的唯一地址。在代码中,两个端点的地址相同

您必须为不同的端口终结点多次调用Endpoint.publish。 作为您的WSDL定义

Cargo cargo = new CargoImpl(); // Cargo is endpoint interface
Endpoint.publish("http://hostname/service/cargo", cargo);
Civil civil = new CivilImpl();
Endpoint.publish("http://hostname/service/civil", civil);

好的,也许您知道JAX-WS端点在一个WSDL下组合两个或多个实例的解决方案是什么吗?不幸的是,这会产生两个单独的WSDL,但不是signle@chaplean 'http://.../cargo?wsdl 和http://.../civil?wsdl'这两个WSDL是由jax ws生成的?这有关系吗?