Environment: CXF 2.3.2, jdk1.7.0_45, apache-tomcat-7.0.56, Fedora I am implementing the SCTE130 CIS client protocol. The protocol has both client and server interfaces because it can send requests and receive unsolicited messages from the server (notifications, service check, etc.). I'm implementing it over both JAXWS (soap) and JAXRS (rest).
The client side is working fine - it's exchanging messages with the server - but I am having problems getting the client listener to work. I am expecting the endpoint name to be /my-app/services/REST or /my-app/services/SOAP/api based on web.xml and jaxrs / jaxws servlet lines in the application context xml, both are included below. In addition to the CIS protocol, the service implements unrelated protocols via CXF services which are started through cxf_servlet.xml and are working normally and I can see them from a browser get of http://localhost:8080/app-name/services?wsdl. The CIS client service is defined in a spring application context associated with my service and not cxf_servlet.xml. I do this because my application needs access to the bean definitions which would otherwise be associated with CXF spring application context and therefore inaccessible to my-app application context. I have also tried moving the unrelated services to my service application context and not supply a cxf_servlet.xml and again everything seems to load properly as shown below in the log extract, but http://localhost:8080/app-name/services?wsdl indicates that no services are defined. When my service starts up, there are messages logged to the console when the endpoints are defined. The /SOAP/api and /REST are associated with the CIS service and the other endpoints are associated with the unrelated services. Feb 05, 2015 3:43:06 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service {http://www.scte.org/wsdl/130-3/2010/ads}ADSService from class org.scte.wsdl._130_3._2010.ads.ADS Feb 05, 2015 3:43:07 PM org.apache.cxf.endpoint.ServerImpl initDestination INFO: Setting the server's publish address to be /ads Feb 05, 2015 3:43:07 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service {http://www.scte.org/wsdl/130-3/2010/adm}ADMService from class org.scte.wsdl._130_3._2010.adm.ADM Feb 05, 2015 3:43:09 PM org.apache.cxf.endpoint.ServerImpl initDestination INFO: Setting the server's publish address to be /adm Feb 05, 2015 3:43:09 PM org.apache.cxf.endpoint.ServerImpl initDestination INFO: Setting the server's publish address to be /api Feb 05, 2015 3:43:09 PM org.apache.cxf.jaxrs.provider.ProviderFactory setDefaultProvider INFO: Problem with setting the default provider org.apache.cxf.jaxrs.provider.JSONProviderorg/codehaus/jettison/mapped/TypeConverter Feb 05, 2015 3:43:09 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL INFO: Creating Service { http://www.scte.org/wsdl/130-4/2011/cis}CISClientService from WSDL: SCTE_130-4_2011.wsdl Feb 05, 2015 3:43:11 PM org.apache.cxf.endpoint.ServerImpl initDestination INFO: Setting the server's publish address to be /SOAP/api Feb 05, 2015 3:43:11 PM org.apache.cxf.endpoint.ServerImpl initDestination INFO: Setting the server's publish address to be /REST The application context xml is more detailed than what I am including as it manages the dependency injection for all the bean classes needed by the service, but the included segment contains the meat of the cxf interaction. APPLICATION CONTEXT XML <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml"/> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/> <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/> <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/> <import resource="spring-cis.xml" /> <!-- other business logic --> </beans> SPRING-CIS.XML <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:soap="http://cxf.apache.org/bindings/soap" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"> <jaxws:endpoint xmlns:tns="http://www.scte.org/wsdl/130-4/2011/cis" id="cisclient" implementor="#cisclientbean" wsdlLocation="SCTE_130-4_2011.wsdl" endpointName="tns:CISClientPort" serviceName="tns:CISClientService" address="/SOAP/api"> <jaxws:features> <bean class="org.apache.cxf.feature.LoggingFeature" /> </jaxws:features> </jaxws:endpoint> <jaxrs:server id="cisRestServlet" address="/REST"> <jaxrs:serviceBeans> <ref bean="cisClientServlet" /> </jaxrs:serviceBeans> </jaxrs:server> <bean id="cisclientbean" class="tv.seachange.advads.cisclient.CISClientImpl"> <constructor-arg index="0" ref="cisconfigclient" /> <property name="mbean" ref="cismbean" /> <property name="cisNotificationHandler" ref="notificationhandler" /> <property name="cisMsgHelper" ref="messagehelper"/> </bean> <bean id="cisClientServlet" class="tv.seachange.advads.cisclient.web.CISClientServlet"> <property name="config" ref="cisconfigclient"/> <property name="cisMsgHelper" ref="messagehelper"/> </bean> <!-- other beans implementing the business logic --> </beans> WEB.XML <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <servlet> <description>Apache CXF Endpoint</description> <display-name>cxf</display-name> <servlet-name>cxf</servlet-name> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>cxf</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> </web-app> Browser display when two application contexts are used Available SOAP services: ADM - ListADMServicesRequest - ADSDeregisterRequest - ListADSRegistrationRequest - ADSRegistrationRequest - ServiceCheckRequest - PlacementUpdateNotification - ServiceStatusNotification Endpoint address: http://localhost:8080/my-app/services/adm WSDL : {http://www.scte.org/wsdl/130-3/2010/adm}ADMService <http://localhost:8080/infusion/services/adm?wsdl> Target namespace: http://www.scte.org/wsdl/130-3/2010/admADS - ServiceCheckRequest - PlacementStatusNotification - ADSDeregistrationNotification - ServiceStatusNotification - PlacementRequest Endpoint address: http://localhost:8080/my-app/services/ads WSDL : {http://www.scte.org/wsdl/130-3/2010/ads}ADSService <http://localhost:8080/infusion/services/ads?wsdl> Target namespace: http://www.scte.org/wsdl/130-3/2010/ads Available RESTful services: Endpoint address: http://localhost:8080/my-app/services/api WADL : http://localhost:8080/my-app/services/api?_wadl&type=xml <http://localhost:8080/infusion/services/api?_wadl&_type=xml> browser display when all CXF services are started via the single application spring context (i.e. without cxf_servlet.xml). No services have been found.
