Re: Camel type converter question
Hi Willem, Thanks for your reply. The issue in Kohsuke's blog is not the cause of my problem. Let me explain my wsdl in a little more detail. My top level element is defined as following: element name=notifications complexType sequence element name=OrganizationId type=ent:ID/ element name=ActionId type=ent:ID/ element name=SessionId type=xsd:string nillable=true/ element name=EnterpriseUrl type=xsd:string/ element name=PartnerUrl type=xsd:string/ element name=Notification maxOccurs=100 type=tns:Notification/ /sequence /complexType /element jaxb using the simple binding generates the correct bean object (Notifications) with the @XmlRootElement for the top level element. However since the contained element is defined as of type Notification defined below: complexType name=Notification sequence element name=Id type=ent:ID/ element name=sObject type=ens:sObject/ /sequence /complexType The bean for the above complexType (Notification) is generated without the @XmlRootElement. I wish to persist the Notification objects to the disk using the FileEndPoint generated using the following routing snippet: .convertBodyTo(Notification.class).setHeader(FileComponent.HEADER_FILE_NAME).constant(sriram.txt).to(file:/to/my/path) However since the Notification bean is missing the @XmlRootElement, the FallbackTypeConverter is failing to marshall this to XML. This is the problem I am trying to solve. JAXB has the notion of DataTypeAdapters which can be used to specify marshalling rules for jaxb elements and types. I wonder if anybody on this forum has tried using these Adapters in conjunction with the FallbackTypeConverter. Sriram willem.jiang wrote: Hi Sriram, I just used google to do a quick search, the error may relate to the anonymous complexTypes in your wsdl. Here is the link[1] which talks about it. [1] http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html Willem Sriram C wrote: I have defined a CXF jaxws endpoint. The incoming message to this end point has an element which is defined as a ComplexType in the wsdl. The CXF wsdl2java utility generates this complextype with an @XmlType annotation. Since it is missing the @XmlRootElement annotation, the FallbackTypeConverter is unable to marshall this object. What is a good solution for resolving this issue? Thanks in advance, Sriram -- View this message in context: http://www.nabble.com/Camel-type-converter-question-tp22322333p22335454.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: CXF endpoint - No service was found issue
I got this working by changing address to /account Sriram C wrote: I am trying to create a CXF endpoint using Spring DSL. My endpoint and route definitions are as follow: cxf:cxfEndpoint id=serviceEndpoint address=http://localhost:8080/SFServices/services/account; wsdlURL=classpath:accountOutboundMessage.wsdl serviceClass=com.mypackage.service.NotificationPort endpointName=s:Notification serviceName=s:NotificationService xmlns:s=http://soap.sforce.com/2005/09/outbound; / camelContext id=camel xmlns=http://activemq.apache.org/camel/schema/spring; route from uri=cxf:bean:serviceEndpoint / bean ref=testBean method=toCompany/ /route /camelContext The webapp starts up correctly. I can go to the CXF Service list page and see that the service has been correctly initialized. However when I access the WSDL for the published service, I see a 'No service was found' message with the following warning. WARN [13:08:47,515] - org.apache.cxf.transport.servlet.ServletController.invoke(126) | Can't find the request for http://localhost:8080/SFServices/services/account's Observer Can somebody point me to what is wrong in my configuration or how I can go about debugging this issue? Thanks Sriram The debug messages from Tomcat startup where the CXF endpoint is setup is listed below. INFO [13:08:33,218] - org.apache.cxf.endpoint.ServerImpl.initDestination(91) | Setting the server's publish address to be http://localhost:8080/SFServices/services/account DEBUG [13:08:33,250] - org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(72) | building handler chain DEBUG [13:08:33,250] - org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.findHandlerChainAnnotation(257) | Checking for HandlerChain annotation on com.mypackage.service.NotificationPort DEBUG [13:08:33,250] - org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(77) | no HandlerChain annotation on interface com.mypackage.service.NotificationPort DEBUG [13:08:33,250] - org.apache.camel.management.DefaultInstrumentationAgent.registerMBeanWithServer(247) | Registered MBean with objectname: org.apache.camel:context=CM-Latitude-E55/camel,type=consumers,name=CxfConsumer(0x91cceb) DEBUG [13:08:33,250] - org.apache.cxf.transport.AbstractObservable.setMessageObserver(45) | registering incoming observer: org.apache.cxf.transport.chaininitiationobser...@1bc6271 DEBUG [13:08:33,250] - org.apache.cxf.endpoint.ServerImpl.start(127) | register the server to serverRegistry DEBUG [13:08:33,250] - org.apache.camel.impl.DefaultComponent.createEndpoint(79) | Creating endpoint uri=[spring-event:default], path=[default], parameters=[{}] DEBUG [13:08:33,265] - org.apache.camel.impl.DefaultCamelContext.getEndpoint(333) | spring-event:default converted to endpoint: Endpoint[spring-event:default] by component: org.apache.camel.component.event.eventcompon...@17f61bb DEBUG [13:08:33,281] - org.apache.camel.management.DefaultInstrumentationAgent.registerMBeanWithServer(247) | Registered MBean with objectname: org.apache.camel:context=CM-Latitude-E55/camel,type=endpoints,name=spring-event:default\?id=0x20a20c46 Feb 20, 2009 1:08:33 PM org.apache.catalina.core.ApplicationContext log INFO: Set web app root system property: 'webapp.root' = [C:\projects\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\SFServices\] Feb 20, 2009 1:08:33 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing log4j from [C:\projects\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\SFServices\WEB-INF\classes\log4j.xml] INFO [13:08:33,453] - org.apache.cxf.transport.servlet.CXFServlet.updateContext(120) | Load the bus with application context INFO [13:08:33,453] - org.springframework.context.support.AbstractApplicationContext.prepareRefresh(411) | Refreshing org.apache.cxf.bus.spring.busapplicationcont...@1026e12: display name [org.apache.cxf.bus.spring.busapplicationcont...@1026e12]; startup date [Fri Feb 20 13:08:33 PST 2009]; parent: org.springframework.web.context.support.xmlwebapplicationcont...@ad5fab INFO [13:08:33,468] - org.apache.cxf.common.logging.LogUtils.doLog(345) | No cxf.xml configuration file detected, relying on defaults. DEBUG [13:08:33,468] - org.apache.cxf.bus.spring.BusApplicationContext.getConfigResources(179) | Creating application context with resources: [] INFO [13:08:33,468] - org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(426) | Bean factory for application context [org.apache.cxf.bus.spring.busapplicationcont...@1026e12]: org.springframework.beans.factory.support.defaultlistablebeanfact...@cebf1c DEBUG [13:08:33,468] - org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(430) | 0 beans defined
CXF endpoint - No service was found issue
I am trying to create a CXF endpoint using Spring DSL. My endpoint and route definitions are as follow: cxf:cxfEndpoint id=serviceEndpoint address=http://localhost:8080/SFServices/services/account; wsdlURL=classpath:accountOutboundMessage.wsdl serviceClass=com.mypackage.service.NotificationPort endpointName=s:Notification serviceName=s:NotificationService xmlns:s=http://soap.sforce.com/2005/09/outbound; / camelContext id=camel xmlns=http://activemq.apache.org/camel/schema/spring; route from uri=cxf:bean:serviceEndpoint / bean ref=testBean method=toCompany/ /route /camelContext The webapp starts up correctly. I can go to the CXF Service list page and see that the service has been correctly initialized. However when I access the WSDL for the published service, I see a 'No service was found' message with the following warning. WARN [13:08:47,515] - org.apache.cxf.transport.servlet.ServletController.invoke(126) | Can't find the request for http://localhost:8080/SFServices/services/account's Observer Can somebody point me to what is wrong in my configuration or how I can go about debugging this issue? Thanks Sriram The debug messages from Tomcat startup where the CXF endpoint is setup is listed below. INFO [13:08:33,218] - org.apache.cxf.endpoint.ServerImpl.initDestination(91) | Setting the server's publish address to be http://localhost:8080/SFServices/services/account DEBUG [13:08:33,250] - org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(72) | building handler chain DEBUG [13:08:33,250] - org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.findHandlerChainAnnotation(257) | Checking for HandlerChain annotation on com.mypackage.service.NotificationPort DEBUG [13:08:33,250] - org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(77) | no HandlerChain annotation on interface com.mypackage.service.NotificationPort DEBUG [13:08:33,250] - org.apache.camel.management.DefaultInstrumentationAgent.registerMBeanWithServer(247) | Registered MBean with objectname: org.apache.camel:context=CM-Latitude-E55/camel,type=consumers,name=CxfConsumer(0x91cceb) DEBUG [13:08:33,250] - org.apache.cxf.transport.AbstractObservable.setMessageObserver(45) | registering incoming observer: org.apache.cxf.transport.chaininitiationobser...@1bc6271 DEBUG [13:08:33,250] - org.apache.cxf.endpoint.ServerImpl.start(127) | register the server to serverRegistry DEBUG [13:08:33,250] - org.apache.camel.impl.DefaultComponent.createEndpoint(79) | Creating endpoint uri=[spring-event:default], path=[default], parameters=[{}] DEBUG [13:08:33,265] - org.apache.camel.impl.DefaultCamelContext.getEndpoint(333) | spring-event:default converted to endpoint: Endpoint[spring-event:default] by component: org.apache.camel.component.event.eventcompon...@17f61bb DEBUG [13:08:33,281] - org.apache.camel.management.DefaultInstrumentationAgent.registerMBeanWithServer(247) | Registered MBean with objectname: org.apache.camel:context=CM-Latitude-E55/camel,type=endpoints,name=spring-event:default\?id=0x20a20c46 Feb 20, 2009 1:08:33 PM org.apache.catalina.core.ApplicationContext log INFO: Set web app root system property: 'webapp.root' = [C:\projects\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\SFServices\] Feb 20, 2009 1:08:33 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing log4j from [C:\projects\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\SFServices\WEB-INF\classes\log4j.xml] INFO [13:08:33,453] - org.apache.cxf.transport.servlet.CXFServlet.updateContext(120) | Load the bus with application context INFO [13:08:33,453] - org.springframework.context.support.AbstractApplicationContext.prepareRefresh(411) | Refreshing org.apache.cxf.bus.spring.busapplicationcont...@1026e12: display name [org.apache.cxf.bus.spring.busapplicationcont...@1026e12]; startup date [Fri Feb 20 13:08:33 PST 2009]; parent: org.springframework.web.context.support.xmlwebapplicationcont...@ad5fab INFO [13:08:33,468] - org.apache.cxf.common.logging.LogUtils.doLog(345) | No cxf.xml configuration file detected, relying on defaults. DEBUG [13:08:33,468] - org.apache.cxf.bus.spring.BusApplicationContext.getConfigResources(179) | Creating application context with resources: [] INFO [13:08:33,468] - org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(426) | Bean factory for application context [org.apache.cxf.bus.spring.busapplicationcont...@1026e12]: org.springframework.beans.factory.support.defaultlistablebeanfact...@cebf1c DEBUG [13:08:33,468] - org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(430) | 0 beans defined in org.apache.cxf.bus.spring.busapplicationcont...@1026e12: display name [org.apache.cxf.bus.spring.busapplicationcont...@1026e12]; startup date [Fri Feb 20 13:08:33 PST 2009];