views:

349

answers:

1

I am trying to implement minor versions in JAX-WS as follows:

@WebService(targetNamespace="http://mycompany.com/api/Service/v1_0")
public interface ServiceRev0 {
    public void initialMethod();
}

@WebService(targetNamespace="http://mycompany.com/api/Service/v1_1")
public interface ServiceRev1 {
    public void newMethod();
}

public class Service implements ServiceRev0, ServiceRev1 {
    ...
}

Endpoint.publish("api", new Service());

Unfortunately, CXF only appears to 'see' the first interface and its associated methods. Is it possible to do what I want or should I take another approach?

A: 

It seems wrong logically, When you add @WebService annotation if its on a class it means its a webservice implementation, if on a interface it means defining a Web Service interface.

The above definition of yours lead to two different WSDL's with different operations in it, its better you define two different webservice interfaces and provide appropriate implementations.

shivaspk
I am fairly certain that a WSDL is fully capable of implementing this in a standard way as the .NET framework handles this situation with ease.
Ambience
the .NET framework handles this situation ? How does it handle? both the operations in the Same WSDL?
shivaspk
Yes, both operations exist in the same WSDL, but they have different namespaces (I believe).
Ambience