views:

198

answers:

2

Hi, I've a cxf webservice with multiple endpoint. I've succesfully deploy it. The problem is all endpoint's WSDL appear in the same servlet URL.

Can i have 2 org.apache.cxf.transport.servlet.CXFServlet servlet in the same web.xml and each servlet serve one endpoint so that i have endpoint1 at http:/locahost/app/endpoint1 and endpoint2 at http:/locahost/app/endpoint2 .

Thank you.

A: 

Can you provide more detail about your deployment? Jetty? Tomcat? Something else?

From the docs, it looks like it's as simple as

Endpoint.publish("/service1", new ServiceOneImpl());
Endpoint.publish("/service2", new ServiceTwoImpl());

But I have not tried that myself.

Chris Dolan
yes, i use tomcat as my development env
robinmag
A: 

What is the motivation for using 2 CXFServlets? CXF supports multiple endpoints per servlet instance.

Can be configured numerous ways. One example:

<jaxws:endpoint id="endpoint1" 
  implementor="#service1Impl" 
  address="/endpoint1">...</jaxws:endpoint>

<jaxws:endpoint id="endpoint2" 
  implementor="#service2Impl" 
  address="/endpoint2">...</jaxws:endpoint>

..where service1Impl and service2Impl are beans implementing your service interfaces.

bug11
but when in the /endpoint1 url, i cant see the method from /endpoint2
robinmag