You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Chubutin <ra...@gmail.com> on 2013/05/27 16:33:49 UTC
Test route with CXF endpoint
Hi, Im trying to test a cxf route that I have. This route have a cxf endpoint
and a xslt transformation (in this example the transformation returns always
a mock result). If I deploy this route into Fuse this works great, but Im
trying to test it with Camel in differents alternatives.
Im a little confuse about Test with Camel and an OSGi environment. If I wish
test a Camel rout and the orchestation between the endpoints, should I test
with CamelBlueprintTestSupport or an approach with
CamelSpringJUnit4ClassRunner it's fine? Well, i tried with both tests.
First, I tried an approach with CamelSpringJUnit4ClassRunner and
annotations. in this way the CXF Poroducer needs a default operation, but I
putted into the test. This is my test:
@RunWith(CamelSpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:camel-context-test.xml")
@DisableJmx(true)
@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
public class CamelMockedRouteTest
{
@Autowired
protected CamelContext context;
@EndpointInject(uri = "mock:result")
protected MockEndpoint resultEndpoint;
@Produce(uri = "cxf:bean:CustomersServiceConsumerEndpoint")
protected ProducerTemplate inputProducerTemplate;
@Test
public void testRespondToMessageUsingMocks() throws Exception
{
Resource xmlFile = new ClassPathResource("in.xml");
InputStream stream = xmlFile.getInputStream();
String body = IOUtils.toString(stream);
resultEndpoint.setMinimumExpectedMessageCount(1);
// Prepare the request message for the camel-cxf procedure
Map<Object, String> mapHeaders = new HashMap<Object, String>();
mapHeaders.put(CxfConstants.OPERATION_NAMESPACE,
"http:customer.service.esb.com/");
mapHeaders.put(CxfConstants.OPERATION_NAME, "getCustomerByCuit");
inputProducerTemplate.requestBodyAndHeader("cxf:bean:CustomersServiceConsumerEndpoint",
body, mapHeaders);
inputProducerTemplate.requestBody(body);
resultEndpoint.assertIsSatisfied();
}
}
and this is my camel-context-test.xml
<cxf:cxfEndpoint id="CustomersServiceConsumerEndpoint"
serviceClass="com.tecplata.esb.service.customer.CustomersService"
address="/CustomersService">
<cxf:properties>
<entry key="dataFormat" value="PAYLOAD" />
<entry key="setDefaultBus" value="true"/>
</cxf:properties>
</cxf:cxfEndpoint>
<camelContext id="contextTest"
xmlns="http://camel.apache.org/schema/spring">
<route id="routeTest" trace="true">
<from uri="cxf:bean:CustomersServiceConsumerEndpoint" />
<to uri="xslt:xslt/mockCustomers.xslt?failOnNullBody=false"/>
<to uri="mock:result" />
</route>
</camelContext>
No errors in my log file
[ main] TestContextManager INFO
@TestExecutionListeners is not present for class [class
com.tecplata.esb.test.camel.CamelMockedRouteTest]: using defaults.
[ main] CamelSpringTestContextLoader DEBUG
Loading ApplicationContext for locations [classpath:camel-context-test.xml].
[ main] XmlBeanDefinitionReader INFO
Loading XML bean definitions from class path resource
[camel-context-test.xml]
[ main] CamelNamespaceHandler DEBUG Using
org.apache.camel.spring.CamelContextFactoryBean as
CamelContextBeanDefinitionParser
[ main] CamelNamespaceHandler DEBUG
Registered default: org.apache.camel.spring.CamelProducerTemplateFactoryBean
with id: template on camel context: contextTest
[ main] CamelNamespaceHandler DEBUG
Registered default: org.apache.camel.spring.CamelConsumerTemplateFactoryBean
with id: consumerTemplate on camel context: contextTest
[ main] CamelSpringTestContextLoader INFO
Disabling Camel JMX globally as DisableJmx annotation was found and
disableJmx is set to true.
[ main] GenericApplicationContext INFO
Refreshing
org.springframework.context.support.GenericApplicationContext@cb6009:
startup date [Mon May 27 11:03:47 ART 2013]; root of context hierarchy
[ main] DefaultListableBeanFactory INFO
Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1566a6c:
defining beans
[CustomersServiceConsumerEndpoint,template,consumerTemplate,contextTest:beanPostProcessor,contextTest,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor];
root of factory hierarchy
[ main] SpringCamelContext DEBUG Set
the application context classloader to:
sun.misc.Launcher$AppClassLoader@45a877
[ main] bstractCamelContextFactoryBean DEBUG Found
JAXB created routes:
[Route[[From[cxf:bean:CustomersServiceConsumerEndpoint]] ->
[To[xslt:xslt/mockCustomers.xslt?failOnNullBody=false], To[mock:result]]]]
[ main] SpringCamelContext DEBUG
onApplicationEvent:
org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.GenericApplicationContext@cb6009:
startup date [Mon May 27 11:03:47 ART 2013]; root of context hierarchy]
[ main] SpringCamelContext INFO No
spring-event endpoint enabled to handle event:
org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.GenericApplicationContext@cb6009:
startup date [Mon May 27 11:03:47 ART 2013]; root of context hierarchy]
[ main] CamelSpringTestContextLoader INFO
Setting shutdown timeout to [10 SECONDS] on CamelContext with name
[contextTest].
[ main] CamelSpringTestContextLoader INFO
Enabling lazy loading of type converters on CamelContext with name
[contextTest].
[ main] CamelSpringTestContextLoader INFO
Starting CamelContext with name [contextTest].
[ main] SpringCamelContext INFO Apache
Camel 2.10.0.redhat-60024 (CamelContext: contextTest) is starting
[ main] ManagementStrategyFactory INFO JMX is
disabled.
[ main] AnnotationTypeConverterLoader DEBUG Found
3 packages with 15 @Converter classes to load
[ main] SharedProducerServicePool DEBUG
Starting service pool:
org.apache.camel.impl.SharedProducerServicePool@796e1c
[ main] RouteDefinition DEBUG
Tracing is enabled on route: routeTest
[ main] SpringCamelContext DEBUG Using
ComponentResolver: org.apache.camel.impl.DefaultComponentResolver@189acb5 to
resolve component with name: cxf
[ main] DefaultComponentResolver DEBUG Found
component: cxf in registry: null
[ main] DefaultComponentResolver DEBUG Found
component: cxf via type: org.apache.camel.component.cxf.CxfComponent via:
META-INF/services/org/apache/camel/component/cxf
[ main] DefaultComponent DEBUG
Creating endpoint uri=[cxf://bean:CustomersServiceConsumerEndpoint],
path=[bean:CustomersServiceConsumerEndpoint], parameters=[{}]
[ main] AnnotationTypeConverterLoader DEBUG
Loading file META-INF/services/org/apache/camel/TypeConverter to retrieve
list of packages, from url:
jar:file:/home/ramiro/.m2/repository/org/apache/camel/camel-core/2.10.0.redhat-60024/camel-core-2.10.0.redhat-60024.jar!/META-INF/services/org/apache/camel/TypeConverter
[ main] AnnotationTypeConverterLoader DEBUG
Loading file META-INF/services/org/apache/camel/TypeConverter to retrieve
list of packages, from url:
jar:file:/home/ramiro/.m2/repository/org/apache/camel/camel-cxf/2.10.0.redhat-60024/camel-cxf-2.10.0.redhat-60024.jar!/META-INF/services/org/apache/camel/TypeConverter
[ main] AnnotationTypeConverterLoader DEBUG
Loading file META-INF/services/org/apache/camel/TypeConverter to retrieve
list of packages, from url:
jar:file:/home/ramiro/.m2/repository/org/apache/camel/camel-jetty/2.10.0.redhat-60024/camel-jetty-2.10.0.redhat-60024.jar!/META-INF/services/org/apache/camel/TypeConverter
[ main] AnnotationTypeConverterLoader DEBUG
Loading file META-INF/services/org/apache/camel/TypeConverter to retrieve
list of packages, from url:
jar:file:/home/ramiro/.m2/repository/org/apache/camel/camel-http/2.10.0.redhat-60024/camel-http-2.10.0.redhat-60024.jar!/META-INF/services/org/apache/camel/TypeConverter
[ main] AnnotationTypeConverterLoader DEBUG Loaded
5 @Converter classes
[ main] IntrospectionSupport DEBUG
Configured property: dataFormat on bean: Endpoint[/CustomersService] with
value: PAYLOAD
[ main] IntrospectionSupport DEBUG
Configured property: setDefaultBus on bean: Endpoint[/CustomersService] with
value: true
[ main] IntrospectionSupport DEBUG
Configured property: beanId on bean: Endpoint[/CustomersService] with value:
CustomersServiceConsumerEndpoint
[ main] SpringCamelContext DEBUG
cxf://bean:CustomersServiceConsumerEndpoint converted to endpoint:
Endpoint[cxf://bean:CustomersServiceConsumerEndpoint] by component:
org.apache.camel.component.cxf.CxfComponent@128215d
[ main] SpringCamelContext DEBUG Using
ComponentResolver: org.apache.camel.impl.DefaultComponentResolver@189acb5 to
resolve component with name: xslt
[ main] DefaultComponentResolver DEBUG Found
component: xslt in registry: null
[ main] DefaultComponentResolver DEBUG Found
component: xslt via type: org.apache.camel.component.xslt.XsltComponent via:
META-INF/services/org/apache/camel/component/xslt
[ main] DefaultComponent DEBUG
Creating endpoint uri=[xslt://xslt/mockCustomers.xslt?failOnNullBody=false],
path=[xslt/mockCustomers.xslt], parameters=[{failOnNullBody=false}]
[ main] XsltComponent DEBUG
org.apache.camel.component.xslt.XsltComponent@193c366 using schema resource:
xslt/mockCustomers.xslt
[ main] SpringCamelContext DEBUG
xslt://xslt/mockCustomers.xslt?failOnNullBody=false converted to endpoint:
Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false] by component:
org.apache.camel.component.xslt.XsltComponent@193c366
[ main] XsltUriResolver DEBUG
Resolving URI from classpath:: classpath:xslt/mockCustomers.xslt
[ main] DefaultChannel DEBUG
Initialize channel for target:
'To[xslt:xslt/mockCustomers.xslt?failOnNullBody=false]'
[ main] SpringCamelContext DEBUG Using
ComponentResolver: org.apache.camel.impl.DefaultComponentResolver@189acb5 to
resolve component with name: mock
[ main] DefaultComponentResolver DEBUG Found
component: mock in registry: null
[ main] DefaultComponentResolver DEBUG Found
component: mock via type: org.apache.camel.component.mock.MockComponent via:
META-INF/services/org/apache/camel/component/mock
[ main] DefaultComponent DEBUG
Creating endpoint uri=[mock://result], path=[result], parameters=[{}]
[ main] SpringCamelContext DEBUG
mock://result converted to endpoint: Endpoint[mock://result] by component:
org.apache.camel.component.mock.MockComponent@1517e5e
[ main] DefaultChannel DEBUG
Initialize channel for target: 'To[mock:result]'
[ main] SpringCamelContext DEBUG
Warming up route id: routeTest having autoStartup=true
[ main] RouteService DEBUG
Starting services on route: routeTest
[ main] CxfEndpoint DEBUG
ServerFactoryBean: org.apache.cxf.jaxws.JaxWsServerFactoryBean@a83c2a added
properties: {}
[ main] CxfEndpoint DEBUG Set
bus org.apache.cxf.bus.spring.SpringBus@105fa26 as thread default bus
[ main] ReflectionServiceFactoryBean INFO
Creating Service
{http://customer.service.esb.tecplata.com/}CustomersServiceService from
class com.tecplata.esb.service.customer.CustomersService
[ main] ServerImpl INFO
Setting the server's publish address to be /CustomersService
[ main] RouteService DEBUG
Starting child service on route: routeTest ->
Instrumentation:route[DelegateAsync[UnitOfWork(Pipeline[[Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])],
Channel[sendTo(Endpoint[mock://result])]]])]]
[ main] ProcessorEndpoint$1 DEBUG
Starting producer:
Producer[xslt://xslt/mockCustomers.xslt?failOnNullBody=false]
[ main] ProducerCache DEBUG Adding
to producer cache with key:
Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false] for producer:
Producer[xslt://xslt/mockCustomers.xslt?failOnNullBody=false]
[ main] DefaultErrorHandler DEBUG
Redelivery enabled: false on error handler:
DefaultErrorHandler[Wrap[TraceInterceptor[To[xslt:xslt/mockCustomers.xslt?failOnNullBody=false]]]
-> TraceInterceptor[To[xslt:xslt/mockCustomers.xslt?failOnNullBody=false]]]
[ main] MockEndpoint$1 DEBUG
Starting producer: Producer[mock://result]
[ main] ProducerCache DEBUG Adding
to producer cache with key: Endpoint[mock://result] for producer:
Producer[mock://result]
[ main] DefaultErrorHandler DEBUG
Redelivery enabled: false on error handler:
DefaultErrorHandler[Wrap[TraceInterceptor[To[mock:result]]] ->
TraceInterceptor[To[mock:result]]]
[ main] RouteService DEBUG
Starting child service on route: routeTest ->
DelegateAsync[UnitOfWork(RouteContextProcessor[Pipeline[[Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])],
Channel[sendTo(Endpoint[mock://result])]]]])]
[ main] RouteService DEBUG
Starting child service on route: routeTest ->
UnitOfWork(RouteContextProcessor[Pipeline[[Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])],
Channel[sendTo(Endpoint[mock://result])]]]])
[ main] RouteService DEBUG
Starting child service on route: routeTest ->
Pipeline[[Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])],
Channel[sendTo(Endpoint[mock://result])]]]
[ main] RouteService DEBUG
Starting child service on route: routeTest ->
Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])]
[ main] RouteService DEBUG
Starting child service on route: routeTest ->
sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])
[ main] RouteService DEBUG
Starting child service on route: routeTest ->
Channel[sendTo(Endpoint[mock://result])]
[ main] RouteService DEBUG
Starting child service on route: routeTest ->
sendTo(Endpoint[mock://result])
[ main] SpringCamelContext DEBUG Route:
routeTest >>>
EventDrivenConsumerRoute[Endpoint[cxf://bean:CustomersServiceConsumerEndpoint]
->
Instrumentation:route[DelegateAsync[UnitOfWork(RouteContextProcessor[Pipeline[[Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])],
Channel[sendTo(Endpoint[mock://result])]]]])]]]
[ main] SpringCamelContext DEBUG
Starting consumer (order: 1000) on route: routeTest
[ main] CxfConsumer DEBUG
Starting consumer: Consumer[cxf://bean:CustomersServiceConsumerEndpoint]
[ main] SpringCamelContext INFO Route:
routeTest started and consuming from:
Endpoint[cxf://bean:CustomersServiceConsumerEndpoint]
[ main] DefaultComponent DEBUG
Creating endpoint uri=[spring-event://default], path=[default],
parameters=[{}]
[ main] SpringCamelContext DEBUG
spring-event://default converted to endpoint:
Endpoint[spring-event://default] by component:
org.apache.camel.component.event.EventComponent@10e2558
[ main] SpringCamelContext INFO Total
1 routes, of which 1 is started.
[ main] SpringCamelContext INFO Apache
Camel 2.10.0.redhat-60024 (CamelContext: contextTest) started in 0.802
seconds
[ main] CxfEndpoint DEBUG
ClientFactoryBean: org.apache.camel.component.cxf.CxfEndpoint$1@b91602 added
properties: {}
[ main] ReflectionServiceFactoryBean INFO
Creating Service
{http://customer.service.esb.tecplata.com/}CustomersServiceService from
class com.tecplata.esb.service.customer.CustomersService
[ main] PayLoadDataFormatFeature INFO
removing the interceptor
org.apache.cxf.interceptor.ClientFaultConverter@1ae0e7d
[ main] ProducerCache DEBUG Adding
to producer cache with key:
Endpoint[cxf://bean:CustomersServiceConsumerEndpoint] for producer:
Producer[cxf://bean:CustomersServiceConsumerEndpoint]
[ main] ProducerCache DEBUG >>>>
Endpoint[cxf://bean:CustomersServiceConsumerEndpoint] Exchange[Message:
cxf:bean:CustomersServiceConsumerEndpoint]
[ main] CxfProducer DEBUG Try to
find a default operation. You should set 'operationName' in header.
[ main] DefaultCxfBinding DEBUG
Propagate to CXF header: breadcrumbId value:
ID-fluxit-ntb-43-56404-1369663427390-0-1
[ main] DefaultCxfBinding DEBUG
Propagate to CXF header: <soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cus="http://customer.service.esb.tecplata.com/">
<soapenv:Header />
<soapenv:Body>
<cus:filter xmlns:cus="http://customer.service.esb.tecplata.com/">
<cuit>1</cuit>
</cus:filter>
</soapenv:Body>
</soapenv:Envelope> value: {operationName=getCustomerByCuit,
operationNamespace=http:customer.service.esb.tecplata.com/}
[ main] CamelMockedRouteTest INFO
********************************************************************************
[ main] CamelMockedRouteTest INFO
Testing done:
testRespondToMessageUsingMocks(com.tecplata.esb.test.camel.CamelMockedRouteTest)
[ main] CamelMockedRouteTest INFO Took:
0.100 seconds (100 millis)
[ main] CamelMockedRouteTest INFO
********************************************************************************
[ main] GenericApplicationContext INFO
Closing
org.springframework.context.support.GenericApplicationContext@cb6009:
startup date [Mon May 27 11:03:47 ART 2013]; root of context hierarchy
[ main] SpringCamelContext DEBUG
onApplicationEvent:
org.springframework.context.event.ContextClosedEvent[source=org.springframework.context.support.GenericApplicationContext@cb6009:
startup date [Mon May 27 11:03:47 ART 2013]; root of context hierarchy]
[ main] DefaultListableBeanFactory INFO
Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1566a6c:
defining beans
[CustomersServiceConsumerEndpoint,template,consumerTemplate,contextTest:beanPostProcessor,contextTest,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor];
root of factory hierarchy
[ main] SpringCamelContext INFO Apache
Camel 2.10.0.redhat-60024 (CamelContext: contextTest) is shutting down
[ main] DefaultShutdownStrategy INFO
Starting to graceful shutdown 1 routes (timeout 10 seconds)
[ main] DefaultExecutorServiceManager DEBUG
Created new ThreadPool for source:
org.apache.camel.impl.DefaultShutdownStrategy@539a92 with name:
ShutdownTask. ->
org.apache.camel.util.concurrent.RejectableThreadPoolExecutor@c8f0a4
[Test) thread #0 - ShutdownTask] DefaultShutdownStrategy DEBUG There
are 1 routes to shutdown
[Test) thread #0 - ShutdownTask] DefaultShutdownStrategy DEBUG Route:
routeTest suspended and shutdown deferred, was consuming from:
Endpoint[cxf://bean:CustomersServiceConsumerEndpoint]
[Test) thread #0 - ShutdownTask] CxfConsumer DEBUG
Stopping consumer: Consumer[cxf://bean:CustomersServiceConsumerEndpoint]
[Test) thread #0 - ShutdownTask] SharedProducerServicePool DEBUG
Stopping service pool:
org.apache.camel.impl.SharedProducerServicePool@796e1c
[Test) thread #0 - ShutdownTask] ProcessorEndpoint$1 DEBUG
Stopping producer:
Producer[xslt://xslt/mockCustomers.xslt?failOnNullBody=false]
[Test) thread #0 - ShutdownTask] MockEndpoint$1 DEBUG
Stopping producer: Producer[mock://result]
[Test) thread #0 - ShutdownTask] DefaultShutdownStrategy INFO Route:
routeTest shutdown complete, was consuming from:
Endpoint[cxf://bean:CustomersServiceConsumerEndpoint]
[ main] DefaultShutdownStrategy INFO
Graceful shutdown of 1 routes completed in 0 seconds
[ main] RouteService DEBUG
Stopping services on route: routeTest
[ main] RouteService DEBUG
Shutting down child service on route: routeTest ->
Consumer[cxf://bean:CustomersServiceConsumerEndpoint]
[ main] RouteService DEBUG
Shutting down child service on route: routeTest ->
Instrumentation:route[DelegateAsync[UnitOfWork(RouteContextProcessor[Pipeline[[Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])],
Channel[sendTo(Endpoint[mock://result])]]]])]]
[ main] RouteService DEBUG
Shutting down child service on route: routeTest ->
DelegateAsync[UnitOfWork(RouteContextProcessor[Pipeline[[Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])],
Channel[sendTo(Endpoint[mock://result])]]]])]
[ main] RouteService DEBUG
Shutting down child service on route: routeTest ->
UnitOfWork(RouteContextProcessor[Pipeline[[Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])],
Channel[sendTo(Endpoint[mock://result])]]]])
[ main] RouteService DEBUG
Shutting down child service on route: routeTest ->
RouteContextProcessor[Pipeline[[Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])],
Channel[sendTo(Endpoint[mock://result])]]]]
[ main] RouteService DEBUG
Shutting down child service on route: routeTest ->
Pipeline[[Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])],
Channel[sendTo(Endpoint[mock://result])]]]
[ main] RouteService DEBUG
Shutting down child service on route: routeTest ->
Channel[sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])]
[ main] RouteService DEBUG
Shutting down child service on route: routeTest ->
sendTo(Endpoint[xslt://xslt/mockCustomers.xslt?failOnNullBody=false])
[ main] RouteService DEBUG
Shutting down child service on route: routeTest ->
Channel[sendTo(Endpoint[mock://result])]
[ main] RouteService DEBUG
Shutting down child service on route: routeTest ->
sendTo(Endpoint[mock://result])
[ main] RouteService DEBUG
Shutting down services on route: routeTest
[ main] DefaultExecutorServiceManager DEBUG
ShutdownNow ExecutorService:
org.apache.camel.util.concurrent.RejectableThreadPoolExecutor@c8f0a4
[ main] DefaultInflightRepository DEBUG
Shutting down with no inflight exchanges.
[ main] LazyLoadingTypeConverter INFO
TypeConverterRegistry utilization[attempts=8, hits=8, misses=0, failures=0]
mappings[total=197, misses=0]
[ main] SpringCamelContext INFO Apache
Camel 2.10.0.redhat-60024 (CamelContext: contextTest) is shutdown in 0.011
seconds. Uptime 0.924 seconds.
But I saw a *WARNING CxfProducer DEBUG Try to find a default operation. You
should set 'operationName' in header.* so im a little confuse, I put the
operation and the operationNamespace in the test.
However, it should be Camel responsible of creating the OperationName and
OperationNamespaces headers from the input XML.
Im using the fuse dependencies. Al my Camel* dependencies are
2.10.0.redhat-60024.
This is my tree of dependencies:
+- org.springframework:spring-context:jar:3.0.7.RELEASE:provided (scope not
updated to compile)
[INFO] | \-
org.springframework:spring-expression:jar:3.0.7.RELEASE:provided
[INFO] +- org.springframework:spring-core:jar:3.0.7.RELEASE:provided (scope
not updated to compile)
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:provided
[INFO] +- org.springframework:spring-tx:jar:3.0.7.RELEASE:provided (scope
not updated to compile)
[INFO] +- org.springframework:spring-beans:jar:3.0.7.RELEASE:provided (scope
not updated to compile)
[INFO] +- org.apache.camel:camel-spring:jar:2.10.0.redhat-60024:provided
(scope not updated to compile)
[INFO] +- org.apache.camel:camel-core:jar:2.10.0.redhat-60024:provided
(scope not updated to compile)
[INFO] | \- org.slf4j:slf4j-api:jar:1.6.6:provided
[INFO] +- org.apache.camel:camel-cxf:jar:2.10.0.redhat-60024:provided
[INFO] | +-
org.apache.camel:camel-cxf-transport:jar:2.10.0.redhat-60024:provided
[INFO] | | \- org.apache.cxf:cxf-rt-core:jar:2.6.0.redhat-60024:provided
[INFO] | | +- com.sun.xml.bind:jaxb-impl:jar:2.1.13:provided
[INFO] | | +- org.apache.ws.xmlschema:xmlschema-core:jar:2.0.3:provided
[INFO] | | \-
org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:provided
[INFO] | +-
org.apache.cxf:cxf-rt-frontend-jaxrs:jar:2.6.0.redhat-60024:provided
[INFO] | | +- org.apache.cxf:cxf-api:jar:2.6.0.redhat-60024:provided
[INFO] | | | +-
org.codehaus.woodstox:woodstox-core-asl:jar:4.2.0:provided
[INFO] | | | | \- org.codehaus.woodstox:stax2-api:jar:3.1.1:provided
[INFO] | | | \- wsdl4j:wsdl4j:jar:1.6.2:provided
[INFO] | | +- javax.ws.rs:jsr311-api:jar:1.1.1:provided
[INFO] | | +-
org.apache.cxf:cxf-rt-bindings-xml:jar:2.6.0.redhat-60024:provided
[INFO] | | \-
org.apache.cxf:cxf-rt-transports-http:jar:2.6.0.redhat-60024:provided
[INFO] | +-
org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.6.0.redhat-60024:provided
[INFO] | | +- xml-resolver:xml-resolver:jar:1.2:provided
[INFO] | | +- asm:asm:jar:3.3.1:provided
[INFO] | | +-
org.apache.cxf:cxf-rt-frontend-simple:jar:2.6.0.redhat-60024:provided
[INFO] | | \-
org.apache.cxf:cxf-rt-ws-addr:jar:2.6.0.redhat-60024:provided
[INFO] | | \-
org.apache.cxf:cxf-rt-ws-policy:jar:2.6.0.redhat-60024:provided
[INFO] | | \- org.apache.neethi:neethi:jar:3.0.2:provided
[INFO] | +-
org.apache.camel:camel-blueprint:jar:2.10.0.redhat-60024:provided
[INFO] | | +-
org.apache.camel:camel-core-xml:jar:2.10.0.redhat-60024:provided
[INFO] | | \-
org.apache.camel:camel-core-osgi:jar:2.10.0.redhat-60024:provided
[INFO] | +-
org.apache.aries.blueprint:org.apache.aries.blueprint:jar:1.0.1.redhat-60024:provided
[INFO] | \-
org.apache.cxf:cxf-rt-bindings-soap:jar:2.6.0.redhat-60024:provided
[INFO] | \-
org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.6.0.redhat-60024:provided
[INFO] +- org.apache.camel:camel-jetty:jar:2.10.0.redhat-60024:provided
[INFO] | +- org.apache.camel:camel-http:jar:2.10.0.redhat-60024:provided
[INFO] | | +- commons-httpclient:commons-httpclient:jar:3.1:provided
[INFO] | | \- commons-codec:commons-codec:jar:1.6:provided
[INFO] | +-
org.apache.geronimo.specs:geronimo-servlet_2.5_spec:jar:1.1.2:provided
[INFO] | +- org.eclipse.jetty:jetty-server:jar:7.6.7.v20120910:provided
[INFO] | | +-
org.eclipse.jetty.orbit:javax.servlet:jar:2.5.0.v201103041518:provided
[INFO] | | +-
org.eclipse.jetty:jetty-continuation:jar:7.6.7.v20120910:provided
[INFO] | | \- org.eclipse.jetty:jetty-http:jar:7.6.7.v20120910:provided
[INFO] | | \- org.eclipse.jetty:jetty-io:jar:7.6.7.v20120910:provided
[INFO] | +- org.eclipse.jetty:jetty-security:jar:7.6.7.v20120910:provided
[INFO] | +- org.eclipse.jetty:jetty-servlet:jar:7.6.7.v20120910:provided
[INFO] | +- org.eclipse.jetty:jetty-servlets:jar:7.6.7.v20120910:provided
[INFO] | | \- org.eclipse.jetty:jetty-util:jar:7.6.7.v20120910:provided
[INFO] | +- org.eclipse.jetty:jetty-client:jar:7.6.7.v20120910:provided
[INFO] | \- org.eclipse.jetty:jetty-jmx:jar:7.6.7.v20120910:provided
[INFO] +- org.apache.camel:camel-jms:jar:2.10.0.redhat-60024:compile
[INFO] | \- org.springframework:spring-jms:jar:3.1.3.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile
[INFO] +- org.apache.camel:camel-test-spring:jar:2.10.0.redhat-60024:test
[INFO] | +- org.apache.camel:camel-test:jar:2.10.0.redhat-60024:test
[INFO] | \- org.springframework:spring-test:jar:3.0.7.RELEASE:test (version
managed from 3.1.3.RELEASE)
[INFO] +- org.apache.camel:camel-test-blueprint:jar:2.10.0.redhat-60024:test
[INFO] | +- org.apache.aries:org.apache.aries.util:jar:1.0.0:test
[INFO] | +-
org.apache.aries.proxy:org.apache.aries.proxy.impl:jar:1.0.0:test
[INFO] | +-
org.apache.aries.proxy:org.apache.aries.proxy.api:jar:1.0.0:test
[INFO] | +-
com.googlecode.pojosr:de.kalpatec.pojosr.framework:jar:0.2.1:test
[INFO] | +- org.ops4j.pax.swissbox:pax-swissbox-tinybundles:jar:1.3.1:test
[INFO] | | +- org.ops4j.base:ops4j-base-lang:jar:1.2.2:test
[INFO] | | +- org.ops4j.base:ops4j-base-io:jar:1.2.2:test
[INFO] | | | \- org.ops4j.base:ops4j-base-monitors:jar:1.2.2:test
[INFO] | | +- org.ops4j.base:ops4j-base-store:jar:1.2.2:test
[INFO] | | \- org.ops4j.pax.swissbox:pax-swissbox-bnd:jar:1.3.1:test
[INFO] | | \- biz.aQute:bndlib:jar:0.0.357:test
[INFO] | +- junit:junit:jar:4.7:test
[INFO] | +- org.apache.felix:org.apache.felix.configadmin:jar:1.2.4:test
[INFO] | \- org.apache.felix:org.apache.felix.fileinstall:jar:3.2.6:test
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:test
[INFO] \- log4j:log4j:jar:1.2.16:test
--
View this message in context: http://camel.465427.n5.nabble.com/Test-route-with-CXF-endpoint-tp5733266.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Test route with CXF endpoint
Posted by Aki Yoshida <el...@gmail.com>.
your usage of requestBodyAndHeader doesn't look right.
inputProducerTemplate.requestBodyAndHeader("cxf:bean:CustomersServiceConsumerEndpoint",
body, mapHeaders);
the first argument is supposed to be the body value, see
/**
* Sends the body to the default endpoint and returns the result content
* Uses an {@link ExchangePattern#InOut} message exchange pattern.
* <br/><br/>
* <p/><b>Notice:</b> that if the processing of the exchange failed
with an Exception
* it is thrown from this method as a {@link
org.apache.camel.CamelExecutionException} with
* the caused exception wrapped.
*
* @param body the payload
* @param header the header name
* @param headerValue the header value
* @return the result (see class javadoc)
* @throws CamelExecutionException if the processing of the exchange
failed
*/
Object requestBodyAndHeader(Object body, String header, Object
headerValue) throws CamelExecutionException;
regarding the missing exception you mentioned (and if the exception is
swallowed), this needs to be looked into to see if we can log the exception.
2013/5/27 Chubutin <ra...@gmail.com>
> I created a new Project with this example, be free to take a look. Thank
> you!
>
> exampleCamelCXF.tar
> <http://camel.465427.n5.nabble.com/file/n5733278/exampleCamelCXF.tar>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Test-route-with-CXF-endpoint-tp5733266p5733278.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: Test route with CXF endpoint
Posted by Chubutin <ra...@gmail.com>.
I created a new Project with this example, be free to take a look. Thank you!
exampleCamelCXF.tar
<http://camel.465427.n5.nabble.com/file/n5733278/exampleCamelCXF.tar>
--
View this message in context: http://camel.465427.n5.nabble.com/Test-route-with-CXF-endpoint-tp5733266p5733278.html
Sent from the Camel - Users mailing list archive at Nabble.com.