0

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?

Steve Skrla
  • 1,620
  • 5
  • 16
  • 24

3 Answers3

0

Hmmm. That looks much like the Deadly Diamond of Death problem channelled through CXF! I know this is old, but I would try explicitly declaring the concrete methods as in the second and third answer from this question, and try again.

(I hope I'm not evil for commenting on such an old item!)

Community
  • 1
  • 1
ingyhere
  • 11,818
  • 3
  • 38
  • 52
0

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
  • 610
  • 4
  • 11
  • 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. – Steve Skrla Mar 10 '10 at 22:04
  • the .NET framework handles this situation ? How does it handle? both the operations in the Same WSDL? – shivaspk Mar 11 '10 at 20:22
  • Yes, both operations exist in the same WSDL, but they have different namespaces (I believe). – Steve Skrla Apr 29 '10 at 18:29
0

I had a same issue using cxf 3.
Solution/workaround is to create 3rd interface that extends interfaces that need to be exposed.

@WebService(targetNamespace="http://mycompany.com/api/Service/v2")
public interface ServiceRev extends ServiceRev1, ServiceRev2
{
}

Expose:

public class ServiceRevImpl implements ServiceRev
{
....
}
Samara
  • 1
  • 1