Hi On Thu, Feb 24, 2011 at 11:11 AM, Bertrand TROLARD <[email protected]> wrote: > Hi, > > They are available at these 2 address, but the two services give the same > WSDL and so the same "functions". > The two services don't implement the same interface. I want two different > wsdl and so not the same functions. One service could inherited the second. >
Most likely you are 'hitting' an issue to do with ServletController overriding the addresses of the endpoint destinations. It prevents multiple Java-first JAX-WS endpoints from sharing a single CXFServlet or say a single Java-First JAX-WS endpoint from being accessed via multiple CXFServlet roots. I've 'struggled' with this issue during the last few days while working on the transformations demo. WSDL-First JAX-WS endpoints, with JAX-WS clients using their own WSDLs, seem to be fine, at least in my demo, and JAX-RS endpoints are ok too. A "disable-address-updates" servlet parameter, set to true, needs to be used to overcome this limitation - it does not help with Java-First JAX-WS endpoints though. Alternatively, try introducing two Servlets listening on say : /services1/* and /services2/* and access the first endpoint as /service1/ServiceTest1,and the 2nd one as /service2/ServiceTest2 In meantime, I'll open a JIRA for the address overwriting be avoided by default. The problem there is that ?wsdl and /services queries depend on it - but hope that can be be fixed thanks, Sergey > Thank you for your time. > Bertrand > >> Hi >> >> Are you using a single CXFServlet declaration with the pattern such as >> "/services/*"? >> An expect the first service be available at /services/Service1Test and >> the 2nd one at /services/Service2Test ? >> >> Cheers, Sergey >> >> On Thu, Feb 24, 2011 at 10:55 AM, Bertrand TROLARD >> <[email protected]> wrote: >>> >>> Hi, >>> I'm new to CXF. >>> >>> I try to use JAX-WS to and I want to have severals web-services with the >>> same java class for the implementation. >>> For these web-services, I want to use the same bean. >>> >>> Each web-service has more and more fontions, but every "client" can't >>> have >>> access to all fonctions (url dependant). >>> I create inherited class to get a different @WebService annotation for >>> each >>> web-service. >>> The bean will be the last derived class. >>> >>> @WebService(targetNamespace = "http://service2/", endpointInterface = >>> "my.class.Service2", portName = "Service2Port", serviceName = >>> "Service2Service") >>> class ServiceImpl2 extends ServiceImpl1 { >>> } >>> >>> @WebService(targetNamespace = "http://service1/", endpointInterface = >>> "my.class.Service1", portName = "Service1Port", serviceName = >>> "Service1Service") >>> class Service1Impl implement Service1, Service2{ >>> } >>> >>> The cxf configuration file. >>> <jaxws:endpoint xmlns:tns="http://service1/" id="id_service1" >>> implementor="#commonBean" >>> endpointName="tns:Service1Port" >>> serviceName="tns:Service1" address="/Service1Test"> >>> </jaxws:endpoint> >>> >>> <jaxws:endpoint xmlns:tns="http://service2/" id="id_service2" >>> implementor="#commonBean" >>> endpointName="tns:Service2Port" >>> serviceName="tns:Service2" address="/Service2Test"> >>> </jaxws:endpoint> >>> >>> <bean id="commonBean" class="my.class.Service2Impl" init-method="start"> >>> ... >>> </bean> >>> >>> But for each web-service I got the same WSDL wich is the Service2.wsdl. >>> >>> >>> When I do that with XFire and it works fine. The service.xml file looks >>> like: >>> >>> <service> >>> <name>Service1</name> >>> <serviceClass>my.interface.Service1</serviceClass> >>> <scope>application</scope> >>> <serviceBean>#commonBean</serviceBean> >>> </service> >>> >>> <service> >>> <name>Service2</name> >>> <serviceClass>my.interface.Service2</serviceClass> >>> <scope>application</scope> >>> <serviceBean>#commonBean</serviceBean> >>> </service> >>> >>> <bean id="commonBean" class="my.class.Service12Impl" init-method="start"> >>> </bean> >>> >>> >>> class Service12Impl implement Service1, Service2 { >>> ... >>> } >>> >>> >>> Is it possible to do the same with CXF ? >>> >>> Thank a lot, >>> >>> Bertrand >>> > >
