Java – publish multiple ports with one service using jax-ws 2.0 and @ webservice

I want to create a soap service that exposes multiple port types, each of which has a separate interface I'm trying to use jax-ws 2.0

Example:

interface A:
    ObjectA get(String name);

interface B:
    ObjectB get(String name);

Service:
    port A
          get
    port B
          get

The problem I encountered is that @ WebService is defined using a single class / interface, so the only way I can set it is to have two separate services Each service is implemented by a separate class with @ WebService annotation

I want to expose two ports using the same service to make it clear that they are all part of the same API Is that possible?

Really, I will have some nested namespace support in WSDL in the future, so I can use the same method in different namespaces I will get / set / delete methods to process different types of data, but I don't want to put them all in the same large interface as geta / getb, because I want to be able to add new data types later, instead of forcing all clients to regenerate from the new WSDL set Any hint about implementing this is welcome, even if it means using another way to generate WSDL from Java code

Solution

You can try renaming a method and explicitly set the action or operationname field in the @ webmethod annotation

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>