Re: Camel CXF - wrong Content-Type sent

2016-11-22 Thread Aki Yoshida
Umm. I don't know if the namespace for the soap binding is right.
According to the online doc
(https://cxf.apache.org/docs/schemas-and-namespaces.html), the
namespace for the soap binding is http://cxf.apache.org/bindings/soap
for both spring and blueprint.


2016-11-22 15:31 GMT+01:00 martin.pelikan :
> Hi Aki, I specified my question. You are correct about using WSDL v1.1. But
> set binding to SOAP1.2 did not help
> 
>  xmlns:soap="http://cxf.apache.org/blueprint/bindings/soap; />
> 
>
>
>
> Here is stack trace from Karaf:
>
> RouteId  ProcessorId  Processor
> Elapsed (ms)
> [SendMessage_8008] [SendMessage_8008] [http://0.0.0.0:8008/SendMessage
> ] [   590]
> [SendMessage_8008] [to14  ] [SendMessage1
> ] [   590]
>
> Exchange
> ---
> Exchange[
> Id  ID-MPELIKAN02-52343-1479816939214-16-2
> ExchangePattern InOut
> Headers
> {breadcrumbId=ID-MPELIKAN02-52343-1479816939214-16-1,
> CamelCxfMessage={javax.xml.ws.wsdl.port={urn:send:message:v1}c3port,
> org.apache.cxf.service.model.MessageInfo=[MessageInfo INPUT:
> {urn:send:message:v1}SendMessageRequest],
> org.apache.cxf.message.Message.PROTOCOL_HEADERS={accept-encoding=[gzip,deflate],
> connection=[keep-alive], Content-Length=[1172],
> content-type=[application/soap+xml; charset=utf-8], Host=[localhost:8008],
> SOAPAction=["urn:send:message:v1:Request"],
> User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]},
> org.apache.cxf.ws.addressing.MAPAggregator=org.apache.cxf.ws.addressing.impl.MAPAggregatorImpl@5e1865ca,
> org.apache.cxf.interceptor.LoggingMessage.ID=29,
> HTTP_CONTEXT_MATCH_STRATEGY=stem,
> org.apache.cxf.request.url=http://localhost:8008/SendMessage,
> javax.xml.ws.wsdl.interface={urn:send:message:v1}ISendMessage,
> org.talend.esb.sam.agent.message.CustomInfo={},
> org.apache.cxf.request.uri=/SendMessage, HTTP.REQUEST=(POST
> /SendMessage)@331538697 org.eclipse.jetty.server.Request@13c2e109,
> HTTP.CONFIG=null, org.apache.cxf.transport.https.CertConstraints=null,
> Accept=null,
> org.apache.cxf.headers.Header.list=[org.apache.cxf.headers.Header@5f442001,
> org.apache.cxf.binding.soap.SoapHeader@71915283,
> org.apache.cxf.binding.soap.SoapHeader@7bc050b4,
> org.apache.cxf.binding.soap.SoapHeader@ef298e5,
> org.apache.cxf.binding.soap.SoapHeader@5913ea0d,
> org.apache.cxf.binding.soap.SoapHeader@2a6b292b],
> org.apache.cxf.message.Message.PATH_INFO=/SendMessage,
> org.apache.cxf.message.Message.BASE_PATH=/SendMessage,
> org.apache.cxf.message.FaultMode=UNCHECKED_APPLICATION_FAULT,
> org.apache.cxf.interceptor.DocLiteralInInterceptor.DocLiteralInInterceptor.keep-parameters-wrapper=true,
> FlowId=urn:uuid:c631987b-7aff-4e99-a4dc-c4cca467003b,
> schema-validation-enabled=NONE,
> org.apache.cxf.continuations.ContinuationProvider=org.apache.cxf.transport.http_jetty.continuations.JettyContinuationProvider@615bdbce,
> javax.xml.ws.wsdl.service={urn:send:message:v1}SendMessageService,
> org.apache.cxf.message.Message.IN_INTERCEPTORS=[org.apache.cxf.transport.https.CertConstraintsInterceptor@df80db],
> org.apache.cxf.binding.soap.SoapVersion=org.apache.cxf.binding.soap.Soap11@5184aa4f,
> org.apache.cxf.message.Message.ENCODING=UTF-8,
> org.apache.cxf.message.Message.QUERY_STRING=null, HTTP.RESPONSE=HTTP/1.1 200
>
> ,
> org.apache.cxf.security.SecurityContext=org.apache.cxf.transport.http.AbstractHTTPDestination$2@55bbe351,
> org.apache.cxf.request.method=POST,
> org.apache.cxf.async.post.response.dispatch=true,
> org.apache.cxf.configuration.security.AuthorizationPolicy=null,
> javax.xml.ws.wsdl.operation={urn:send:message:v1}SendMessage,
> org.apache.cxf.message.MessageFIXED_PARAMETER_ORDER=false,
> org.apache.cxf.transport.Destination=org.apache.cxf.transport.http_jetty.JettyHTTPDestination@685e5345,
> SOAPAction=urn:send:message:v1:Request,
> javax.xml.ws.wsdl.description=http://0.0.0.0:8008/SendMessage?wsdl,
> org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.DocLiteralInInterceptor.keep-parameters-wrapper=true,
> http.base.path=http://localhost:8008, Content-Type=application/soap+xml;
> charset=utf-8, HTTP.CONTEXT=ServletContext@o.e.j.s.h.ContextHandler{,null}},
> CamelRedelivered=false, CamelRedeliveryCounter=0,
> content-type=application/soap+xml; charset=utf-8, operationName=SendMessage,
> operationNamespace=urn:send:message:v1}
> BodyTypeorg.apache.camel.component.cxf.CxfPayload
> Body
> ]
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-CXF-wrong-Content-Type-sent-tp5790368p5790370.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel CXF - wrong Content-Type sent

2016-11-22 Thread Aki Yoshida
you can't set the content-type in that way as the content-type is
generated when the soap message is created.
In other words, the content-type is determined by the soap protocol
being used. I suppose your producer has the wsdl that uses SOAP 1.1
that assumes text/xml. To overwrite the soap protocol, please try
setting the soap 1.2 binding in your producer endpoint.
regards, aki

2016-11-22 14:48 GMT+01:00 martin.pelikan :
> Hi all,
>
> I am trying to send SOAP request with Content-Type application/soap+xml. I
> call SOAPConsumer with correct header, in the middle of the route header is
> modified once again (to be sure), but in the end I get HTTP response '415:
> Cannot process the message because the content type 'text/xml;
> charset=UTF-8' was not the expected type 'application/soap+xml;
> charset=utf-8'.'
>
> Why does CXF changes the content-type and how to force it not to?
>
> ///Consumer endpoint
>  address="http://${http.host}:${http.port}/SendMessage;
> serviceName="tns:SendMessageService" wsdlURL="classpath:/SendMessage.wsdl"
> xmlns="http://camel.apache.org/schema/blueprint/cxf;
> xmlns:tns="urn:send:message">
> 
>  xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0; />
> 
> 
> 
> 
> 
>  xmlns:soap="http://cxf.apache.org/blueprint/bindings/soap; />
> 
> 
>  xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0; />
>  interface="org.talend.esb.sam.agent.feature.EventFeature"
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0; />
> 
> 
>
> ///Producer endpoint
>  wsdlURL="classpath:/SendMessage.wsdl" address="${http.client.url}"
> xmlns="http://camel.apache.org/schema/blueprint/cxf;
> xmlns:tns="urn:send:message">
> 
>  xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0; />
>  value="${ws-security.username}"
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0; />
>  value="${ws-security.password}"
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0; />
> 
> 
> 
>  interface="org.talend.esb.sam.agent.feature.EventFeature"
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0; />
>  xmlns:wsa="http://cxf.apache.org/ws/addressing; />
> http://cxf.apache.org/policy;>
>  URI="etc/org.talend.esb.job.token.policy"
> xmlns="http://www.w3.org/ns/ws-policy; />
> 
> 
> 
>
>
> 
>  
>
>application/soap+xml;
> charset=utf-8
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-CXF-wrong-Content-Type-sent-tp5790368.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: ahc-ws

2016-08-10 Thread Aki Yoshida
I think there is no websocket provider registered by the ahc client.
Please check if you have e.g., mvn:io.netty/netty/3.9.2.Final on your classpath.

2015-08-10 12:35 GMT+02:00 Sanjana :
> Hello,
> I am using ahc-ws to send messages a server. I have done it like this -
> http://camel.apache.org/schema/spring;>
>
> 
> 
> 
> 
>
>
>
> 
>   
>
>
>
>   
>
>   
>  
>  
> 
>
> In the transform method of hcpTransform bean i have created the payload to
> be sent.  In the process bean i have added required headers like
> authentication , httpmethod etc.
> I have set the proxy using properties tag.
>  But i get an exception - "java.net.MalformedURLException: Unknown protocol:
> ws" Caused by: java.lang.IllegalStateException: Unknown protocol: ws.
>
> How do i resolve this?
>
> Any help will be appreciated...Thanks!
>
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/ahc-ws-tp5770524.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SOAP Envelope and headers are not added by CXF by default

2016-06-21 Thread Aki Yoshida
dataFormat=MESSAGE assumes the body content represents the entire soap message.
If you are sending the plain payload to the endpoint, you have to use
use dataFormat=PAYLOAD so that it will be wrapped in the soap
envelope.

2016-06-21 2:52 GMT+02:00 Shultz, Dmitry :
> Hi All,
>
> I have a route configured like this:
>
> public void configure() throws Exception {
>
> String cxfUri = 
> String.format("cxf://%s/?dataFormat=MESSAGE=%s=%s=true",
> url, user, password);
> CxfEndpoint myCxfEp = (CxfEndpoint) getContext().getEndpoint(cxfUri);
> myCxfEp.setServiceClass(org.tem.SomeService.class);
>
> from("direct:service1")
> .to(cxfUri)
> }
>
> When I put request object in the body and send it to "direct:service1" It is 
> marshaled  to xml correctly and sent, but for some reason it doesn't wrap it 
> with SOAP envelope and headers (the http payload has only the request xml). 
> Is there anything special supposed to be done in order to make sure outgoing 
> message has the proper soap format?
>
> Cheers,
> Dmitry


Re: ahc-ws doesn't shutdown route if the connection is severed

2015-12-23 Thread Aki Yoshida
I think a more reasonable behavior would be to automatically reconnect
if the connection dies (i.e., its stale status is detected when
monitoring the onClose and onError callbacks).


2015-12-23 16:43 GMT+01:00 rabreu :
> Is there any way that a websocket client can automatically shutdown the route
> if the connection is lost?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/ahc-ws-doesn-t-shutdown-route-if-the-connection-is-severed-tp5775420p5775421.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel 2.15.0 - No component found with scheme: ahc

2015-12-21 Thread Aki Yoshida
you also need camel-ahc.jar and not just ahc.jar and that is probably missing.

2015-12-21 5:44 GMT+01:00 Kranti Parisa :
> Hi,
>
> All of a sudden I'm getting this error. The same routes were working fine
> earlier. I did check the jars in the classpath and ahc jar does exist. Is
> there anything specific that I'm missing here? I'm confused a bit,
> especially because it was working fine. Using camel 2.15.0
>
>
>
> No component found with scheme: ahc
> at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1556)
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:123)
> at
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:332)
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
> at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
> at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
> at
> org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
> at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
> at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
> at
> org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543)
> at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
> at
> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
> at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)
> at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
> at
> org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
> at
> org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
> at
> org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
> at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
> at org.mortbay.jetty.Server.doStart(Server.java:222)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
>
>
> Thanks,
> Kranti


Re: Split and tokenizeXML not working with Jaxb unmarshal with Part class.

2015-12-21 Thread Aki Yoshida
Your sample was not pasted nicely and it is not really readable.
But guessing from what you described,  you seem to be saying that the
split result didn't exactly match the schema? In other words, some
namespaces were dropped in the split result? If that is the case, that
can happen when you are using tokenizeXML. To get xml-aware splitting,
you should use xtokenize. see http://camel.apache.org/splitter.html

2015-12-19 14:58 GMT+01:00 sonu123 :
> Hi,
> I have manged to make it work but with a one minor change.  I found my XSD
> has namepace like this
>  xmlns=b>urn:iso:std:iso:20022:tech:xsd:camt.086.001.01*"
> xmlns:xs="http://www.w3.org/2001/XMLSchema; elementFormDefault="qualified"
> targetNamespace="urn:iso:std:iso:20022:tech:xsd:camt.086.001.01">
> And my xjc generated package-info.java has
> @javax.xml.bind.annotation.XmlSchema(*namespace =
> "urn:iso:std:iso:20022:tech:xsd:camt.086.001.01"*, elementFormDefault =
> javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
> I replaced the namespace with empty string
> @javax.xml.bind.annotation.XmlSchema(namespace = *""*, elementFormDefault =
> javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
>
> Now I can see CurrencyExchange6 class is correctly populated. Let me know if
> there are better ways of doing it.
> My final codes is
> @Override
> public RouteBuilder createRouteBuilder() {
> return new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> final JAXBContext jaxbContext =
> JAXBContext.newInstance(com.main.sandeepone.CurrencyExchange6.class);
> JaxbDataFormat jaxb = new JaxbDataFormat(jaxbContext);
> CurrencyExchange6 c=new CurrencyExchange6();
> jaxb.setPartClass(c.getClass().getCanonicalName());
> jaxb.setFragment(true);
>
> from("file:target/in?noop=true=camt.086.001.01.xml").log("Content
> of the ISO20022  file: ${body}")
> .split()
> .tokenizeXML("CcyXchg")
> .streaming() .executorService(threadPool)
> .log("Content of the splitted file: ${body}")
>.unmarshal(jaxb)
> .log("Content of the marshalled: ${body}")
> .to("seda:update")
> .end()
> .log("Done processing the file:
> ${header.CamelFileName}");
>
> from("seda:update?concurrentConsumers=20")
> .bean(InventoryService.class, "doSomeThingHere");
> }
> };
> }
>
> sonu123 wrote
>> Tried with stax, but not working.  I am wondering, if there is any way, I
>> can convert the String generated from tokenizeXML into POJO.
>
>
> sonu123 wrote
>> Tried with stax, but not working.  I am wondering, if there is any way, I
>> can convert the String generated from tokenizeXML into POJO.
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Split-and-tokenizeXML-not-working-with-Jaxb-unmarshal-with-Part-class-tp5775239p5775281.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Soap Body is Empty or Partial XML

2015-12-03 Thread Aki Yoshida
i think something is consuming the payload stream somewhere before
your other processing step is trying to consume/convert the data.
when using streaming, either you can consume the data once or must
convert it to something else if it needs to be consumed again.

CAMEL-8663 is not related to this behavior.

2015-12-02 21:55 GMT+01:00 ychawla :
> Hello All,
> I added the parameter: allowStreaming=false to the CXF endpoints that were
> causing an issue and then they started to work normally.  It definitely
> seems like a bug because I would send consecutive schema valid messages and
> one would fail with the WoodStox exception and the other would not.
>
> Disabling streaming works but I believe there is a bug with the stream being
> sent from CXF to Camel.  Maybe it could be related to this JIRA issue:
>
> https://issues.apache.org/jira/browse/CAMEL-8663
>
> In my use case, I need to modify the payload and extract elements from it so
> it needs to be converted to a DOM anyway.
>
> Hopefully this helps the next person who sees this issue.
>
> However, does anyone know how to set the allowStreaming property globally
> for all CXF endpoints?
>
> Thanks,
> Yogesh
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Soap-Body-is-Empty-or-Partial-XML-tp5774364p5774624.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-servlet is no-longer working in 2.16.1 (works in 2.15.3 and 2.16.0)

2015-12-01 Thread Aki Yoshida
There was some change introduced by CAMEL-9263 and there was a bug
that calculated the wrong path in some cases.
But this bug shouldn't affect normal servlet scenarios. So, I don't
know why your scenario that runs with 2.16.0 is not running with
2.16.1.
You may try 2.16.2-SNAPSHOT to see if your scenario runs with that
version, as this version corrects the mentioned bug.

In other cases, we need to see if there are any error logs indicating
why the endpoint is not starting.

2015-11-30 15:14 GMT+01:00 MEL :
> I am using the camel-servlet component, in an app hosted in tomcat, to
> trigger a route via a URL such as this
>
> http://localhost:9090/appcontext/triggerimport/
>
> When upgrading to 2.16.1 the URL fails to trigger the route;  the URL works
> if I downgrade to 2.15.3 or 2.16.0 (looks like CAMEL-9263 may have
> introduced the issue)
>
>
>
>
> web.xml
>
>
> 
> MyTriggerImportServlet
> Trigger import of JArchive 
> content
>
> org.apache.camel.component.servlet.CamelHttpTransportServlet
> 2
> 
> ignoreDuplicateServletName
> true
> 
> 
>
>
> 
> MyTriggerImportServlet
> /triggerimport/*
> 
>
>
>
> camel-config.xml
>
> 
>  uri="servlet://jarchive?servletName=MyTriggerImportServlet=true"
> />
>  />
> 
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-servlet-is-no-longer-working-in-2-16-1-works-in-2-15-3-and-2-16-0-tp5774558.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: cxfendpoint consumer fails for certain WS soap calls (2.16.0) - nullpoint exception

2015-11-16 Thread Aki Yoshida
there has been some recent fixes in Camel that are related to the
namespace handling.

Could you describe your scenario in more details? How is the route configured?

thanks.
aki

2015-11-13 4:32 GMT+01:00 bocamel :
> After upgrade to 2.16.0, certain WS soap calls fail with the error below.
> This works with all the combinations of 2.15.x and CXF 3.1.x.  But it does
> not work for 2.16.0 and CXF 3.1.x.  Is there any change I need to make for
> the CXF endpoint (consumer or producer) for 2.16.0?  Using IDE, I could see
> that for some soap calls, the in message body can be converted to String.
> But others it would only show CXFPayload.  These soap calls are almost
> identical.
>
> Thanks for any help!
>
> Stacktrace
> ---
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> store file:
> log\acme\uat\.\2015-11-12\failed_messages\20151112-222445902.xml
> at
> org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:292)
> at
> org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:277)
> at
> org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:165)
> at
> org.apache.camel.component.file.GenericFileProducer.process(GenericFileProducer.java:79)
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at
> org.apache.camel.processor.SendDynamicProcessor$1.doInAsyncProducer(SendDynamicProcessor.java:124)
> at
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:341)
> at
> org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:119)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:460)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
> at
> org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:137)
> at
> org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:133)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.apache.camel.InvalidPayloadException: No body available of
> type: java.io.InputStream but has value:
> org.apache.camel.component.cxf.CxfPayload@297d8e2e of type:
> org.apache.camel.component.cxf.CxfPayload on: Message:
> org.apache.camel.component.cxf.CxfPayload@297d8e2e. Caused by: Error during
> type conversion from type: java.lang.String to the required type:
> java.io.InputStream with value
> org.apache.camel.component.cxf.CxfPayload@297d8e2e due Problem converting
> content to Element. Exchange[ID-John-PCI-54846-1447385077811-0-10][Message:
> org.apache.camel.component.cxf.CxfPayload@297d8e2e]. Caused by:
> [org.apache.camel.TypeConversionException - Error during type conversion
> from type: java.lang.String to the required type: java.io.InputStream with
> value org.apache.camel.component.cxf.CxfPayload@297d8e2e due Problem
> converting content to Element]
> at
> org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:101)
> at
> org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:273)
> ... 17 more
> Caused by: org.apache.camel.TypeConversionException: Error during type
> conversion from type: java.lang.String to the required type:
> java.io.InputStream with value
> org.apache.camel.component.cxf.CxfPayload@297d8e2e due Problem converting
> content to Element
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:610)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:177)
> at
> org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:99)
> ... 18 more
> Caused by: org.apache.camel.RuntimeCamelException: Problem converting
> content to Element
> at 
> org.apache.camel.component.cxf.CxfPayload$1.get(CxfPayload.java:101)
> at org.apache.camel.component.cxf.CxfPayload$1.get(CxfPayload.java:66)
> at
> org.apache.camel.component.cxf.converter.NodeListWrapper.item(NodeListWrapper.java:37)
> at
> 

Re: Camel 2.16 vs Jetty9 vs camel-websocket

2015-11-10 Thread Aki Yoshida
jetty8 and jetty9 have a different websocket handler interface, so you
can't just replace the jetty version unless the component includes two
specific implementations that can be used depending on the available
version.

if you want to choose your own serverlet container (e.g., jetty9,
tomcat8, etc), you can use camel-atmosphere-websocket.


2015-11-10 17:49 GMT+01:00 fabrizio.spataro :
> Hello,
>
> i would use camel 2.16 + jetty9 + camel-websocket but this component depends
> from jetty8.
>
> How can i do?
>
> i am trying force to use jetty9 from maven without success.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-2-16-vs-Jetty9-vs-camel-websocket-tp5773575.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: The new camel-swagger-java module in Apache Camel 2.16

2015-09-25 Thread Aki Yoshida
Hi Claus,
Cool.

I wanted to try it out on the Karaf setup that we have for CXF with
swagger 1.5.4.

Then I noticed that camel-swagger-java is asking for jackson [2.6,3).
I am wondering if we could make it down to [2.4,3).

swagger itself is currently using 2.4.x and in the CXF's current Karaf
setup, we are bringing 2.4.6 in at the moment.
So, setting the range down to 2.4 makes life easier.
Or do you think we all should be going for 2.6.x?

regards, aki

2015-09-23 15:11 GMT+02:00 Claus Ibsen :
> Hi
>
> I just recorded a 5 minute video showing this in action
> http://www.davsclaus.com/2015/09/apache-camel-216-swagger-java-and-api.html
>
> At least with this new model the swagger is more light-weight (just
> java) and its auto detected easily from Camel, and you can run it in
> any JVM (not only servlet).
>
> I haven't yet tried on karaf, but it ought to work much better than
> the scala based.
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2nd edition: https://www.manning.com/books/ibsen2


Re: The new camel-swagger-java module in Apache Camel 2.16

2015-09-25 Thread Aki Yoshida
Hi Claus,
The OSGi sample was included in CXF 3.1.3 and it uses this installer
description at the moment.
https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/description_swagger2_osgi/src/test/resources/features/features.xml

The same sample is also in 3.0.7-SNAPSHOT.

We haven't updated the cxf's features file with this swagger support
option yet because we are waiting for the 1.5.4 release.

What I noticed was that swagger build itself has some issue with
jackson 2.6.2. I wanted to look into it but haven't done it, so I
don't know if this is an issue with the test code or the code itself.
And this was the reason why I was bringing up this version question.

Thanks.
regards, aki



2015-09-25 14:26 GMT+02:00 Claus Ibsen <claus.ib...@gmail.com>:
> What version of CXF is that?
>
>
> On Fri, Sep 25, 2015 at 1:05 PM, Aki Yoshida <elak...@gmail.com> wrote:
>> Hi Claus,
>> Cool.
>>
>> I wanted to try it out on the Karaf setup that we have for CXF with
>> swagger 1.5.4.
>>
>> Then I noticed that camel-swagger-java is asking for jackson [2.6,3).
>> I am wondering if we could make it down to [2.4,3).
>>
>> swagger itself is currently using 2.4.x and in the CXF's current Karaf
>> setup, we are bringing 2.4.6 in at the moment.
>> So, setting the range down to 2.4 makes life easier.
>> Or do you think we all should be going for 2.6.x?
>>
>> regards, aki
>>
>> 2015-09-23 15:11 GMT+02:00 Claus Ibsen <claus.ib...@gmail.com>:
>>> Hi
>>>
>>> I just recorded a 5 minute video showing this in action
>>> http://www.davsclaus.com/2015/09/apache-camel-216-swagger-java-and-api.html
>>>
>>> At least with this new model the swagger is more light-weight (just
>>> java) and its auto detected easily from Camel, and you can run it in
>>> any JVM (not only servlet).
>>>
>>> I haven't yet tried on karaf, but it ought to work much better than
>>> the scala based.
>>>
>>> --
>>> Claus Ibsen
>>> -
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2nd edition: https://www.manning.com/books/ibsen2
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2nd edition:
> https://www.manning.com/books/camel-in-action-second-edition


Re: The new camel-swagger-java module in Apache Camel 2.16

2015-09-25 Thread Aki Yoshida
thanks.


2015-09-25 14:56 GMT+02:00 Andrea Cosentino <ancosen1...@yahoo.com.invalid>:
> I've upgraded Jackson to 2.6.2 while Claus was working on 
> Camel-swagger-java.. I wasn't aware of this problem, but we can downgrade 
> Jackson for the moment and bring it back to version 2.6.1.
> --Andrea Cosentino  -Apache Camel Committer  
> Email: ancosen1...@yahoo.com  Twitter: @oscerd2  Github: oscerd
>
>
>  On Friday, September 25, 2015 2:49 PM, Aki Yoshida <elak...@gmail.com> 
> wrote:
>
>
>  Hi Claus,
> The OSGi sample was included in CXF 3.1.3 and it uses this installer
> description at the moment.
> https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/description_swagger2_osgi/src/test/resources/features/features.xml
>
> The same sample is also in 3.0.7-SNAPSHOT.
>
> We haven't updated the cxf's features file with this swagger support
> option yet because we are waiting for the 1.5.4 release.
>
> What I noticed was that swagger build itself has some issue with
> jackson 2.6.2. I wanted to look into it but haven't done it, so I
> don't know if this is an issue with the test code or the code itself.
> And this was the reason why I was bringing up this version question.
>
> Thanks.
> regards, aki
>
>
>
> 2015-09-25 14:26 GMT+02:00 Claus Ibsen <claus.ib...@gmail.com>:
>> What version of CXF is that?
>>
>>
>> On Fri, Sep 25, 2015 at 1:05 PM, Aki Yoshida <elak...@gmail.com> wrote:
>>> Hi Claus,
>>> Cool.
>>>
>>> I wanted to try it out on the Karaf setup that we have for CXF with
>>> swagger 1.5.4.
>>>
>>> Then I noticed that camel-swagger-java is asking for jackson [2.6,3).
>>> I am wondering if we could make it down to [2.4,3).
>>>
>>> swagger itself is currently using 2.4.x and in the CXF's current Karaf
>>> setup, we are bringing 2.4.6 in at the moment.
>>> So, setting the range down to 2.4 makes life easier.
>>> Or do you think we all should be going for 2.6.x?
>>>
>>> regards, aki
>>>
>>> 2015-09-23 15:11 GMT+02:00 Claus Ibsen <claus.ib...@gmail.com>:
>>>> Hi
>>>>
>>>> I just recorded a 5 minute video showing this in action
>>>> http://www.davsclaus.com/2015/09/apache-camel-216-swagger-java-and-api.html
>>>>
>>>> At least with this new model the swagger is more light-weight (just
>>>> java) and its auto detected easily from Camel, and you can run it in
>>>> any JVM (not only servlet).
>>>>
>>>> I haven't yet tried on karaf, but it ought to work much better than
>>>> the scala based.
>>>>
>>>> --
>>>> Claus Ibsen
>>>> -
>>>> http://davsclaus.com @davsclaus
>>>> Camel in Action 2nd edition: https://www.manning.com/books/ibsen2
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2nd edition:
>> https://www.manning.com/books/camel-in-action-second-edition
>
>
>


Re: CXF features in camel-cxf component

2015-09-03 Thread Aki Yoshida
you can configure cxf features at the camel-cxf endpoint as well.
http://camel.apache.org/cxf.html


2015-09-03 9:59 GMT+02:00 Rafik EL YAAGOUBI (contractor)
:
> Hello,
>
> I'm using Camel 15.2, I would like to use camel-cxf component in CXF Dispatch 
> mode and enable CXF features, should I configure a custom bus or is there any 
> way to declare features directly in the endpoint?
>
> Thank you.
>
> Regards,
> Rafik EL YAAGOUBI
>


Re: Camel CXF Transport works within Blueprint only when XSD validation is disabled

2015-08-25 Thread Aki Yoshida
The id attribute in blueprint is typed as xsd:ID and can't take an
arbitrary value.
So, actually you shouldn't be using that value that violates this syntax rule.

The validation attribute is often used to intentionally disable the
validation to workaround the known limitation of the validation with
the parameterized values.

For example, when you have a schema where the value type is typed as
URL, when you have
value=${endpoint.url} where ${endpoint.url} is set to
http://localhost:8181/cxf/myservice;
the real content after the parameter injection, you have
value = http://localhost:8181/cxf/myservice;
and this is schema-valid, but the schema validation is performed prior
to the parameter injection, so you need to disable the entire
validation to avoid getting the validation error. I think I suggested
adding another option of only disabling the primitive-type check some
years ago at the aries mailing list.

http://mail-archives.apache.org/mod_mbox/aries-user/201212.mbox/%3ccaf8t5xud7q+jyhucx-pm6yn5z9hmopsxgbmkyaxuirxruzn...@mail.gmail.com%3E

but I think there is no such option and I also didn't pursue this issue.

Regarding the non-published camel-cxf schema, I think the problem was
its namespace and its schemaLocation. It is actually a schema defined
in the camel project but it uses the cxf namespace.

When you are using this schema with spring or blueprint, the schema
lookup is redirected to the correct schema included in
camel-cxf-transport.jar, so you don't notice the absence of this
schema at the specified schemaLocation. We should publish this
schema,, but I am not sure if we should change the location, though.

regards, aki


2015-08-12 8:02 GMT+02:00 metatech metatec...@gmail.com:
 Hello,

 We are trying to use Camel CXF Transport within Blueprint.
 We followed the intructions on this page :
 http://camel.apache.org/camel-transport-for-cxf.html

 However, when defining a camel destination with an ID containing a dot :
 camel:destination id=*.camel-destination camelContextId=camel1 /
 Blueprint XSD validation fails with the exception below [1].

 In Spring, an ID is defined as a xs:string, whereas in Blueprint, an ID is
 defined as NCName (non-colonized name), which disallows mainly punctuation
 characters (including dot).

 The problem can be reproduced easily with the unit test
 CxfTransportBlueprintTest, by replacing
 blueprint.aries.xml-validation:=false  by
 blueprint.aries.xml-validation:=true.

 As a workaround, we also temporarily disabled XML validation in our business
 bundle, but it would a better practice to leave it enabled.

 Which syntax could we use ?

 Also, the schema http://cxf.apache.org/schemas/blueprint/camel.xsd is not
 published on this URL, is this normal ?

 Thanks in advance,
 Best regards,

 metatech

 [1]
 2015-08-11 17:10:16,014 [int Extender: 1] ERROR BlueprintContainerImpl
 - Unable to start blueprint container for bundle CxfTransportBlueprintTest
 org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to
 validate xml
 at
 org.apache.aries.blueprint.parser.Parser.validate(Parser.java:288)
 at
 org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:313)
 at
 org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
 at
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 at
 org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
 at
 org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
 at
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 at
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
 at
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:744)
 Caused by: org.xml.sax.SAXParseException; cvc-datatype-valid.1.2.1:
 '*.camel-destination' is not a valid value for 'NCName'.
 at
 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
 at
 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
 at
 com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
 at
 com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
 at
 

Re: NoClassDefFoundError: net/minidev/json/parser/ContainerFactory

2015-08-25 Thread Aki Yoshida
that sounds like you have an old camel  2.15.
if you have to set up your app with a  specific version of camel,
probably you should use the same json-path/json-smart version
combination are used by that camel version (i.e., tested).

here is a quick way to compare which versions are used in, for
example, camel 2.14.3 and 2.15.3

http://vdiff.notsoclever.cc/diff/apache/camel/tags/2.14.3/2.15.3

see the json-path and json-smart in the Changed Packages list.


2015-08-25 21:11 GMT+02:00 shuston shus...@riverace.com:
 Ok, I found the source of the dual json-smart versions. My pom.xml listed:

 dependency
   groupIdorg.apache.camel/groupId
   artifactIdcamel-jsonpath/artifactId
   version${camel.version}/version
 /dependency

 And that was pulling in json-path 0.9.1 which pulled in json-smart 1.2.
 Once I removed the above camel-jsonpath dependency the older json-path is not 
 pulled any longer. That problem is gone. Now I have a context problem in its 
 place :-(  I will research that.

 Thank you for your help,

 -Steve Huston


 From: Steve Huston
 Sent: Tuesday, August 25, 2015 2:43 PM
 To: 'Aki Yoshida-3 [via Camel]' ml-node+s465427n5770969...@n5.nabble.com
 Subject: RE: NoClassDefFoundError: net/minidev/json/parser/ContainerFactory

 Thank you, Aki. I'm following this trail. For now, I've found that something 
 in my dependencies is pulling in both net.minidev.json-smart 1.2 and 2.1.1 - 
 since I don't list json-smart explicitly, I'll need to chase through the 
 others to find the mismatch.

 From: Aki Yoshida-3 [via Camel] 
 [mailto:ml-node+s465427n5770969...@n5.nabble.com]
 Sent: Tuesday, August 25, 2015 8:56 AM
 To: Steve Huston shus...@riverace.com
 Subject: Re: NoClassDefFoundError: net/minidev/json/parser/ContainerFactory

 you should check your project dependency to see which jayway you have.
 you seem to have some old version of jayway that is expecting 
 json-smart-1.3.x.

 2015-08-24 17:00 GMT+02:00 shuston [hidden email]:

 This is for Camel 2.15.3 (also had the problem with 2.15.2)

 I am a new Camel user, and trying to use jsonpath. I have in my pom.xml:

 dependency
   groupIdorg.apache.camel/groupId
   artifactIdcamel-jsonpath/artifactId
   version${camel.version}/version
 /dependency

 In my XML config, I have:
 route
   from uri=seda:from_rraa/
   process ref=issPreprocessor/
   choice
 when
   jsonpath$.header[?(@.name ==
 VerifyEmployeeRequest)]/jsonpath
   unmarshal ref=VerifyEmployeeRequest/
 /when
   /choice

   process ref=crewMock/
   to uri=seda:to_rraa/
 /route

 I get at runtime (mvn test):

 java.lang.NoClassDefFoundError: net/minidev/json/parser/ContainerFactory
 at
 com.jayway.jsonpath.spi.impl.JsonSmartJsonProvider.init(JsonSmartJsonProvider.java:38)
 at
 com.jayway.jsonpath.spi.impl.JsonSmartJsonProvider.init(JsonSmartJsonProvider.java:41)
 at
 com.jayway.jsonpath.spi.JsonProviderFactory.clinit(JsonProviderFactory.java:24)
 at
 com.jayway.jsonpath.Configuration.defaultConfiguration(Configuration.java:62)
 at 
 org.apache.camel.jsonpath.JsonPathEngine.init(JsonPathEngine.java:41)
 at
 org.apache.camel.jsonpath.JsonPathExpression.init(JsonPathExpression.java:33)
 at
 org.apache.camel.jsonpath.JsonPathLanguage.createPredicate(JsonPathLanguage.java:27)
 ...

 I tried adding this to my pom.xml:
 dependency
   groupIdnet.minidev/groupId
   artifactIdjson-smart/artifactId
   version2.1.1/version
 /dependency

 But that did not help.

 Can someone please help steer me in the right direction?




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/NoClassDefFoundError-net-minidev-json-parser-ContainerFactory-tp5770943.html
 Sent from the Camel - Users mailing list archive at Nabble.com.

 
 If you reply to this email, your message will be added to the discussion 
 below:
 http://camel.465427.n5.nabble.com/NoClassDefFoundError-net-minidev-json-parser-ContainerFactory-tp5770943p5770969.html
 To unsubscribe from NoClassDefFoundError: 
 net/minidev/json/parser/ContainerFactory, click here.
 NAML




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/NoClassDefFoundError-net-minidev-json-parser-ContainerFactory-tp5770943p5770976.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: NoClassDefFoundError: net/minidev/json/parser/ContainerFactory

2015-08-25 Thread Aki Yoshida
you should check your project dependency to see which jayway you have.
you seem to have some old version of jayway that is expecting json-smart-1.3.x.

2015-08-24 17:00 GMT+02:00 shuston shus...@riverace.com:
 This is for Camel 2.15.3 (also had the problem with 2.15.2)

 I am a new Camel user, and trying to use jsonpath. I have in my pom.xml:

 dependency
   groupIdorg.apache.camel/groupId
   artifactIdcamel-jsonpath/artifactId
   version${camel.version}/version
 /dependency

 In my XML config, I have:
 route
   from uri=seda:from_rraa/
   process ref=issPreprocessor/
   choice
 when
   jsonpath$.header[?(@.name ==
 VerifyEmployeeRequest)]/jsonpath
   unmarshal ref=VerifyEmployeeRequest/
 /when
   /choice

   process ref=crewMock/
   to uri=seda:to_rraa/
 /route

 I get at runtime (mvn test):

 java.lang.NoClassDefFoundError: net/minidev/json/parser/ContainerFactory
 at
 com.jayway.jsonpath.spi.impl.JsonSmartJsonProvider.init(JsonSmartJsonProvider.java:38)
 at
 com.jayway.jsonpath.spi.impl.JsonSmartJsonProvider.init(JsonSmartJsonProvider.java:41)
 at
 com.jayway.jsonpath.spi.JsonProviderFactory.clinit(JsonProviderFactory.java:24)
 at
 com.jayway.jsonpath.Configuration.defaultConfiguration(Configuration.java:62)
 at 
 org.apache.camel.jsonpath.JsonPathEngine.init(JsonPathEngine.java:41)
 at
 org.apache.camel.jsonpath.JsonPathExpression.init(JsonPathExpression.java:33)
 at
 org.apache.camel.jsonpath.JsonPathLanguage.createPredicate(JsonPathLanguage.java:27)
 ...

 I tried adding this to my pom.xml:
 dependency
   groupIdnet.minidev/groupId
   artifactIdjson-smart/artifactId
   version2.1.1/version
 /dependency

 But that did not help.

 Can someone please help steer me in the right direction?




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/NoClassDefFoundError-net-minidev-json-parser-ContainerFactory-tp5770943.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bus configuration not working for rsClient

2015-08-06 Thread Aki Yoshida
how is your cxf bus named?
the following configuration should work for both spring and blueprint.

  cxf:bus bus=sdp-rest-client

  cxf:rsClient ... bus=sdp-rest-client
...

2015-08-04 4:26 GMT+02:00 Aniruddha aniruddha.di...@gmail.com:
 HI Guys,

 we are using cxf rsClient to call a third party REST webservice. The bean is
 configured as follows:

 cxf:rsClient id=quot;rsActivationquot;
 address=lt;some url
 bus=#sdp-rest-client
 cxf:headers
 entry key=Accept value=application/xml /
 /cxf:headers
 /cxf:rsClient

 and the bean is used in the route as:

 inOut uri=cxfrs:bean:rsActivation /

 What we noticed is that the bus configuration specified in the bean
 definition (bus=#sdp-rest-client) is ignored by the framework. But if we
 specify the bus config as a property of the rsClient bean then it works:

 cxf:properties
entry key=bus value-ref=sdp-rest-client /
 /cxf:properties

 Can you please let me know how to get the bus configuration working by
 specifying in the bean definition instead of property?

 Thanks,
 Ani



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Bus-configuration-not-working-for-rsClient-tp5770267.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Calling SOAP web service from camel

2015-07-13 Thread Aki Yoshida
2015-07-11 14:08 GMT+02:00 VijaySathya tanjoresat...@gmail.com:
 I am starting to develop a CAMEL based web application that will act like a
 integration BUS to mediate requests from different systems to a back end
 system developed in Jee running in JBOSS.

 From Camel route, I need to call SOAP services running in back end. These
 services were developed using EJB3 stateless session beans. These are JAX-WS
 web services.

 What is the best way to call these SOAP services from camel routes?

 CXF:uri -  will this work with remote Web services (JAX-WS)? Almost all
 mention about CXF producer talks about calling CX web service and nowhere
 mentioned that non CX web services which are JAX-WS.

CXF is all about integrating various standard services JAX-WS, etc
with a wide range of additional WS standards supported. It can run in
various environments with or without Spring or in OSGi, etc. If you
have read some descriptions that gave you the impression that CXF can
only talk to CXF web services, please let us know so that we can have
them corrected.

regards, aki

 Or should I think of using Producer template, which looks like much more
 generic.

 Or should I use Service Activator and use Spring-WS client code?

 Appreciate guidance on this.

 Thanks.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Calling-SOAP-web-service-from-camel-tp5769145.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel Routing and Apache CXF Rest with Proxy

2015-06-17 Thread Aki Yoshida
1. If it is a cxf's jaxrs service, you can use the cxf-bean component
to directly call that service.
http://camel.apache.org/cxf-bean-component.html

2. you can just add your headers as Camel headers in the route using setHeader


By the way, you don't need to add dev for usage questions.

2015-06-16 20:55 GMT+02:00 Bhavesh Mistry mistry.p.bhav...@gmail.com:
 Adding Dev group to see how I can achieve this.

 Thanks,

 Bhavesh

 On Mon, Jun 15, 2015 at 2:56 PM, Bhavesh Mistry mistry.p.bhav...@gmail.com
 wrote:

 Hi All,



 I am new to Apache Camel and trying to solve following problem with
 routing:



 I have CXF JAX-RS based REST Service implemented and deployed in same JVM
 (end-point).



 I have another set of REST Service that is not within same Java Process it
 is in (python or any other Process but on same host).





 We have unified port to access both services,  for example,



 Client call  HTTP Rest call (*8080*) -  Camel Route(  
 if(“/java_api/”
   to(http://localhost:*9090*) else { to (http://localhost:9091 (OLD
 Services)}





  cxf:rsServer id=javaRestServer address=
 http://localhost:9090/java_api;

  loggingFeatureEnabled=true

  serviceClass=…. 

  cxf:providers

   ref bean=jaxbProvider /

   ref bean=jsonProvider /

  /cxf:providers

  cxf:serviceBeans

   ref bean=myService/

  /cxf:serviceBeans

  /cxf:rsServer





 The problem with this approach is there is unnecessary http call for Java
 API(java_api) route since it is already locally hosted and we do not want
 to incur HTTP call.



 This has been done to set-up all the CXF context and be able to server
 REST service.



 So, my questions are:



 1) 1) Is there any way to setup route to call cxf local binding JAX-RS
 (direct call) rather then http call for Java API ?

 2) 2) How can I configure route such a way so HTTP Proxy headers  (e.g 
 *X-Forwarded-For
 *) gets passed to old Service API ? Since, Java Layer is indeed acting as
 proxy server.


 Thanks in advance for your help !


 Thanks,



 Bhavesh





Re: ERROR: Cannot find any registered HttpDestinationFactory from the Bus.

2015-05-19 Thread Aki Yoshida
If you do not want to use the embedded jetty server but your servlet
container, you have to use a relative path in the address field.
so something like
 cxf:cxfEndpoint id=canonicalService
address=/canonicalcxfserviceproxy/webservices/canonical

and this endpoint will be available under the context path configured
at your CXFServlet.


2015-05-15 8:28 GMT+02:00 jainmcs03 tojayendran.in...@gmail.com:

 Team,

 For camel-CXF web service proxy i created a maven JAVA project to configure
 the jetty embedded container as described in the example and run it in
 eclipse and its works fine.

 But while delpoying as .war in tomact its giving subject Error.
 ERROR HTTPTransportFactory   - Cannot find any registered
 HttpDestinationFactory from the Bus.

 I have removed cxf-rt-transports-http-jetty, i keep only
 cxf-rt-transports-http. How to resolve this.

 Below is the endpoint trying to publish, no other config included in my
 spring config file(camel-config.xml).

   cxf:cxfEndpoint id=canonicalService

 address=http://localhost:8080/canonicalcxfserviceproxy/webservices/canonical;
endpointName=xsd:CanonicalSoap
serviceName=xsd:Canonical
wsdlURL=etc/canonical.wsdl

 xmlns:xsd=http://localhost:8080/canonicalcxfserviceproxy/canonical/

 Regards
 Jayendran



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/ERROR-Cannot-find-any-registered-HttpDestinationFactory-from-the-Bus-tp5767130.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to make a SOAP/HTTP request through webservice proxy

2015-05-19 Thread Aki Yoshida
i suppose the problem is that you are mixing up the payload and
message modes without doing any adjustment between.
the payload mode expects the body-child document, so this is something
like your InquiryRequest.
in contrast, the message mode expects the entire soap message, so this
starts with soap:Envelope.

see the dataformat section of the camel-cxf documentation.
http://camel.apache.org/cxf.html#CXF-Thedescriptionsofthedataformats

2015-05-12 12:23 GMT+02:00 jainmcs03 tojayendran.in...@gmail.com:

 Team,

 I have successfully done the transformation(unmarshal-do process-marshal)
 but getting a error response from real webservice. Below the error and route
 definition.

 Error:
 ?xml version='1.0' encoding='UTF-8'?soapenv:Envelope
 xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;soapenv:Header
 xmlns:wsa=http://www.w3.org/2005/08/addressing;wsa:Actionhttp://www.w3.org/2005/08/addressing/soap/fault/wsa:Action/soapenv:Headersoapenv:Bodysoapenv:Faultfaultcodesoapenv:/faultcodefaultstringFirst
 Element must contain the local name, Envelope , but found
 InquiryRequest/faultstringdetail//soapenv:Fault/soapenv:Body/soapenv:Envelope

 Enpoints  Route:
   cxf:cxfEndpoint id=canonicalService

 address=http://localhost:8080/canonicalcxfserviceproxy/webservices/canonical;
endpointName=xsd:CanonicalSoap
serviceName=xsd:Canonical
wsdlURL=etc/canonical.wsdl

 xmlns:xsd=http://localhost:8080/canonicalcxfserviceproxy/canonical/
   cxf:cxfEndpoint id=callRealWebService

 address=https://eporttrain.equifax.co.in/creditreportws/CreditReportWSInquiry/v1.0/;
endpointName=xsd:CreditReportWSInquiryPort
serviceName=xsd:v1.0

 xmlns:xsd=http://services.equifax.com/eport/ws/schemas/1.0/

   camelContext trace=true typeConverterStatisticsEnabled=true
 xmlns=http://camel.apache.org/schema/spring;
   route streamCache=true
   from uri=cxf:bean:canonicalService?dataFormat=PAYLOAD/
   wireTap
 uri=file:/home/analyzer/Desktop/input/?fileName=request.xml/
   unmarshal
 jaxb prettyPrint=true
 contextPath=localhost._8080.canonicalcxfserviceproxy.canonical/
   /unmarshal
   process ref=reqprocessor/
   marshal
 jaxb prettyPrint=true
 contextPath=com.equifax.services.eport.ws.schemas._1/
   /marshal
   wireTap
 uri=file:/home/analyzer/Desktop/input/?fileName=realrequest.xml/
   to uri=cxf:bean:callRealWebService?dataFormat=MESSAGE/
   wireTap
 uri=file:/home/analyzer/Desktop/output/?fileName=response.xml/
   /route
   /camelContext


 Regards
 Jayendran




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Unable-to-make-a-SOAP-HTTP-request-through-webservice-proxy-tp5767008.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Web Srevice exposed over https not working

2015-05-18 Thread Aki Yoshida
If this happens all the time, something is wrong with the connection.
But from the information that you provided, it is difficult to
determine the cause.
cxf-2.7.0 that you are using is a bit too old these days, as the
current 2.7.x version is 2.7.16.
Besides, you are using the Redhat version of the cxf  librry, you
might ask at their forum for support.


2015-05-16 23:16 GMT+02:00 gargankur007 gargankur...@gmail.com:
 I googled and have a sense that may be connection is getting closed when
 SoapResposne is being written



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Web-Srevice-exposed-over-https-not-working-tp5767156p5767157.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: StAXSource to InputStream direct conversion

2015-05-08 Thread Aki Yoshida
Hi Claus,
thanks for your reply. I'll look into it next week.
regards, aki

2015-05-07 20:14 GMT+02:00 Claus Ibsen claus.ib...@gmail.com:
 Hi

 Yeah sounds much better if the conversion can happen more directly and
 faster in a streaming style.

 On Thu, May 7, 2015 at 4:26 PM, Aki Yoshida elak...@gmail.com wrote:
 Hi,
 There is currently no direct type conversion from StAXSource or
 XMLStreamReadder to InputStream. Am I correct? I noticed this while
 looking at the camel-cxf's StAXSource related xml-namespace issue
 (CAMEL-8663) when converting to InputStream, the conversion succeeded
 but went via DOM's NodeList, which you wouldn't really want.

 Assuming this assumption, I am wondering if we can add a direct
 converter. I wrote a class that can convert XMLStreamReader to
 InputStream or Reader using a small buffer while I was doing the
 xmltokenizer last year. A converter can be easily written using this
 approach.

 The code is available here and you can look at them.

 https://github.com/elakito/misc-xml/blob/master/src/main/java/de/elakito/misc/xml/util/XMLStreamReaderInputStream.java
 https://github.com/elakito/misc-xml/blob/master/src/main/java/de/elakito/misc/xml/util/XMLStreamReaderReader.java

 Let me know what you think.

 regards, aki



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: cib...@redhat.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 hawtio: http://hawt.io/
 fabric8: http://fabric8.io/


StAXSource to InputStream direct conversion

2015-05-07 Thread Aki Yoshida
Hi,
There is currently no direct type conversion from StAXSource or
XMLStreamReadder to InputStream. Am I correct? I noticed this while
looking at the camel-cxf's StAXSource related xml-namespace issue
(CAMEL-8663) when converting to InputStream, the conversion succeeded
but went via DOM's NodeList, which you wouldn't really want.

Assuming this assumption, I am wondering if we can add a direct
converter. I wrote a class that can convert XMLStreamReader to
InputStream or Reader using a small buffer while I was doing the
xmltokenizer last year. A converter can be easily written using this
approach.

The code is available here and you can look at them.

https://github.com/elakito/misc-xml/blob/master/src/main/java/de/elakito/misc/xml/util/XMLStreamReaderInputStream.java
https://github.com/elakito/misc-xml/blob/master/src/main/java/de/elakito/misc/xml/util/XMLStreamReaderReader.java

Let me know what you think.

regards, aki


Re: Camel Websocket - Connection key not set

2015-05-07 Thread Aki Yoshida
Yes.
We need to add a NPE guard there.
@Harish,
The situation was caused by the fact that the socket was not
established for some reason.
I think you see other error trace showing this reason prior to this
NPE getting thrown.

Let me know if you want to work on this, need help in doing that or
simply have it get resolved.
regards, aki

2015-05-06 17:15 GMT+02:00 Claus Ibsen claus.ib...@gmail.com:
 Hi

 Yeah somewhere in that Camel component is a bug that causes the NPE.

 You are welcome to log a JIRA and if possible provide more details how
 to reproduce it, and or an unit test. Or try to fix the bug and
 provide a patch.
 http://camel.apache.org/contributing.html

 On Wed, May 6, 2015 at 9:07 AM, Harish Kumar harish.kum...@tcs.com wrote:
 Hey Thanks for the suggestion

 Now am using AH-WS component. Leaving the websocket code untounced, now I
 get this error

 java.lang.NullPointerException
 at
 org.apache.camel.component.ahc.ws.WsProducer.sendMessage(WsProducer.j
 ava:77)
 at
 org.apache.camel.component.ahc.ws.WsProducer.process(WsProducer.java:
 52)
 at
 org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncP
 rocessorBridge.process(AsyncProcessorConverterHelper.java:61)
 at
 org.apache.camel.processor.SendProcessor.process(SendProcessor.java:1
 29)
 at
 org.apache.camel.management.InstrumentationProcessor.process(Instrume
 ntationProcessor.java:77)
 at
 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
 rrorHandler.java:448)
 at
 org.apache.camel.processor.CamelInternalProcessor.process(CamelIntern
 alProcessor.java:191)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
 at
 org.apache.camel.processor.CamelInternalProcessor.process(CamelIntern
 alProcessor.java:191)
 at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
 er.java:109)
 at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
 ncProcessor.java:87)
 at
 org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endp
 ointMessageListener.java:103)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doI
 nvokeListener(AbstractMessageListenerContainer.java:699)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.inv
 okeListener(AbstractMessageListenerContainer.java:637)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doE
 xecuteListener(AbstractMessageListenerContainer.java:605)
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContai
 ner.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContai
 ner.receiveAndExecute(AbstractPollingMessageListenerContainer.java:246)
 at
 org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
 cMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144
 )
 at
 org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
 cMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:
 1136)
 at
 org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
 cMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
 java:1145)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
 .java:615)
 at java.lang.Thread.run(Thread.java:724)
 [d #0 - JmsConsumer[test.queue]] EndpointMessageListenerWARN
 Execution
 of JMS message listener failed. Caused by:
 [org.apache.camel.RuntimeCamelExcepti
 on - java.lang.NullPointerException]
 org.apache.camel.RuntimeCamelException: java.lang.NullPointerException
 at
 org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHe
 lper.java:1619)
 at
 org.apache.camel.component.jms.EndpointMessageListener$EndpointMessag
 eListenerAsyncCallback.done(EndpointMessageListener.java:186)
 at
 org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endp
 ointMessageListener.java:107)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doI
 nvokeListener(AbstractMessageListenerContainer.java:699)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.inv
 okeListener(AbstractMessageListenerContainer.java:637)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doE
 xecuteListener(AbstractMessageListenerContainer.java:605)
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContai
 ner.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContai
 

Re: single CXF endpoint to accept SOAP message for different namespace versions

2015-01-30 Thread Aki Yoshida
If you want to accept any requests and do any checking and routing in
Camel, you can just configure your camel-cxf endpoint as a generic
provider endpoint of PAYLOAD type. That means with leaving the wsdl
and serviceClass properties unset.


2015-01-28 16:20 GMT+01:00 ashwin74268 sha.as...@gmail.com:
 Hi All,
 As of now, we have three different webservice endpoint for each type of
 Schema Version i.e  has different namespaces.
 We are using camel-cxf 2.8.0.
 e.g
 1) Schema with Namespace http://www.example.org/archive/schema/REL-5-1-2 has
 cxf endpoint cxf://http://hostname.com:/soap/greet
 2) Schema with Namespace http://www.example.org/archive/schema/REL-6-1-0
 cxf://http://hostname.com:/soap/greet
 3) Schema with Namespace http://www.example.org/archive/schema/REL-6-1-4
 cxf://http://hostname.com:/soap/greet

 each routes of cxf endpoint are configured in this way:-
 e.g:-
 cxf://http://hostname.com:port/soap/greet?serviceClass=org.example.schemas.rel610.GreetServicePortTypebus=#cxf;

 Now,  We have to expose only single webservice endpoint that can accept
 request for all these schemas and should do internal routing based on the
 namespace.
 I tied to find articles that may have suggested similar implementations but
 could see anything like this.

 Can anyone suggest me if there is way I can expose a single endpoint for
 this scenario?
 Any suggestion would be helpful.

 Thanks,
 ashwin74268



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/single-CXF-endpoint-to-accept-SOAP-message-for-different-namespace-versions-tp5762186.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel-CXF: Problems transforming namespace of incoming message

2015-01-22 Thread Aki Yoshida
2015-01-22 10:07 GMT+01:00 Dirk Lattermann - expertplace
dirk.latterm...@expertplace.de:
 Hi Aki,

 it was not working initially because I tried to use the WSDL for namespace A. 
 CXF could not process the message because it was transformed to namespace B 
 too early.

okay. That means, it didn't even get to the out chain. The
transformation occurs while reading the data for the inbound and while
writing the data for the outbound. So if you have mapping A-B at the
inbound and B-A at the outbound, the logical interface is B and hence
the endpoint needs to be configured with WSDL.


 For the second point, the situation is like this:

 we have old clients and old services that exchanged messages in namespace A. 
 Now, for some reason beyond our influence, the web service has to change the 
 namespace to B, and our routing should make this change transparent to the 
 old clients (as well as support new clients that use the new namespace B). We 
 don't know if some of the old clients depend on the old A WSDL in the 
 standard place .../service?wsdl instead of using a local version -- in 
 other projects, I have seen clients that do. So, to be on the safe side, we'd 
 like to provide the old namespace WSDL for the service.

But how can this be feasible when you are using the same endpoint and
the same WSDL query? How do you decide which WSDL to return?

regards, aki


 Thanks again,
 Dirk

 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Mittwoch, 21. Januar 2015 15:14
 An: users@camel.apache.org
 Cc: Sergey Beryozkin
 Betreff: Re: Camel-CXF: Problems transforming namespace of incoming message

 Hi Dirk,
 The transform itself should actually take place with the original 
 interceptor, as the actual output object is replaced with the 
 stax-transform'ed XMLStreamWriter regardless of its role. So, I am not sure 
 why your scenario was not working initially. But I am not sure why the 
 special requester role handling that you mentioned is there.
 Maybe Sergey knows it?

 I don't quite follow your second point. Your consumer endpoint uses WSDL-B 
 and it can accept the B's namespace and in addition, as the transform feature 
 configured, it can accept the A's namespace. The transform feature makes sure 
 that the messages are forwarded using the B's namespace so that they matche 
 the service interface. If you need WSDL-A, you can host this file somewhere 
 else. So, I am not familiar with your use case. The transform feature is 
 typically used as a workaround to support those legacy clients that had the 
 WSDL from elsewhere that don't match the actual service's WSDL.So, the actual 
 endpoint doesn't have to provide the alternative WSDL.

 regards, aki

 2015-01-21 8:35 GMT+01:00 Dirk Lattermann - expertplace
 dirk.latterm...@expertplace.de:
 Hi,

 thanks for your answer!

 The intention is different:

 Working routing is:

from CXF-B(1) -- (if ..some condition..) -- to CXF-B(2) on
 different host

 additional, a namespace mapping is needed:

from CXF-A -- namespace mapping A to B -- to CXF-B(1) so that
 above route is taken

 the namespace mapping A to B must include mapping the response back from 
 namespace B to A.

 What I have working or the mapping is an consuming endpoint servicing the B 
 namespace (not good because it offers the wrong WSDL to the client), 
 configured with StaxTransformationFeature with inTransformElements 
 (namespace A to B).
 For the response, StaxTransformationFeature with outTransformElements 
 doesn't work: digging in the source I found that 
 TransformationOutInterceptor has a condition that prevents transforming 
 responses. Only outgoing requests are mapped (that is, in producer mode). 
 Curiously, the TransformationInInterceptor doesn't have this restriction.

 I solved this by copying the TransformationOutInterceptor into a new class 
 and removing the if condition in line 100. Then, I added this new class as 
 an outInterceptor to the endpoint. Now the mapping works for the requests 
 and the responses!

 The only drawback: my incoming mapping endpoint uses the wrong WSDL file 
 (for namespace B instead of namespace A).
 Is there a Phase in the CXF processing to which the 
 TransformationInInterceptor could be attached so that CXF wouldn't complain 
 about a namespace mismatch when using WSDL for namespace A and transforming 
 the incoming message to namespace B?

 Thank you,
 Dirk


 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Dienstag, 20. Januar 2015 11:10
 An: users@camel.apache.org
 Betreff: Re: Camel-CXF: Problems transforming namespace of incoming
 message

 I don't think the http endpoint can be used to bridge typical soap 
 webservice calls, as there are some mismatches in the behavior between the 
 soap protocol and the plain http protocol.

 If I understand your scenario, you want to do something like from-cxf:A --- 
 to-cxf:A if ...some condition...
 from-cxf:A

Re: Camel-CXF: Problems transforming namespace of incoming message

2015-01-21 Thread Aki Yoshida
Hi Dirk,
The transform itself should actually take place with the original
interceptor, as the actual output object is replaced with the
stax-transform'ed XMLStreamWriter regardless of its role. So, I am not
sure why your scenario was not working initially. But I am not sure
why the special requester role handling that you mentioned is there.
Maybe Sergey knows it?

I don't quite follow your second point. Your consumer endpoint uses
WSDL-B and it can accept the B's namespace and in addition, as the
transform feature configured, it can accept the A's namespace. The
transform feature makes sure that the messages are forwarded using the
B's namespace so that they matche the service interface. If you need
WSDL-A, you can host this file somewhere else. So, I am not familiar
with your use case. The transform feature is typically used as a
workaround to support those legacy clients that had the WSDL from
elsewhere that don't match the actual service's WSDL.So, the actual
endpoint doesn't have to provide the alternative WSDL.

regards, aki

2015-01-21 8:35 GMT+01:00 Dirk Lattermann - expertplace
dirk.latterm...@expertplace.de:
 Hi,

 thanks for your answer!

 The intention is different:

 Working routing is:

from CXF-B(1) -- (if ..some condition..) -- to CXF-B(2) on different host

 additional, a namespace mapping is needed:

from CXF-A -- namespace mapping A to B -- to CXF-B(1) so that above 
 route is taken

 the namespace mapping A to B must include mapping the response back from 
 namespace B to A.

 What I have working or the mapping is an consuming endpoint servicing the B 
 namespace (not good because it offers the wrong WSDL to the client), 
 configured with StaxTransformationFeature with inTransformElements (namespace 
 A to B).
 For the response, StaxTransformationFeature with outTransformElements doesn't 
 work: digging in the source I found that TransformationOutInterceptor has a 
 condition that prevents transforming responses. Only outgoing requests are 
 mapped (that is, in producer mode). Curiously, the 
 TransformationInInterceptor doesn't have this restriction.

 I solved this by copying the TransformationOutInterceptor into a new class 
 and removing the if condition in line 100. Then, I added this new class as an 
 outInterceptor to the endpoint. Now the mapping works for the requests and 
 the responses!

 The only drawback: my incoming mapping endpoint uses the wrong WSDL file (for 
 namespace B instead of namespace A).
 Is there a Phase in the CXF processing to which the 
 TransformationInInterceptor could be attached so that CXF wouldn't complain 
 about a namespace mismatch when using WSDL for namespace A and transforming 
 the incoming message to namespace B?

 Thank you,
 Dirk


 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Dienstag, 20. Januar 2015 11:10
 An: users@camel.apache.org
 Betreff: Re: Camel-CXF: Problems transforming namespace of incoming message

 I don't think the http endpoint can be used to bridge typical soap webservice 
 calls, as there are some mismatches in the behavior between the soap protocol 
 and the plain http protocol.

 If I understand your scenario, you want to do something like from-cxf:A --- 
 to-cxf:A if ...some condition...
 from-cxf:A  to-cxf:B if ...some condition...
 and cxf:A- cxf:B requires a minor namespace replacement, no?

 In that case, you can just use the PAYLOAD mode for all the cxf endpoints and 
 configure the transform feature at the to-cxf:B endpoint to replace the 
 namespace.




 2015-01-19 17:29 GMT+01:00 Dirk Lattermann - expertplace
 dirk.latterm...@expertplace.de:
 Hello,

 we need to build a proxy for an external request/reply SOAP web service. 
 This same service must be offered both unmodified (namespace A) and with a 
 different namespace B in the message schema. In both cases, some additional 
 routing decisions must be taken.

 For this, we have defined a CXF producer endpoint (using cxf:cxfEndpoint) in 
 POJO message format that addresses the external service, using their WSDL 
 (namespace A). The unmodified proxy on the consuming (input) side is also a 
 CXF endpoint in POJO format, using the same WSDL. A route forwards (after 
 some routing decisions) from this to the external service; this works.

 To offer the service with a different namespaces, we tried several 
 approaches without success.

 One possibility seems to be a CXF consumer endpoint in MESSAGE message 
 format that uses a StaxTransformationFeature to modify the namespace from B 
 to A.
 This endpoint uses a modified WSDL with namespace B instead of A. It must 
 use MESSAGE, not POJO, because the WSDL file with the modified message 
 namespace B would not match the transformed message in namespace A, which 
 results in a parsing (JAXB) exception from CXF. We would like to send the 
 transformed message to our own namespace A consumer endpoint to run through 
 the normal routing decisions mentioned

Re: Camel-CXF: Problems transforming namespace of incoming message

2015-01-20 Thread Aki Yoshida
I don't think the http endpoint can be used to bridge typical soap
webservice calls, as there are some mismatches in the behavior between
the soap protocol and the plain http protocol.

If I understand your scenario, you want to do something like
from-cxf:A --- to-cxf:A if ...some condition...
from-cxf:A  to-cxf:B if ...some condition...
and cxf:A- cxf:B requires a minor namespace replacement, no?

In that case, you can just use the PAYLOAD mode for all the cxf
endpoints and configure the transform feature at the to-cxf:B endpoint
to replace the namespace.




2015-01-19 17:29 GMT+01:00 Dirk Lattermann - expertplace
dirk.latterm...@expertplace.de:
 Hello,

 we need to build a proxy for an external request/reply SOAP web service. This 
 same service must be offered both unmodified (namespace A) and with a 
 different namespace B in the message schema. In both cases, some additional 
 routing decisions must be taken.

 For this, we have defined a CXF producer endpoint (using cxf:cxfEndpoint) in 
 POJO message format that addresses the external service, using their WSDL 
 (namespace A). The unmodified proxy on the consuming (input) side is also a 
 CXF endpoint in POJO format, using the same WSDL. A route forwards (after 
 some routing decisions) from this to the external service; this works.

 To offer the service with a different namespaces, we tried several approaches 
 without success.

 One possibility seems to be a CXF consumer endpoint in MESSAGE message format 
 that uses a StaxTransformationFeature to modify the namespace from B to A.
 This endpoint uses a modified WSDL with namespace B instead of A. It must use 
 MESSAGE, not POJO, because the WSDL file with the modified message namespace 
 B would not match the transformed message in namespace A, which results in a 
 parsing (JAXB) exception from CXF. We would like to send the transformed 
 message to our own namespace A consumer endpoint to run through the normal 
 routing decisions mentioned above. We cannot use the POJO endpoint because 
 the message is in  MESSAGE format. So, we tried POSTing the message using the 
 HTTP component:

 route id=cxf-admin-nsmap-route
 from uri=cxf:bean:fc-admin-service/
 to 
 uri=http://${fc.endpoint.host}:${fc.endpoint.port}/${fc.admin_cxf_nsmod.endpoint.path}/
 /route

 This fails with

 Invalid uri: /fc/admin. If you are forwarding/bridging http endpoints, then 
 enable the bridgeEndpoint option on the endpoint: 
 Endpoint[http://$%7Bfc.endpoint.host%7D:$%7Bfc.endpoint.port%7D/$%7Bfc.admin_cxf_nsmod.endpoint.path%7D]

 /fc/admin is the path for the incoming request (defined by 
 cxf:bean:fc-admin-service), not the one defined in the to-uri 
 (${fc.admin_cxf_nsmod.endpoint.path}).

 We tried to add the bridgeEndpoint property as in

 route id=cxf-admin-nsmap-route
 from uri=cxf:bean:fc-admin-service/
 to 
 uri=http://${fc.endpoint.host}:${fc.endpoint.port}/${fc.admin_cxf_nsmod.endpoint.path}?bridgeEndpoint=true/
 /route

 This fails with

 org.apache.commons.httpclient.URIException: Invalid authority


 A different approach where we tried XSLT to transform the namespaces, use 
 JAXB unmarshalling and create a MessageContentsList to convert the message 
 into POJO format by hand which can then be sent into the routing decision 
 route directly leads to difficulties with marshalling the response back: the 
 namespace prefix for the type names in (as xsd in xsi:type=xsd:string) gets 
 lost. On top, this approach seems still uglier an less maintainable than the 
 first one I described.

 What might be a working and clean, simple, maybe even elegant solution to 
 this problem? It's simply mapping a message in one namespace to another!

 Thank you,
 Dirk




Re: Enabling CXF's LoggingOutInterceptor in Payload mode

2015-01-19 Thread Aki Yoshida
are you getting some exception?
if the logging interceptor is not invoked, it is likely that the
request payload doesn't match the given wsdl and it rejected before
entering the interceptor chain. And in that case, you should see some
exception.

2015-01-19 13:40 GMT+01:00 vs_mahesh vsmahesh...@yahoo.co.in:

 Hi,

 I have following camel cxf configuration

  bean id=loggingInInterceptor
 class=org.apache.cxf.interceptor.LoggingInInterceptor/
   bean id=logOutInterceptor
 class=org.apache.cxf.interceptor.LoggingOutInterceptor
   /bean
bean id=wsLoggingOutInterceptor
 class=com.mycompany.poc.cxf.interceptor.WSLoggingOutInterceptor/

  cxf:cxfEndpoint id=abcd
 address=http://localhost:9000/poc/interceptor;

 serviceClass=outotec.pi.eam.id85.workhourconfirmation.SIID85WorkHourConfirmationAsyncOut
 
 wsdlURL=wsdl/SI_ID85_WorkHourConfirmation_Async_OutService.wsdl


cxf:inInterceptors
   ref bean=loggingInInterceptor/

 /cxf:inInterceptors

cxf:outInterceptors
   ref bean=logOutInterceptor/
  ref bean=wsLoggingOutInterceptor/

 /cxf:outInterceptors

 /cxf:cxfEndpoint


 I am getting the outbound message when I am using dataFormat =MESSAGE
 format.
 But when I put dataFormat=Payload format am not getting the outbound message
 .

 Can anyone tell me what is the reason for this ??Is it because of the
 Interceptor Phases?

 How to enable LoggingOutInterceptor in payload mode??

 Thanks,
 Mahesh



 -
 Thanks And regards,
 Mahesh
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Enabling-CXF-s-LoggingOutInterceptor-in-Payload-mode-tp5761872.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel + CXF + XSL Exception when creating the Soap response

2015-01-19 Thread Aki Yoshida
the error that you get for the PAYLOAD type means  your response
message doesn't match the response message defined in your wsdl. So,
you will need to verify this.

the error that you get for the MESSAGE type is caused by your
misconfiguration in your blueprint.xml. You cannot have to
uri=cxf:bean:... / to return a  response message to that endpoint.
If you need to return a response to the original call, you need to
just leave the response message in the route so that it will be
returned to that from endpoint. The to endpoint in CXF is used to send
a request message (and possibly to put its response message back in
the route). I suppose, you are getting the URI is not absolute error
because this endpoint's url is not absolute.

regards, aki


2015-01-16 23:58 GMT+01:00 L F l891...@yahoo.com.invalid:
 Hello camel users !

 I'm trying to implement a webservice as a camel route, defined using
 blueprint.

 I have the message as XML but after i create the response, CXF is not
 sending it back as it should.

 If i use dataFormar PAYLOAD, i get The PayLoad elements cannot fit with the
 message parts of the BindingOperation. Please check the BindingOperation and
 PayLoadMessage. exception,
 If i use dataFormat=MESSAGE i get  URI is not absolute exception.

 I'm probably doing something wrong, but i'm unable to find out the problem,
 so any help is appreciated.

 Thanks!




Re: Camel WebSocket WsEndpoint not forwarding messages

2015-01-14 Thread Aki Yoshida
I didn't see the from endpoint using ahc-ws in your description, so I
thought you didn't have the corresponding inbound ahc-ws endpoint. If you
have one and it is working when your server-side ws is jetty and not
working whe it is netty, we need to find out if and how the server is
writing back on the socket. Sorry for my delay in responding. If the debug
trace doesn't generate enough info, is it possible for you to debug the
code?
Thanks.
Aki


On Tuesday, January 6, 2015, SUNIL sunilkai...@gmail.com wrote:

 Additional Info: Am receiving message till WsEndpoint class but not to my
 from endpoint class.


 below is the log message :

 *[New I/O worker #19] WsEndpoint INFO
 received message -- my external WebSocket *



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-WebSocket-WsEndpoint-not-forwarding-messages-tp5760996p5761345.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel WebSocket WsEndpoint not forwarding messages

2014-12-29 Thread Aki Yoshida
If you are expecting acks returned from the external web socket
server, you will need to add the corresponding from-endpoint. Take a
look at the route configuration of this ahc-ws request/response test.
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-ahc-ws/src/test/java/org/apache/camel/component/ahc/ws/WsProducerConsumerTest.java;h=54d8b0928e9a5a219855e776f2403a050837fe04

2014-12-23 6:56 GMT+09:00 SUNIL sunilkai...@gmail.com:
 Hello,

 We are using Camel Websocket component and AHC-WS component to chain
 Multiple WebSockets to stream the messages. But we ran in to some issues
 with WsEndpoint class which is not forwarding the messages which it
 receiving from other websocket.

 Let me explain clearly what we are doing :

 We have iPad WebSocket client which sends the messages to my application
 which is developed using Camel WebSocket component.

 from(*websocket://myEndPoint*).choice().
  when(body().contains(ACK from external websocket)).
to(direct:ipad)
 .otherwise().
to(direct:otherWebSocket);
 Above route will act like producer and consumer.Also this endpoint will
 receive messages from iPad WebSocket as well as some other external
 Application WebSocket component which is developed using Netty.

 Below route will be used to  forward the iPad messages to some other
 external WebSocket component.

 from(direct:*otherWebSocket*).log(Forwarding message to other
 external WebSocket).to(ahc-ws://xx:39000/externalWebSocket);

 Below will be used to send the ACK's back to iPad which it is receiving from
 external WebSocket.

 from(*direct:ipad*).log(Sending ACK message to iPad
 ).to(websocket://myEndPoint?sendToAll=true);

 Above routes are working fine in one way that means iPad able to send the
 messages to //myEndPoint and //myEndPoint is able to forward the messages to
 external WebSocket component . *But external WebSocket Component sending the
 ACKs back to Camel Framework WsEndpoint class but not to //myEndPoint route
 .* Please help me why Camel Framework WsEndpoint class is not forwarding
 those messages to my route //myEndPoint .

 But same configuration is working fine if  external WebSocket also uses the
 Camel WebSocket component which is weird. *Does this mean camel websocket
 AHC-WS component only works if external Websockets developed using Camel
 Components*?





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-WebSocket-WsEndpoint-not-forwarding-messages-tp5760996.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AW: camel - xsd

2014-12-18 Thread Aki Yoshida
Jan and I had a couple of email exchange on this.
It turns out that the compliance check at the beginning of the
processing was not working when there is no xml-declaration in the
input.
Consequently, when your input message has no xml-declaration and you
have sjxp parser, you will get incorrectly extracted tokens.
I created CAMEL-8164 to fix this.

2014-12-17 19:35 GMT+01:00 Aki Yoshida elak...@gmail.com:
 @Jan,
 the failing test itself is expected if you don't have woodstox. The
 question is how it is failing, whether it stops at the beginning and
 throws the exception like in the quoted console output in my previous
 reply or after extracting the bad token and when comparing the token?
 You mentioned that you observed this second behavior and I would like
 to know where I can reproduce it.

 thanks.


 2014-12-17 16:40 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
 Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
 Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
 by Oracle (according to the copyright file)
 - without woodstox: fail
 - with woodstox: pass


 Same for
 Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
 Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
 (also Oracle)


 Same for
 Java(TM) SE Runtime Environment (build 1.8.0-ea-b87)
 Java HotSpot(TM) 64-Bit Server VM (build 25.0-b28, mixed mode)
 (also Oracle)


 Same for
 Java(TM) SE Runtime Environment (build 1.9.0-ea-b06)
 Java HotSpot(TM) 64-Bit Server VM (build 25.0-b62, mixed mode)
 (also Oracle)


 All on Win7 64bit.


 Jan



 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Mittwoch, 17. Dezember 2014 15:49
 An: users@camel.apache.org
 Cc: Jan Matèrne (jhm)
 Betreff: Re: AW: camel - xsd

 @Jan
 I just ran the camel-core's unit test XMLTokenExpressionIteratorTest on
 jdk8 without woodstox (use profile deactivation -P!woodstox to disable
 woodstox), the tokenizer correctly reports the error at the beginning
 without proceeding to the tokenizing step. (on both OSX and Ubuntu with
 Oracle JDK8).

 testExtractSomeUnqualifiedChild(org.apache.camel.support.XMLTokenExpres
 sionIteratorTest)
  Time elapsed: 0.001 sec   ERROR!
 javax.xml.stream.XMLStreamException: reader not supporting Location at
 org.apache.camel.support.XMLTokenExpressionIterator$XMLTokenIterator.i
 nit(XMLTokenExpressionIterator.java:219)

 Can you tell me which JDK you had to get the incorrectly extracted
 tokens?

 thanks

 2014-12-16 14:27 GMT+01:00 Aki Yoshida elak...@gmail.com:
  @Jan,
  I just missed your previous replies.
  I just saw you also have provided the JDK info already.
  thanks.
 
  2014-12-16 14:25 GMT+01:00 Aki Yoshida elak...@gmail.com:
  It's good to hear it is working in your environment.
 
  by the way, I saw your camael doc update regarding the concrete
 error
  example you saw.
  We need to formulate that differently.
  There is a small sanity check before starting the tokenization (not
  comparing the impl name itself but trying to infer its conformance
 by
  its initial behavior). That check was working for Oracle JDK 7 on
 OSX.
  I would like to know which JDK that you use. In any case, we can
  either make the initial sanity check to detect this incompatible
  behavior and detect it later if it is not detected at the beginning.
  In either way, we can throw an exception at some point.
 
  regards, aki
 
  2014-12-16 10:18 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
  Sorry for my late answer, I was ill :(
 
  Thanks for your sample project, I investigated into it now.
  All tests passed. (Camel 2.14.0)
 
  But your test used the XMLTokenExpressionIterator directly I
  migrated my own test class (using the RouteBuilder) into your
 project.
  - added the test class
  - added the xsd
  - added the dependency to commons-io + camel-test-spring
  - changed the paths in my test class to fit your directory layout
  Now this also passed.
 
  It's good to see that there is no bug in Camel. ;)
 
 
  Because my example still fails in my other environment I check that
 ...
 
 
  Jan
 
 
  -Ursprüngliche Nachricht-
  Von: Aki Yoshida [mailto:elak...@gmail.com]
  Gesendet: Mittwoch, 10. Dezember 2014 23:57
  An: users@camel.apache.org
  Betreff: Re: AW: camel - xsd
 
  i meant woodstox-core-asl (e.g., woodstox-core-asl-4.4.1.jar).
  its maven coordinate is
 
  mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1
 
  you need to have woodstox or some other parser that reliably
  reports the offset location at each parse event.
  Sjsxp (sun/oracle implementation included in JDK) doesn't do that,
  so you can't use it.
 
  jmtest.tar.gz contains a maven project that can be executed
  directly by typing mvn test at the console or can be imported into
  your eclipse IDE.
 
  2014-12-10 13:13 GMT+01:00 Aki Yoshida elak...@gmail.com:
   i just created a test that uses your data and verified that it
 is
  working fine.
   please take a look at this file at my dropbox.
   https

Re: AW: camel - xsd

2014-12-17 Thread Aki Yoshida
@Jan
I just ran the camel-core's unit test XMLTokenExpressionIteratorTest
on jdk8 without woodstox (use profile deactivation -P!woodstox to
disable woodstox), the tokenizer correctly reports the error at the
beginning without proceeding to the tokenizing step. (on both OSX and
Ubuntu with Oracle JDK8).

testExtractSomeUnqualifiedChild(org.apache.camel.support.XMLTokenExpressionIteratorTest)
 Time elapsed: 0.001 sec   ERROR!
javax.xml.stream.XMLStreamException: reader not supporting Location
at 
org.apache.camel.support.XMLTokenExpressionIterator$XMLTokenIterator.init(XMLTokenExpressionIterator.java:219)

Can you tell me which JDK you had to get the incorrectly extracted tokens?

thanks

2014-12-16 14:27 GMT+01:00 Aki Yoshida elak...@gmail.com:
 @Jan,
 I just missed your previous replies.
 I just saw you also have provided the JDK info already.
 thanks.

 2014-12-16 14:25 GMT+01:00 Aki Yoshida elak...@gmail.com:
 It's good to hear it is working in your environment.

 by the way, I saw your camael doc update regarding the concrete error
 example you saw.
 We need to formulate that differently.
 There is a small sanity check before starting the tokenization (not
 comparing the impl name itself but trying to infer its conformance by
 its initial behavior). That check was working for Oracle JDK 7 on OSX.
 I would like to know which JDK that you use. In any case, we can
 either make the initial sanity check to detect this incompatible
 behavior and detect it later if it is not detected at the beginning.
 In either way, we can throw an exception at some point.

 regards, aki

 2014-12-16 10:18 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
 Sorry for my late answer, I was ill :(

 Thanks for your sample project, I investigated into it now.
 All tests passed. (Camel 2.14.0)

 But your test used the XMLTokenExpressionIterator directly I migrated my own
 test class (using the RouteBuilder) into your project.
 - added the test class
 - added the xsd
 - added the dependency to commons-io + camel-test-spring
 - changed the paths in my test class to fit your directory layout
 Now this also passed.

 It's good to see that there is no bug in Camel. ;)


 Because my example still fails in my other environment I check that ...


 Jan


 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Mittwoch, 10. Dezember 2014 23:57
 An: users@camel.apache.org
 Betreff: Re: AW: camel - xsd

 i meant woodstox-core-asl (e.g., woodstox-core-asl-4.4.1.jar).
 its maven coordinate is

 mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1

 you need to have woodstox or some other parser that reliably reports
 the offset location at each parse event.
 Sjsxp (sun/oracle implementation included in JDK) doesn't do that, so
 you can't use it.

 jmtest.tar.gz contains a maven project that can be executed directly by
 typing mvn test at the console or can be imported into your eclipse
 IDE.

 2014-12-10 13:13 GMT+01:00 Aki Yoshida elak...@gmail.com:
  i just created a test that uses your data and verified that it is
 working fine.
  please take a look at this file at my dropbox.
  https://www.dropbox.com/s/pfgvs9si9bvujxo/jmtest.tar.gz?dl=0
  just extract the files into camel-core and run JMNewsTest.
  and see if that works in your environment, (i believe it does).
 
  in that case, we need to find out the difference to your case.
  do you have woodstox-api in your class path?
 
 
  2014-12-10 12:15 GMT+01:00 Aki Yoshida elak...@gmail.com:
  okay.
  let me take a look.
 
 
  2014-12-10 12:02 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
  No, input is valid xml.
  After invoking xtokenize() the xml is invalid.
 
  CAMEL-8106 is very  short. I can't see whether it is related.
 
 
  I posted an example on the user list
  http://mail-archives.apache.org/mod_mbox/camel-
 users/201412.mbox/%3C
  002b01d01452%24e8ee27a0%24baca76e0%24%40de%3E
 
  I had done a 'workaround' for this special example
  // Workaround of a bug?? in XMLTokenizerExpression
  .setBody(simple(${body.replace('//news:Newsletter',
 '/news:Newsletter')}))
  .setBody(simple(${body.replace('/news:Newsletter',
  '/news:Newsletter')}))
 
  Without that the split messages have wrong end tags.
 
 
  Jan
 
 
  -Ursprüngliche Nachricht-
  Von: Aki Yoshida [mailto:elak...@gmail.com]
  Gesendet: Mittwoch, 10. Dezember 2014 10:34
  An: users@camel.apache.org
  Betreff: Re: AW: camel - xsd
 
  you are talking about the invalid-xml parsing bug in xtokenzier.
  that has been fixe with CAMEL-8106. It should be part of the new
  2.14.1, which is to be released shortly.
 
  regards, aki
 
  2014-12-10 9:25 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
   I played a little bit.
  
   Jan
  
  
   public class XmlTest extends CamelTestSupport {
  
   @EndpointInject(uri=mock:valid)
   MockEndpoint valid;
  
   @EndpointInject(uri=mock:validationError)
   MockEndpoint validationError;
  
  
  
   @Test
   public void

Re: AW: camel - xsd

2014-12-17 Thread Aki Yoshida
@Jan,
the failing test itself is expected if you don't have woodstox. The
question is how it is failing, whether it stops at the beginning and
throws the exception like in the quoted console output in my previous
reply or after extracting the bad token and when comparing the token?
You mentioned that you observed this second behavior and I would like
to know where I can reproduce it.

thanks.


2014-12-17 16:40 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
 Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
 Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
 by Oracle (according to the copyright file)
 - without woodstox: fail
 - with woodstox: pass


 Same for
 Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
 Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
 (also Oracle)


 Same for
 Java(TM) SE Runtime Environment (build 1.8.0-ea-b87)
 Java HotSpot(TM) 64-Bit Server VM (build 25.0-b28, mixed mode)
 (also Oracle)


 Same for
 Java(TM) SE Runtime Environment (build 1.9.0-ea-b06)
 Java HotSpot(TM) 64-Bit Server VM (build 25.0-b62, mixed mode)
 (also Oracle)


 All on Win7 64bit.


 Jan



 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Mittwoch, 17. Dezember 2014 15:49
 An: users@camel.apache.org
 Cc: Jan Matèrne (jhm)
 Betreff: Re: AW: camel - xsd

 @Jan
 I just ran the camel-core's unit test XMLTokenExpressionIteratorTest on
 jdk8 without woodstox (use profile deactivation -P!woodstox to disable
 woodstox), the tokenizer correctly reports the error at the beginning
 without proceeding to the tokenizing step. (on both OSX and Ubuntu with
 Oracle JDK8).

 testExtractSomeUnqualifiedChild(org.apache.camel.support.XMLTokenExpres
 sionIteratorTest)
  Time elapsed: 0.001 sec   ERROR!
 javax.xml.stream.XMLStreamException: reader not supporting Location at
 org.apache.camel.support.XMLTokenExpressionIterator$XMLTokenIterator.i
 nit(XMLTokenExpressionIterator.java:219)

 Can you tell me which JDK you had to get the incorrectly extracted
 tokens?

 thanks

 2014-12-16 14:27 GMT+01:00 Aki Yoshida elak...@gmail.com:
  @Jan,
  I just missed your previous replies.
  I just saw you also have provided the JDK info already.
  thanks.
 
  2014-12-16 14:25 GMT+01:00 Aki Yoshida elak...@gmail.com:
  It's good to hear it is working in your environment.
 
  by the way, I saw your camael doc update regarding the concrete
 error
  example you saw.
  We need to formulate that differently.
  There is a small sanity check before starting the tokenization (not
  comparing the impl name itself but trying to infer its conformance
 by
  its initial behavior). That check was working for Oracle JDK 7 on
 OSX.
  I would like to know which JDK that you use. In any case, we can
  either make the initial sanity check to detect this incompatible
  behavior and detect it later if it is not detected at the beginning.
  In either way, we can throw an exception at some point.
 
  regards, aki
 
  2014-12-16 10:18 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
  Sorry for my late answer, I was ill :(
 
  Thanks for your sample project, I investigated into it now.
  All tests passed. (Camel 2.14.0)
 
  But your test used the XMLTokenExpressionIterator directly I
  migrated my own test class (using the RouteBuilder) into your
 project.
  - added the test class
  - added the xsd
  - added the dependency to commons-io + camel-test-spring
  - changed the paths in my test class to fit your directory layout
  Now this also passed.
 
  It's good to see that there is no bug in Camel. ;)
 
 
  Because my example still fails in my other environment I check that
 ...
 
 
  Jan
 
 
  -Ursprüngliche Nachricht-
  Von: Aki Yoshida [mailto:elak...@gmail.com]
  Gesendet: Mittwoch, 10. Dezember 2014 23:57
  An: users@camel.apache.org
  Betreff: Re: AW: camel - xsd
 
  i meant woodstox-core-asl (e.g., woodstox-core-asl-4.4.1.jar).
  its maven coordinate is
 
  mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1
 
  you need to have woodstox or some other parser that reliably
  reports the offset location at each parse event.
  Sjsxp (sun/oracle implementation included in JDK) doesn't do that,
  so you can't use it.
 
  jmtest.tar.gz contains a maven project that can be executed
  directly by typing mvn test at the console or can be imported into
  your eclipse IDE.
 
  2014-12-10 13:13 GMT+01:00 Aki Yoshida elak...@gmail.com:
   i just created a test that uses your data and verified that it
 is
  working fine.
   please take a look at this file at my dropbox.
   https://www.dropbox.com/s/pfgvs9si9bvujxo/jmtest.tar.gz?dl=0
   just extract the files into camel-core and run JMNewsTest.
   and see if that works in your environment, (i believe it does).
  
   in that case, we need to find out the difference to your case.
   do you have woodstox-api in your class path?
  
  
   2014-12-10 12:15 GMT+01:00 Aki Yoshida elak...@gmail.com:
   okay.
   let me take a look.
  
  
   2014-12-10

Re: AW: camel - xsd

2014-12-16 Thread Aki Yoshida
It's good to hear it is working in your environment.

by the way, I saw your camael doc update regarding the concrete error
example you saw.
We need to formulate that differently.
There is a small sanity check before starting the tokenization (not
comparing the impl name itself but trying to infer its conformance by
its initial behavior). That check was working for Oracle JDK 7 on OSX.
I would like to know which JDK that you use. In any case, we can
either make the initial sanity check to detect this incompatible
behavior and detect it later if it is not detected at the beginning.
In either way, we can throw an exception at some point.

regards, aki

2014-12-16 10:18 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
 Sorry for my late answer, I was ill :(

 Thanks for your sample project, I investigated into it now.
 All tests passed. (Camel 2.14.0)

 But your test used the XMLTokenExpressionIterator directly I migrated my own
 test class (using the RouteBuilder) into your project.
 - added the test class
 - added the xsd
 - added the dependency to commons-io + camel-test-spring
 - changed the paths in my test class to fit your directory layout
 Now this also passed.

 It's good to see that there is no bug in Camel. ;)


 Because my example still fails in my other environment I check that ...


 Jan


 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Mittwoch, 10. Dezember 2014 23:57
 An: users@camel.apache.org
 Betreff: Re: AW: camel - xsd

 i meant woodstox-core-asl (e.g., woodstox-core-asl-4.4.1.jar).
 its maven coordinate is

 mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1

 you need to have woodstox or some other parser that reliably reports
 the offset location at each parse event.
 Sjsxp (sun/oracle implementation included in JDK) doesn't do that, so
 you can't use it.

 jmtest.tar.gz contains a maven project that can be executed directly by
 typing mvn test at the console or can be imported into your eclipse
 IDE.

 2014-12-10 13:13 GMT+01:00 Aki Yoshida elak...@gmail.com:
  i just created a test that uses your data and verified that it is
 working fine.
  please take a look at this file at my dropbox.
  https://www.dropbox.com/s/pfgvs9si9bvujxo/jmtest.tar.gz?dl=0
  just extract the files into camel-core and run JMNewsTest.
  and see if that works in your environment, (i believe it does).
 
  in that case, we need to find out the difference to your case.
  do you have woodstox-api in your class path?
 
 
  2014-12-10 12:15 GMT+01:00 Aki Yoshida elak...@gmail.com:
  okay.
  let me take a look.
 
 
  2014-12-10 12:02 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
  No, input is valid xml.
  After invoking xtokenize() the xml is invalid.
 
  CAMEL-8106 is very  short. I can't see whether it is related.
 
 
  I posted an example on the user list
  http://mail-archives.apache.org/mod_mbox/camel-
 users/201412.mbox/%3C
  002b01d01452%24e8ee27a0%24baca76e0%24%40de%3E
 
  I had done a 'workaround' for this special example
  // Workaround of a bug?? in XMLTokenizerExpression
  .setBody(simple(${body.replace('//news:Newsletter',
 '/news:Newsletter')}))
  .setBody(simple(${body.replace('/news:Newsletter',
  '/news:Newsletter')}))
 
  Without that the split messages have wrong end tags.
 
 
  Jan
 
 
  -Ursprüngliche Nachricht-
  Von: Aki Yoshida [mailto:elak...@gmail.com]
  Gesendet: Mittwoch, 10. Dezember 2014 10:34
  An: users@camel.apache.org
  Betreff: Re: AW: camel - xsd
 
  you are talking about the invalid-xml parsing bug in xtokenzier.
  that has been fixe with CAMEL-8106. It should be part of the new
  2.14.1, which is to be released shortly.
 
  regards, aki
 
  2014-12-10 9:25 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
   I played a little bit.
  
   Jan
  
  
   public class XmlTest extends CamelTestSupport {
  
   @EndpointInject(uri=mock:valid)
   MockEndpoint valid;
  
   @EndpointInject(uri=mock:validationError)
   MockEndpoint validationError;
  
  
  
   @Test
   public void validNewsfeed() throws Exception {
   // Newsfeed contains 2 news
   valid.expectedMessageCount(2);
   valid.expectedMessagesMatches(
   // Use helper methods from the static imported
  PredicateBuilder
   and(
   header(newsfeed.date).isEqualTo(2014.12.09
  14:15),
   header(news.author).isEqualTo(Jan),
  
  
 
 body().contains(xmlns:news=\http://www.materne.de/camel/test/xml/
  com
   plex/\
   )
   )
   );
   // no error expected
   validationError.expectedMessageCount(0);
  
   // Read xml from classpath and send to Camel route
   String xml =
  
 
 IOUtils.toString(getClass().getResourceAsStream(/de/materne/camel/
  tes
   t/xml/
   complex/validNewsfeed.xml));
   sendBody(direct:in, xml);
  
   // 'execute' all tests
   assertMockEndpointsSatisfied

Re: AW: camel - xsd

2014-12-16 Thread Aki Yoshida
@Jan,
I just missed your previous replies.
I just saw you also have provided the JDK info already.
thanks.

2014-12-16 14:25 GMT+01:00 Aki Yoshida elak...@gmail.com:
 It's good to hear it is working in your environment.

 by the way, I saw your camael doc update regarding the concrete error
 example you saw.
 We need to formulate that differently.
 There is a small sanity check before starting the tokenization (not
 comparing the impl name itself but trying to infer its conformance by
 its initial behavior). That check was working for Oracle JDK 7 on OSX.
 I would like to know which JDK that you use. In any case, we can
 either make the initial sanity check to detect this incompatible
 behavior and detect it later if it is not detected at the beginning.
 In either way, we can throw an exception at some point.

 regards, aki

 2014-12-16 10:18 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
 Sorry for my late answer, I was ill :(

 Thanks for your sample project, I investigated into it now.
 All tests passed. (Camel 2.14.0)

 But your test used the XMLTokenExpressionIterator directly I migrated my own
 test class (using the RouteBuilder) into your project.
 - added the test class
 - added the xsd
 - added the dependency to commons-io + camel-test-spring
 - changed the paths in my test class to fit your directory layout
 Now this also passed.

 It's good to see that there is no bug in Camel. ;)


 Because my example still fails in my other environment I check that ...


 Jan


 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Mittwoch, 10. Dezember 2014 23:57
 An: users@camel.apache.org
 Betreff: Re: AW: camel - xsd

 i meant woodstox-core-asl (e.g., woodstox-core-asl-4.4.1.jar).
 its maven coordinate is

 mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1

 you need to have woodstox or some other parser that reliably reports
 the offset location at each parse event.
 Sjsxp (sun/oracle implementation included in JDK) doesn't do that, so
 you can't use it.

 jmtest.tar.gz contains a maven project that can be executed directly by
 typing mvn test at the console or can be imported into your eclipse
 IDE.

 2014-12-10 13:13 GMT+01:00 Aki Yoshida elak...@gmail.com:
  i just created a test that uses your data and verified that it is
 working fine.
  please take a look at this file at my dropbox.
  https://www.dropbox.com/s/pfgvs9si9bvujxo/jmtest.tar.gz?dl=0
  just extract the files into camel-core and run JMNewsTest.
  and see if that works in your environment, (i believe it does).
 
  in that case, we need to find out the difference to your case.
  do you have woodstox-api in your class path?
 
 
  2014-12-10 12:15 GMT+01:00 Aki Yoshida elak...@gmail.com:
  okay.
  let me take a look.
 
 
  2014-12-10 12:02 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
  No, input is valid xml.
  After invoking xtokenize() the xml is invalid.
 
  CAMEL-8106 is very  short. I can't see whether it is related.
 
 
  I posted an example on the user list
  http://mail-archives.apache.org/mod_mbox/camel-
 users/201412.mbox/%3C
  002b01d01452%24e8ee27a0%24baca76e0%24%40de%3E
 
  I had done a 'workaround' for this special example
  // Workaround of a bug?? in XMLTokenizerExpression
  .setBody(simple(${body.replace('//news:Newsletter',
 '/news:Newsletter')}))
  .setBody(simple(${body.replace('/news:Newsletter',
  '/news:Newsletter')}))
 
  Without that the split messages have wrong end tags.
 
 
  Jan
 
 
  -Ursprüngliche Nachricht-
  Von: Aki Yoshida [mailto:elak...@gmail.com]
  Gesendet: Mittwoch, 10. Dezember 2014 10:34
  An: users@camel.apache.org
  Betreff: Re: AW: camel - xsd
 
  you are talking about the invalid-xml parsing bug in xtokenzier.
  that has been fixe with CAMEL-8106. It should be part of the new
  2.14.1, which is to be released shortly.
 
  regards, aki
 
  2014-12-10 9:25 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
   I played a little bit.
  
   Jan
  
  
   public class XmlTest extends CamelTestSupport {
  
   @EndpointInject(uri=mock:valid)
   MockEndpoint valid;
  
   @EndpointInject(uri=mock:validationError)
   MockEndpoint validationError;
  
  
  
   @Test
   public void validNewsfeed() throws Exception {
   // Newsfeed contains 2 news
   valid.expectedMessageCount(2);
   valid.expectedMessagesMatches(
   // Use helper methods from the static imported
  PredicateBuilder
   and(
   header(newsfeed.date).isEqualTo(2014.12.09
  14:15),
   header(news.author).isEqualTo(Jan),
  
  
 
 body().contains(xmlns:news=\http://www.materne.de/camel/test/xml/
  com
   plex/\
   )
   )
   );
   // no error expected
   validationError.expectedMessageCount(0);
  
   // Read xml from classpath and send to Camel route
   String xml =
  
 
 IOUtils.toString(getClass().getResourceAsStream(/de/materne/camel

Re: AW: camel - xsd

2014-12-10 Thread Aki Yoshida
you are talking about the invalid-xml parsing bug in xtokenzier.
that has been fixe with CAMEL-8106. It should be part of the new
2.14.1, which is to be released shortly.

regards, aki

2014-12-10 9:25 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
 I played a little bit.

 Jan


 public class XmlTest extends CamelTestSupport {

 @EndpointInject(uri=mock:valid)
 MockEndpoint valid;

 @EndpointInject(uri=mock:validationError)
 MockEndpoint validationError;



 @Test
 public void validNewsfeed() throws Exception {
 // Newsfeed contains 2 news
 valid.expectedMessageCount(2);
 valid.expectedMessagesMatches(
 // Use helper methods from the static imported PredicateBuilder
 and(
 header(newsfeed.date).isEqualTo(2014.12.09 14:15),
 header(news.author).isEqualTo(Jan),

 body().contains(xmlns:news=\http://www.materne.de/camel/test/xml/complex/\
 )
 )
 );
 // no error expected
 validationError.expectedMessageCount(0);

 // Read xml from classpath and send to Camel route
 String xml =
 IOUtils.toString(getClass().getResourceAsStream(/de/materne/camel/test/xml/
 complex/validNewsfeed.xml));
 sendBody(direct:in, xml);

 // 'execute' all tests
 assertMockEndpointsSatisfied();
 }


 @Test
 public void invalidXml() throws Exception {
 valid.expectedMessageCount(0);
 validationError.expectedMessageCount(1);

 String xml = xml/;
 sendBody(direct:in, xml);

 assertMockEndpointsSatisfied();
 }



 @Override
 protected RouteBuilder createRouteBuilder() throws Exception {
 return new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 // Our XML uses namespaces, so we have to deal with that.
 Namespaces ns = new Namespaces(news,
 http://www.materne.de/camel/test/xml/complex/;);

 // XSD-invalid data goes to this endpoint
 onException(ValidationException.class)
 .to(mock:validationError);

 from(direct:in)
 // XSD-validation

 .to(validator:de/materne/camel/test/xml/complex/newsfeed.xsd)

 // Store newsfeed data in the header before split, so we
 haven't to do that on each
 // splittet news-message.
 .setHeader(newsfeed.date,
 ns.xpath(/news:Newsletter/@date;, String.class))

 // http://camel.apache.org/splitter.html
 // xtokenize() is available since Camel 2.14.
 // Use the 'wrap'-mode so we keep the Newsletter-Header
 .split().xtokenize(/news:Newsletter/News;, 'w', ns)

 // Workaround of a bug?? in XMLTokenizerExpression
 .setBody(simple(${body.replace('//news:Newsletter',
 '/news:Newsletter')}))
 .setBody(simple(${body.replace('/news:Newsletter',
 '/news:Newsletter')}))

 // Get some data from the splittet news
 .setHeader(news.date,
 ns.xpath(/news:Newsletter/News/@date;, String.class))
 .setHeader(news.author,
 ns.xpath(/news:Newsletter//News/@author;, String.class))

 .to(mock:valid);
 }
 };
 }

 }



 ?xml version=1.0 encoding=UTF-8?
 schema
 xmlns=http://www.w3.org/2001/XMLSchema;
 xmlns:news=http://www.materne.de/camel/test/xml/complex/;
 targetNamespace=http://www.materne.de/camel/test/xml/complex/;

 element name=Newsletter
 complexType
 sequence
 element name=News minOccurs=1
 maxOccurs=unbounded
 complexType
 simpleContent
 extension
 base=string
 attribute
 name=date type=string/
 attribute
 name=author type=string/
 /extension
 /simpleContent
 /complexType
 /element
 /sequence
 attribute name=date type=string/
 /complexType
 /element

 /schema



 news:Newsletter
 xmlns:news=http://www.materne.de/camel/test/xml/complex/;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

 xsi:schemaLocation=http://www.materne.de/camel/test/xml/complex/
 newsfeed.xsd 
 date=2014.12.09 14:15
 News date=2014.12.09 14:15 author=Jan
 Here is a demo news.
 /News
 News date=2014.12.09 14:13 

Re: AW: camel - xsd

2014-12-10 Thread Aki Yoshida
okay.
let me take a look.


2014-12-10 12:02 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
 No, input is valid xml.
 After invoking xtokenize() the xml is invalid.

 CAMEL-8106 is very  short. I can't see whether it is related.


 I posted an example on the user list
 http://mail-archives.apache.org/mod_mbox/camel-users/201412.mbox/%3C002b01d01452%24e8ee27a0%24baca76e0%24%40de%3E

 I had done a 'workaround' for this special example
 // Workaround of a bug?? in XMLTokenizerExpression
 .setBody(simple(${body.replace('//news:Newsletter', 
 '/news:Newsletter')}))
 .setBody(simple(${body.replace('/news:Newsletter', 
 '/news:Newsletter')}))

 Without that the split messages have wrong end tags.


 Jan


 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Mittwoch, 10. Dezember 2014 10:34
 An: users@camel.apache.org
 Betreff: Re: AW: camel - xsd

 you are talking about the invalid-xml parsing bug in xtokenzier.
 that has been fixe with CAMEL-8106. It should be part of the new
 2.14.1, which is to be released shortly.

 regards, aki

 2014-12-10 9:25 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
  I played a little bit.
 
  Jan
 
 
  public class XmlTest extends CamelTestSupport {
 
  @EndpointInject(uri=mock:valid)
  MockEndpoint valid;
 
  @EndpointInject(uri=mock:validationError)
  MockEndpoint validationError;
 
 
 
  @Test
  public void validNewsfeed() throws Exception {
  // Newsfeed contains 2 news
  valid.expectedMessageCount(2);
  valid.expectedMessagesMatches(
  // Use helper methods from the static imported
 PredicateBuilder
  and(
  header(newsfeed.date).isEqualTo(2014.12.09
 14:15),
  header(news.author).isEqualTo(Jan),
 
 
 body().contains(xmlns:news=\http://www.materne.de/camel/test/xml/com
  plex/\
  )
  )
  );
  // no error expected
  validationError.expectedMessageCount(0);
 
  // Read xml from classpath and send to Camel route
  String xml =
 
 IOUtils.toString(getClass().getResourceAsStream(/de/materne/camel/tes
  t/xml/
  complex/validNewsfeed.xml));
  sendBody(direct:in, xml);
 
  // 'execute' all tests
  assertMockEndpointsSatisfied();
  }
 
 
  @Test
  public void invalidXml() throws Exception {
  valid.expectedMessageCount(0);
  validationError.expectedMessageCount(1);
 
  String xml = xml/;
  sendBody(direct:in, xml);
 
  assertMockEndpointsSatisfied();
  }
 
 
 
  @Override
  protected RouteBuilder createRouteBuilder() throws Exception {
  return new RouteBuilder() {
  @Override
  public void configure() throws Exception {
  // Our XML uses namespaces, so we have to deal with
 that.
  Namespaces ns = new Namespaces(news,
  http://www.materne.de/camel/test/xml/complex/;);
 
  // XSD-invalid data goes to this endpoint
  onException(ValidationException.class)
  .to(mock:validationError);
 
  from(direct:in)
  // XSD-validation
 
  .to(validator:de/materne/camel/test/xml/complex/newsfeed.xsd)
 
  // Store newsfeed data in the header before
 split,
  so we haven't to do that on each
  // splittet news-message.
  .setHeader(newsfeed.date,
  ns.xpath(/news:Newsletter/@date;, String.class))
 
  // http://camel.apache.org/splitter.html
  // xtokenize() is available since Camel 2.14.
  // Use the 'wrap'-mode so we keep the Newsletter-
 Header
  .split().xtokenize(/news:Newsletter/News;, 'w',
  ns)
 
  // Workaround of a bug?? in
 XMLTokenizerExpression
 
  .setBody(simple(${body.replace('//news:Newsletter',
  '/news:Newsletter')}))
 
  .setBody(simple(${body.replace('/news:Newsletter',
  '/news:Newsletter')}))
 
  // Get some data from the splittet news
  .setHeader(news.date,
  ns.xpath(/news:Newsletter/News/@date;, String.class))
  .setHeader(news.author,
  ns.xpath(/news:Newsletter//News/@author;, String.class))
 
  .to(mock:valid);
  }
  };
  }
 
  }
 
 
 
  ?xml version=1.0 encoding=UTF-8? schema
  xmlns=http://www.w3.org/2001/XMLSchema;
  xmlns:news=http://www.materne.de/camel/test/xml/complex/;
 
  targetNamespace=http://www.materne.de/camel/test/xml/complex/;
 
  element name=Newsletter
  complexType
  sequence
  element name=News minOccurs=1
  maxOccurs=unbounded
  complexType
  simpleContent

Re: AW: camel - xsd

2014-12-10 Thread Aki Yoshida
i just created a test that uses your data and verified that it is working fine.
please take a look at this file at my dropbox.
https://www.dropbox.com/s/pfgvs9si9bvujxo/jmtest.tar.gz?dl=0
just extract the files into camel-core and run JMNewsTest.
and see if that works in your environment, (i believe it does).

in that case, we need to find out the difference to your case.
do you have woodstox-api in your class path?


2014-12-10 12:15 GMT+01:00 Aki Yoshida elak...@gmail.com:
 okay.
 let me take a look.


 2014-12-10 12:02 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
 No, input is valid xml.
 After invoking xtokenize() the xml is invalid.

 CAMEL-8106 is very  short. I can't see whether it is related.


 I posted an example on the user list
 http://mail-archives.apache.org/mod_mbox/camel-users/201412.mbox/%3C002b01d01452%24e8ee27a0%24baca76e0%24%40de%3E

 I had done a 'workaround' for this special example
 // Workaround of a bug?? in XMLTokenizerExpression
 .setBody(simple(${body.replace('//news:Newsletter', 
 '/news:Newsletter')}))
 .setBody(simple(${body.replace('/news:Newsletter', 
 '/news:Newsletter')}))

 Without that the split messages have wrong end tags.


 Jan


 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Mittwoch, 10. Dezember 2014 10:34
 An: users@camel.apache.org
 Betreff: Re: AW: camel - xsd

 you are talking about the invalid-xml parsing bug in xtokenzier.
 that has been fixe with CAMEL-8106. It should be part of the new
 2.14.1, which is to be released shortly.

 regards, aki

 2014-12-10 9:25 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
  I played a little bit.
 
  Jan
 
 
  public class XmlTest extends CamelTestSupport {
 
  @EndpointInject(uri=mock:valid)
  MockEndpoint valid;
 
  @EndpointInject(uri=mock:validationError)
  MockEndpoint validationError;
 
 
 
  @Test
  public void validNewsfeed() throws Exception {
  // Newsfeed contains 2 news
  valid.expectedMessageCount(2);
  valid.expectedMessagesMatches(
  // Use helper methods from the static imported
 PredicateBuilder
  and(
  header(newsfeed.date).isEqualTo(2014.12.09
 14:15),
  header(news.author).isEqualTo(Jan),
 
 
 body().contains(xmlns:news=\http://www.materne.de/camel/test/xml/com
  plex/\
  )
  )
  );
  // no error expected
  validationError.expectedMessageCount(0);
 
  // Read xml from classpath and send to Camel route
  String xml =
 
 IOUtils.toString(getClass().getResourceAsStream(/de/materne/camel/tes
  t/xml/
  complex/validNewsfeed.xml));
  sendBody(direct:in, xml);
 
  // 'execute' all tests
  assertMockEndpointsSatisfied();
  }
 
 
  @Test
  public void invalidXml() throws Exception {
  valid.expectedMessageCount(0);
  validationError.expectedMessageCount(1);
 
  String xml = xml/;
  sendBody(direct:in, xml);
 
  assertMockEndpointsSatisfied();
  }
 
 
 
  @Override
  protected RouteBuilder createRouteBuilder() throws Exception {
  return new RouteBuilder() {
  @Override
  public void configure() throws Exception {
  // Our XML uses namespaces, so we have to deal with
 that.
  Namespaces ns = new Namespaces(news,
  http://www.materne.de/camel/test/xml/complex/;);
 
  // XSD-invalid data goes to this endpoint
  onException(ValidationException.class)
  .to(mock:validationError);
 
  from(direct:in)
  // XSD-validation
 
  .to(validator:de/materne/camel/test/xml/complex/newsfeed.xsd)
 
  // Store newsfeed data in the header before
 split,
  so we haven't to do that on each
  // splittet news-message.
  .setHeader(newsfeed.date,
  ns.xpath(/news:Newsletter/@date;, String.class))
 
  // http://camel.apache.org/splitter.html
  // xtokenize() is available since Camel 2.14.
  // Use the 'wrap'-mode so we keep the Newsletter-
 Header
  .split().xtokenize(/news:Newsletter/News;, 'w',
  ns)
 
  // Workaround of a bug?? in
 XMLTokenizerExpression
 
  .setBody(simple(${body.replace('//news:Newsletter',
  '/news:Newsletter')}))
 
  .setBody(simple(${body.replace('/news:Newsletter',
  '/news:Newsletter')}))
 
  // Get some data from the splittet news
  .setHeader(news.date,
  ns.xpath(/news:Newsletter/News/@date;, String.class))
  .setHeader(news.author,
  ns.xpath(/news:Newsletter//News/@author;, String.class))
 
  .to(mock:valid);
  }
  };
  }
 
  }
 
 
 
  ?xml version=1.0 encoding=UTF-8? schema
  xmlns

Re: AW: camel - xsd

2014-12-10 Thread Aki Yoshida
i meant woodstox-core-asl (e.g., woodstox-core-asl-4.4.1.jar).
its maven coordinate is

mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1

you need to have woodstox or some other parser that reliably reports
the offset location at each parse event.
Sjsxp (sun/oracle implementation included in JDK) doesn't do that, so
you can't use it.

jmtest.tar.gz contains a maven project that can be executed directly
by typing mvn test at the console or can be imported into your eclipse
IDE.

2014-12-10 13:13 GMT+01:00 Aki Yoshida elak...@gmail.com:
 i just created a test that uses your data and verified that it is working 
 fine.
 please take a look at this file at my dropbox.
 https://www.dropbox.com/s/pfgvs9si9bvujxo/jmtest.tar.gz?dl=0
 just extract the files into camel-core and run JMNewsTest.
 and see if that works in your environment, (i believe it does).

 in that case, we need to find out the difference to your case.
 do you have woodstox-api in your class path?


 2014-12-10 12:15 GMT+01:00 Aki Yoshida elak...@gmail.com:
 okay.
 let me take a look.


 2014-12-10 12:02 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
 No, input is valid xml.
 After invoking xtokenize() the xml is invalid.

 CAMEL-8106 is very  short. I can't see whether it is related.


 I posted an example on the user list
 http://mail-archives.apache.org/mod_mbox/camel-users/201412.mbox/%3C002b01d01452%24e8ee27a0%24baca76e0%24%40de%3E

 I had done a 'workaround' for this special example
 // Workaround of a bug?? in XMLTokenizerExpression
 .setBody(simple(${body.replace('//news:Newsletter', 
 '/news:Newsletter')}))
 .setBody(simple(${body.replace('/news:Newsletter', 
 '/news:Newsletter')}))

 Without that the split messages have wrong end tags.


 Jan


 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Mittwoch, 10. Dezember 2014 10:34
 An: users@camel.apache.org
 Betreff: Re: AW: camel - xsd

 you are talking about the invalid-xml parsing bug in xtokenzier.
 that has been fixe with CAMEL-8106. It should be part of the new
 2.14.1, which is to be released shortly.

 regards, aki

 2014-12-10 9:25 GMT+01:00 Jan Matèrne (jhm) apa...@materne.de:
  I played a little bit.
 
  Jan
 
 
  public class XmlTest extends CamelTestSupport {
 
  @EndpointInject(uri=mock:valid)
  MockEndpoint valid;
 
  @EndpointInject(uri=mock:validationError)
  MockEndpoint validationError;
 
 
 
  @Test
  public void validNewsfeed() throws Exception {
  // Newsfeed contains 2 news
  valid.expectedMessageCount(2);
  valid.expectedMessagesMatches(
  // Use helper methods from the static imported
 PredicateBuilder
  and(
  header(newsfeed.date).isEqualTo(2014.12.09
 14:15),
  header(news.author).isEqualTo(Jan),
 
 
 body().contains(xmlns:news=\http://www.materne.de/camel/test/xml/com
  plex/\
  )
  )
  );
  // no error expected
  validationError.expectedMessageCount(0);
 
  // Read xml from classpath and send to Camel route
  String xml =
 
 IOUtils.toString(getClass().getResourceAsStream(/de/materne/camel/tes
  t/xml/
  complex/validNewsfeed.xml));
  sendBody(direct:in, xml);
 
  // 'execute' all tests
  assertMockEndpointsSatisfied();
  }
 
 
  @Test
  public void invalidXml() throws Exception {
  valid.expectedMessageCount(0);
  validationError.expectedMessageCount(1);
 
  String xml = xml/;
  sendBody(direct:in, xml);
 
  assertMockEndpointsSatisfied();
  }
 
 
 
  @Override
  protected RouteBuilder createRouteBuilder() throws Exception {
  return new RouteBuilder() {
  @Override
  public void configure() throws Exception {
  // Our XML uses namespaces, so we have to deal with
 that.
  Namespaces ns = new Namespaces(news,
  http://www.materne.de/camel/test/xml/complex/;);
 
  // XSD-invalid data goes to this endpoint
  onException(ValidationException.class)
  .to(mock:validationError);
 
  from(direct:in)
  // XSD-validation
 
  .to(validator:de/materne/camel/test/xml/complex/newsfeed.xsd)
 
  // Store newsfeed data in the header before
 split,
  so we haven't to do that on each
  // splittet news-message.
  .setHeader(newsfeed.date,
  ns.xpath(/news:Newsletter/@date;, String.class))
 
  // http://camel.apache.org/splitter.html
  // xtokenize() is available since Camel 2.14.
  // Use the 'wrap'-mode so we keep the Newsletter-
 Header
  .split().xtokenize(/news:Newsletter/News;, 'w',
  ns)
 
  // Workaround of a bug?? in
 XMLTokenizerExpression
 
  .setBody(simple

Re: Need leading/trailing spaces support in camel:simple

2014-12-10 Thread Aki Yoshida
you can set the trim attribute in the expression.
trim=false

and it think you should be using \r and \n instead of relying on the
implicit LF or the xml-char ref to be on the safer side in preserving
those chararacters.


2014-12-09 11:08 GMT+01:00 Goyal, Arpit arpit.go...@sap.com:
 Hi Colleagues,

 We have the following XML DSL (part of the whole xml), where we set the body 
 using camel:simple tag. Somehow in the processing, we see that the spaces are 
 trimmed at the end.


 camel:setBody

 camel:simpleNameIDPlace#13;

 A 1 X#13;

 B 2 D#13;

 B 3 Bangalore#13;

 E 4 A/camel:simple

 /camel:setBody



 Camel Version: 2.12.x



 Any pointers how to preserve this while using 'camel:simple' - some property 
 may be?



 Regards,

 A.



Re: AHS-WS problem?

2014-11-24 Thread Aki Yoshida
cool ;-)
thanks for posting your code example.


2014-11-22 17:25 GMT+01:00 jogro jonas.gronb...@gmail.com:
 Adding the following method to the java config worked liked a charm:

 @Bean
 public ServletRegistrationBean camelWsServletRegistrationBean() {
 ServletRegistrationBean registration = new 
 ServletRegistrationBean(
 new CamelWebSocketServlet(), /*);
 registration.setName(CamelWsServlet);
 return registration;
 }

 Thanks for all helpful information!



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/AHS-WS-problem-tp5759334p5759496.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AHS-WS problem?

2014-11-21 Thread Aki Yoshida
If you can get a servlet container running, you can attach the
atmosphere-websocket's endpoint using its servlet.
Or if you need to start a server on your own, you can do this like in
this setUp method.
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-atmosphere-websocket/src/test/java/org/apache/camel/component/atmosphere/websocket/WebsocketCamelRouterTestSupport.java

But we could also add the binary mode to camel-websocket. I have a
slight concern, however, for the producer side, as I see that it is
currently converting any data (also byte[] then) into String and sent
it over the socket. So if someone has a scenario having byte[]
messages at the producer side and their client is expecting String
messages, they will need to add the convertBodyTo step to explicitly
convert the byte[] messge into a String message in that case, though.
CAMEL-8070 created for this.

regards, aki

2014-11-20 15:08 GMT+01:00 jogro jonas.gronb...@gmail.com:
 Thanks for your quick answers. I'll look into the Camel Atmosphere component
 and see if I can have it running within Spring Boot too.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/AHS-WS-problem-tp5759334p5759356.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AHS-WS problem?

2014-11-19 Thread Aki Yoshida
Hi,
I can look at it tomorrow to confirm what I am saying below.
A quick answer is that ahc-ws sends messages differently based on the
java type of the message.
In your case, you have an input stream based object when there is no
string converter, In this case, the message is sent in a series of
data fragments, where the last fragment is marked as last.

And I guess the camel-websocket can only  handle the plain string mode
and ignores other types of data. I think camel-atmosphere-websocket
should work with bytes or stream..

regards, aki


2014-11-19 20:20 GMT+01:00 jogro jonas.gronb...@gmail.com:
 Hi,

 I wanted to try out the new AHS-WS and Websocket components together with
 Spring Boot so I set up
 two maven projects based on

 Spring Roo 1.1.9.RELEASE
 Apache Camel 2.14.0.
 Java 1.8_05 (MacOS X)

 One client project using the following route configuration:

 from(direct:echo)
 .autoStartup(true)
 .marshal().base64()
 .convertBodyTo(String.class)
 .to(ahc-ws://localhost:9292/echo?sync=true);

 from(ahc-ws://localhost:9292/echo?sync=true)
 .log(Got ${body});

 One server project using the following route configuration:

 from(websocket://echo)
 .unmarshal().base64()
 .log( Message received from WebSocket Client : ${body})
 .transform().simple(${in.body})
 .to(websocket://echo);

 These configurations actually work fine. Invoking

 producerTemplate.requestBody(direct:echo, Jonas)

 generates a log like this.

 2014-11-19 19:43:10.855 DEBUG 8577 --- [lication Thread]
 o.a.camel.component.ahc.ws.WsProducer: Sending out Sm9uYXM=

 2014-11-19 19:43:11.190  INFO 8577 --- [w I/O worker #1]
 o.a.camel.component.ahc.ws.WsEndpoint: websocket opened
 2014-11-19 19:43:11.309  INFO 8577 --- [w I/O worker #1]
 o.a.camel.component.ahc.ws.WsEndpoint: received message -- Hello Jonas!
 2014-11-19 19:43:11.326  INFO 8577 --- [w I/O worker #1] route2
 : Got Hello Jonas!

 But if I remove the call to convertBodyTo method in the client
 configuration, the invocation above never gets a response from the server.
 The log below shows two invocations:

 2014-11-19 19:48:33.634 DEBUG 8592 --- [lication Thread]
 o.a.camel.component.ahc.ws.WsProducer: Sending out [83, 109, 57, 117,
 89, 88, 77, 61, 13, 10]
 2014-11-19 19:48:33.822  INFO 8592 --- [w I/O worker #1]
 o.a.camel.component.ahc.ws.WsEndpoint: websocket opened
 2014-11-19 19:48:37.740 DEBUG 8592 --- [lication Thread]
 o.a.camel.component.ahc.ws.WsProducer: Sending out [83, 109, 57, 117,
 89, 88, 77, 61, 13, 10]

 What do you think? Is this a bug or is some configuration missing?

 My client application config looks like this:

 @Configuration
 @ComponentScan
 @EnableAutoConfiguration
 public class Application {
 @Bean
 public ProducerTemplate producerTemplate(SpringCamelContext context) {
 return context.createProducerTemplate();
 }
 @Bean
 public SpringCamelContext camelContext(ApplicationContext
 applicationContext)
 throws Exception {
 SpringCamelContext camelContext = new SpringCamelContext(
 applicationContext);
 camelContext.addRoutes(routeBuilder());
 return camelContext;
 }
 @Bean
 public RouteBuilder routeBuilder() {
 return new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(direct:echo)
 .autoStartup(true)
 .marshal().base64()
 .convertBodyTo(String.class)
 
 .to(ahc-ws://localhost:9292/echo?sync=true);

 from(ahc-ws://localhost:9292/echo?sync=true)
 .log(Got ${body});
 }
 };
 }
 }

 My server application config looks like this:

 @Configuration
 @ComponentScan
 @EnableAutoConfiguration
 public class Application {
 @Bean
 public SpringCamelContext camelContext(ApplicationContext
 applicationContext)
 throws Exception {
 SpringCamelContext camelContext = new SpringCamelContext(
 applicationContext);
 camelContext.addRoutes(routeBuilder());
 return camelContext;
 }
 @Bean
 public RouteBuilder routeBuilder() {
 return new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(websocket://echo)
  

Re: AHS-WS problem?

2014-11-19 Thread Aki Yoshida
you don't have an input stream based message but you have a byte[]
message. the rest of the story stays the same.


2014-11-20 0:47 GMT+01:00 Aki Yoshida elak...@gmail.com:
 Hi,
 I can look at it tomorrow to confirm what I am saying below.
 A quick answer is that ahc-ws sends messages differently based on the
 java type of the message.
 In your case, you have an input stream based object when there is no
 string converter, In this case, the message is sent in a series of
 data fragments, where the last fragment is marked as last.

 And I guess the camel-websocket can only  handle the plain string mode
 and ignores other types of data. I think camel-atmosphere-websocket
 should work with bytes or stream..

 regards, aki


 2014-11-19 20:20 GMT+01:00 jogro jonas.gronb...@gmail.com:
 Hi,

 I wanted to try out the new AHS-WS and Websocket components together with
 Spring Boot so I set up
 two maven projects based on

 Spring Roo 1.1.9.RELEASE
 Apache Camel 2.14.0.
 Java 1.8_05 (MacOS X)

 One client project using the following route configuration:

 from(direct:echo)
 .autoStartup(true)
 .marshal().base64()
 .convertBodyTo(String.class)
 .to(ahc-ws://localhost:9292/echo?sync=true);

 from(ahc-ws://localhost:9292/echo?sync=true)
 .log(Got ${body});

 One server project using the following route configuration:

 from(websocket://echo)
 .unmarshal().base64()
 .log( Message received from WebSocket Client : ${body})
 .transform().simple(${in.body})
 .to(websocket://echo);

 These configurations actually work fine. Invoking

 producerTemplate.requestBody(direct:echo, Jonas)

 generates a log like this.

 2014-11-19 19:43:10.855 DEBUG 8577 --- [lication Thread]
 o.a.camel.component.ahc.ws.WsProducer: Sending out Sm9uYXM=

 2014-11-19 19:43:11.190  INFO 8577 --- [w I/O worker #1]
 o.a.camel.component.ahc.ws.WsEndpoint: websocket opened
 2014-11-19 19:43:11.309  INFO 8577 --- [w I/O worker #1]
 o.a.camel.component.ahc.ws.WsEndpoint: received message -- Hello Jonas!
 2014-11-19 19:43:11.326  INFO 8577 --- [w I/O worker #1] route2
 : Got Hello Jonas!

 But if I remove the call to convertBodyTo method in the client
 configuration, the invocation above never gets a response from the server.
 The log below shows two invocations:

 2014-11-19 19:48:33.634 DEBUG 8592 --- [lication Thread]
 o.a.camel.component.ahc.ws.WsProducer: Sending out [83, 109, 57, 117,
 89, 88, 77, 61, 13, 10]
 2014-11-19 19:48:33.822  INFO 8592 --- [w I/O worker #1]
 o.a.camel.component.ahc.ws.WsEndpoint: websocket opened
 2014-11-19 19:48:37.740 DEBUG 8592 --- [lication Thread]
 o.a.camel.component.ahc.ws.WsProducer: Sending out [83, 109, 57, 117,
 89, 88, 77, 61, 13, 10]

 What do you think? Is this a bug or is some configuration missing?

 My client application config looks like this:

 @Configuration
 @ComponentScan
 @EnableAutoConfiguration
 public class Application {
 @Bean
 public ProducerTemplate producerTemplate(SpringCamelContext context) 
 {
 return context.createProducerTemplate();
 }
 @Bean
 public SpringCamelContext camelContext(ApplicationContext
 applicationContext)
 throws Exception {
 SpringCamelContext camelContext = new SpringCamelContext(
 applicationContext);
 camelContext.addRoutes(routeBuilder());
 return camelContext;
 }
 @Bean
 public RouteBuilder routeBuilder() {
 return new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(direct:echo)
 .autoStartup(true)
 .marshal().base64()
 .convertBodyTo(String.class)
 
 .to(ahc-ws://localhost:9292/echo?sync=true);

 
 from(ahc-ws://localhost:9292/echo?sync=true)
 .log(Got ${body});
 }
 };
 }
 }

 My server application config looks like this:

 @Configuration
 @ComponentScan
 @EnableAutoConfiguration
 public class Application {
 @Bean
 public SpringCamelContext camelContext(ApplicationContext
 applicationContext)
 throws Exception {
 SpringCamelContext camelContext = new SpringCamelContext(
 applicationContext);
 camelContext.addRoutes(routeBuilder());
 return camelContext;
 }
 @Bean
 public RouteBuilder routeBuilder

Re: Support for CXF dispatch api in the latest release of camel

2014-11-14 Thread Aki Yoshida
I am not still sure what you mean by using the dispatch API in camel.

Willem already answered to your question and I am adding a few info.

The actual dispatching part (i.e., sending out a generic message) is
there in Camel. The message constructing part isn't there because in
camel, you typically construct a message elsewhere as a payload or a
SOAP-envelope and simply forwarding it to a cxf endpoint that can send
that message.

If that is what you can use, you can find the examples in these tests
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfDispatchPayloadTest.java
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfDispatchMessageTest.java

regards, aki

2014-11-12 5:54 GMT+01:00 santosh das santoshdas1...@gmail.com:
 Thanks a lot for the suggestion, do we have any samples specific to cxf
 that i can try out?
 I need some more clarification between the relationship of the beans and
 processors and how they fit in together?

 I believe we can have an anonymous innerclass of processor to define the
 custom business logic, are you proposing to hook in CXF dispatch code in
 there?

 Also is there a plan to support CXF dispatch API out of the box from camel
 in the near future.

 I find it really encouraging to get suggestions from an active community
 group.
 Appreciate for all the help provided so far and going forward.

 Thanks,
 Santosh


 On Wed, Nov 12, 2014 at 8:10 AM, Willem Jiang willem.ji...@gmail.com
 wrote:

 Current camel-cxf doesn’t support the dispatch API, you can use the
 PAYLOAD message data format to do the something.

 BTW, if you still want to use the CXF dispatch API, you can use bean[1] or
 processor[2] to integration the invocation within Camel route.

 [1]http://camel.apache.org/bean.html
 [2]http://camel.apache.org/processor.html

 --
 Willem Jiang

 Red Hat, Inc.
 Web: http://www.redhat.com
 Blog: http://willemjiang.blogspot.com (English)
 http://jnn.iteye.com (Chinese)
 Twitter: willemjiang
 Weibo: 姜宁willem



 On November 11, 2014 at 5:41:52 PM, santoshdas1984 (
 santoshdas1...@gmail.com) wrote:
  Hi ,
 
  Could you please elaborate a bit more about the Camel CXF endpoint.
  We dont want to use the spring based configuration as we are evaluating
 this
  for our product
 
  The same reason we have used CXF For e.g.
  For Ws-Addressing we are using the dispatch api as follows
 
  import static
 
 org.apache.cxf.ws.addressing.JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES;
 
  import java.io.FileNotFoundException;
  import java.io.IOException;
 
  import javax.xml.namespace.QName;
  import javax.xml.soap.MessageFactory;
  import javax.xml.soap.SOAPBody;
  import javax.xml.soap.SOAPConstants;
  import javax.xml.soap.SOAPElement;
  import javax.xml.soap.SOAPEnvelope;
  import javax.xml.soap.SOAPException;
  import javax.xml.soap.SOAPMessage;
  import javax.xml.soap.SOAPPart;
  import javax.xml.ws.Dispatch;
  import javax.xml.ws.Service;
  import javax.xml.ws.soap.SOAPBinding;
 
  import org.apache.cxf.endpoint.Client;
  import org.apache.cxf.jaxws.DispatchImpl;
  import org.apache.cxf.ws.addressing.AddressingProperties;
  import org.apache.cxf.ws.addressing.AttributedURIType;
  import org.apache.cxf.ws.addressing.ObjectFactory;
  import org.apache.cxf.ws.addressing.impl.MAPAggregatorImpl;
  import org.apache.cxf.ws.addressing.soap.MAPCodec;
 
  import com.pega.pegarules.priv.ModuleVersion;
 
  public class TestCXFAddressing {
 
  public static final String VERSION = ModuleVersion.register($Id$);
  private static final ObjectFactory WSA_OBJECT_FACTORY = new
  ObjectFactory();
 
  /**
  * @param args
  * @throws SOAPException
  * @throws IOException
  */
  public static void main(String[] args) throws IOException, SOAPException
 {
  testService();
  }
 
  private static void testService() throws FileNotFoundException,
  IOException, SOAPException {
  QName serviceName = new QName(, );
  Service s = Service.create(serviceName);
 
  QName portName = new QName(, );
 
  s.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING,
  http://localhost:9000/SoapContext/SoapPort;);
 
  Dispatch dispatch = s.createDispatch(portName,
  SOAPMessage.class, Service.Mode.MESSAGE);
  Client client = ((DispatchImpl) dispatch).getClient();
 
  // engage addressing interceptors
  MAPCodec mapCodec = new MAPCodec();
  MAPAggregatorImpl mapAggregator = new MAPAggregatorImpl();
 
  client.getOutInterceptors().add(mapCodec);
  client.getOutInterceptors().add(mapAggregator);
  client.getInInterceptors().add(mapCodec);
  client.getInInterceptors().add(mapAggregator);
 
  // set addressing property in request context
  dispatch.getRequestContext().put(CLIENT_ADDRESSING_PROPERTIES,
  createMaps());
 
  // Create a message. This example works with the SOAPPART.
  MessageFactory mf = MessageFactory
  .newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
  SOAPMessage 

Re: Problem configuring route

2014-11-06 Thread Aki Yoshida
I think the values you are setting for the serviceName and
endpointName properties are wrong.
These are QNames formated in form {nsuri}lcname, where nsuri is the
namespace uri and lcname the local name.

So if the namespace-uri is http://axisversion.sample; and the local
name is Version, the property value should look like
{http://axisversion.sample}Version; and not
http://axisversion.sample/Version;.


2014-11-06 9:53 GMT+01:00 Royamit amitroy...@gmail.com:
 Hi all,

 I am trying to create a proxy service which invokes axis2 version web
 service.
 But while trying so, i am encountering error which is related to namespace
 issue.

 My camel proxy configure method is :

 @Override
 public void configure() throws Exception {

 String cxfEndpointAddress =
 cxf://http://localhost:9081/camel-example-cxf-proxy/webservices/versionWS?;;
 String namespace=http://axisversion.sample;;
 String cxfEndpoint = cxfEndpointAddress
 + endpointName=+namespace+/VersionHttpSoap11Endpoint 
 + serviceName=+namespace+/Version 
 + wsdlURL=etc/versionAdapter.wsdl
 + dataFormat=MESSAGE;

 System.out.println(The cxf Endpoint formed is : + 
 cxfEndpoint);

 String
 callRealWebService=http://localhost:8080/axis2/services/Version?throwExceptionOnFailure=false;;

 System.out.println(Real web service is :  + 
 callRealWebService);


 from(cxfEndpoint).to(log:input).removeHeader(pattern=CamelHttp*).to(callRealWebService).to(log:output);


 }

 But while running this code i get the following error:
 Exception in thread main
 org.apache.cxf.service.factory.ServiceConstructionException: Could not find
 definition for service http://axisversion.sample/Version .
 at
 org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:158)
 at
 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:405)
 at
 org.apache.camel.component.cxf.WSDLServiceFactoryBean.buildServiceFromWSDL(WSDLServiceFactoryBean.java:102)
 at
 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:525)
 at
 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:261)
 at
 org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)
 at
 org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
 at
 org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159)
 at
 org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
 at 
 org.apache.camel.component.cxf.CxfConsumer.init(CxfConsumer.java:262)
 at
 org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint.java:242)
 at
 org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65)
 at
 org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:80)
 at org.apache.camel.impl.RouteService.warmUp(RouteService.java:134)
 at
 org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:2379)
 at
 org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:2309)
 at
 org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2091)
 at
 org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1951)
 at
 org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1777)
 at 
 org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
 at
 org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1745)
 at
 org.apache.camel.example.version.VersionRoutes.main(VersionRoutes.java:14)

 How can i fix the namespace issue?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Problem-configuring-route-tp5758581.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-cxf: Generic Service Endpoint Interface

2014-10-02 Thread Aki Yoshida
I am wondering you can simply use the transform feature of CXF to
remove the extra element that you want to drop.
http://cxf.apache.org/docs/transformationfeature.html#TransformationFeature-Droppingoutputandinputelements.

2014-10-01 15:25 GMT+02:00 Tobias Mahlmann t.mahlm...@gmail.com:
 HI list,
 I'm currently trying to get familiar with cxf/camel/servicemix and maybe
 someone here has some input on this:
 I have a web service that I'm trying to consume with camel-cxf. The web
 service works fine, but I'm having trouble with the
 Service Endpoint Interface. I set up the cxfEndpoint via spring as follows:
 cxf:cxfEndpoint id=cxfEndpoint
 address=http://localhost:8080/MyServlet/services/MyService;
 serviceClass=my.package.MyInterface
 serviceName=s:MyService

 wsdlURL=http://localhost:8080/MyServlet/services/MyService?wsdl;
 endpointName=s:MyService xmlns:s=http://my.package;
 /cxf:cxfEndpoint

 The tricky thing is, MyInterface resp. the webservice itself extends a
 generic interface:
 public interface MyInterface extends MyGenericInterfaceA,B { ..}
 and
 public MyGenericInterfaceU,V{
 U foo(V bar);
 }

 This will generate the following error:
 javax.xml.bind.UnmarshalException: unexpected element
 (uri:http://my.package;, local:fooReturn). Expected elements are (none)
 at
 com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handl
 eEvent(UnmarshallingContext.java:647)[:1.7.0_21]

 Now, if I either change MyInterface to

 MyInterface {
 A foor(B bar);
 }
 or make MyGenericInterface non-generic:

 public interface MyInterface extends MyGenericInterface{ ..}
 and
 public MyGenericInterface{
 A foo(B bar);
 }

 everything works fine. I guess, I could inspect the Interface myself, deal
 with generic parameters, omit it from the endpoint definition, set the
 endpoint to PAYLOAD and deal with the cxfPayload/SOAP envelopes myself, but
 I'd rather not re-invent the wheel if possible.

 Am I missing something? Any comments appreciated.

 Tobias



Re: Camel split tokenizer does not identify malformed xml

2014-09-19 Thread Aki Yoshida
Hi,
For 2.12,x, you would need to insert some filter processor in your
route. For example, you can insert an identity StAX transformer (i.e.,
just read each event and forward it to the user without any
transformation) in your route so that the wellformedness is checked
while the data is read by the tokenizer. I don't know if someone
already has something like that. If not, you will need to write such a
processor.

regards, aki

2014-09-17 16:22 GMT+02:00 balavino balajieng...@gmail.com:
 Hi Aki,

 Thanks for the response!

 I use 2.12.2 Ver.

 When comes a xml file as:

 data
record
 account pan=12345/account
/record
 record
 account pan=67891/account
/record
   record
account pan=98657/account
   /record
 /data

 I use xpath to get the value of interest /record/account@pan. But in case of
 a malformed xml file as above i can choose to completely ignore the file
 without processing it partially. Is there an option to identify the xml is
 malformed at the start without using any xsd?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-split-tokenizer-does-not-identify-malformed-xml-tp5756111p5756647.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to run a camel aplication with a cxf web service outside of osgi container

2014-09-17 Thread Aki Yoshida
do you have cxf-rt-transports-http-jetty in your dependency?
the standalone cxf endpoints will be started as jetty-destinations and
for that, you will need cxf-rt-transports-jetty.
regards, aki



2014-09-16 19:29 GMT+02:00 techybolek techy_bo...@yahoo.com:
 I'm able to run most camel scenarios as a stand-alone java application
 indicating org.apache.camel.spring.Main as the main function. Spring Main
 automatically locates the xml bean file and initializes the camel context
 and the camel routes. I find it very convenient for quick testing an
 debugging.
 However, I could not get the cxf web service endpoints to work that way. The
 application builds and launches correctly and the routes that don't include
 the cxf web service endpoints work fine. Also when I deploy the application
 to Service Mix the web service endpoint works fine too.

 Is there any way to get the web service endpoints to work in a standalone
 java application? I'd expect it should be doable, I'd just need to somehow
 initialize the jetty servlet or something...
 Thanks, Thomas





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-to-run-a-camel-aplication-with-a-cxf-web-service-outside-of-osgi-container-tp5756600.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel split tokenizer does not identify malformed xml

2014-09-17 Thread Aki Yoshida
In camel 2.14.0, there is an xml-aware tokenizer that can solve your problem.
http://camel.apache.org/splitter.html

In an older system, you need to come up with your own custom solution.

But in general, when using an xml-parser to process a non-wellformed
xml documents, it probably doesn't make much sense to partially
process the document. Suppose you have the input

data
   record
account pan=12345/account
   /record
record
account pan=67891/account
   /record
  record
   account pan=98657/account
  /record
/data

Which entries do you want to process or accept? The xml parser will
report two tokens without throwing any errors although the document
appears completely corrupt but yet empirically one can assume there
are three account values, which could have been successfully extracted
if you were using a custom text-based extractor.

regards, aki


2014-09-17 15:07 GMT+02:00 balavino balajieng...@gmail.com:
 Hi,

 I don't have a xsd schema to validate the xml file. I only need to make sure
 that there is no malformation in the whole xml, in that case if the xml is
 malformed i have a option to stop from futher processing in the route. Do
 you have any ideas to do this?

 *xml-file:*
 /data
record
 account pan=12345/account
/record
record
 account pan=67891/account
/record
 /data/

 *route xml:*

 /  split strategyRef=splitXmlAggregator
 stopOnException=true
 tokenize token=record xml=true /
 setHeader headerName=Id
xpath
 resultType=java.lang.String/record/account@pan/xpath
   /setHeader
  /split/

 I use tokenizer to split based on xml file based on the token record into
 2 splits. If i have a malformation inside the level of record tag the  the
 javax.xml.XPathExpressionException is thrown.

 When i do have a malformation as below:

 /data
record
 account pan=12345/account
/record
 record
 account pan=67891/account
/record
 /data/

 Where the second record tag doesn't have a start '' delimiter i.e on the
 level of the record tag then the number of splits i get is only 1 not 2. I
 wish to atleast log that i have skipped a record from being processed, a
 count of the no. of records skipped. The second option is atleast i get to
 log the skipped record, any suggestions for this?




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-split-tokenizer-does-not-identify-malformed-xml-tp5756111p5756638.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: WSDL2Java error in Camel Project

2014-08-04 Thread Aki Yoshida
if you have a wsdl that has the same type name used in different
places, you need to define a custom mapping file to rename those
conflicting names (make those names unique to avoid naming collision).


Glen Mazza has a page explaining all these.
https://web-gmazza.rhcloud.com/blog/entry/enhancing-jaxb-artifacts



2014-08-04 12:40 GMT+02:00 contactreji contactr...@gmail.com:
 Hi Guys

 I just tried creating web service using WSDL first approach. I have created
 wsdl successfully but while i import the same into my camel project and try
 to generate classes using wsdl2java plugin, I get following errors.
 *
 Execution generate-sources of goal
 org.apache.cxf:cxf-codegen-plugin:2.6.0.fuse-71-047:wsdl2java failed:
 file:/C:/Users/re267981/Training/stub-mes-bw-WaterConsumption/src/main/resources/wsdl/SyncSupplierPartyMaster.wsdl
 [3879,7]: Property Type is already defined. Use lt;jaxb:property to
 resolve this conflict.
 file:/C:/Users/re267981/Training/stub-mes-bw-WaterConsumption/src/main/resources/wsdl/SyncSupplierPartyMaster.wsdl
 [3914,6]: The following location is relevant to the above error
 file:/C:/Users/re267981/Training/stub-mes-bw-WaterConsumption/src/main/resources/wsdl/SyncSupplierPartyMaster.wsdl
 [3598,6]: Property Type is already defined. Use lt;jaxb:property to
 resolve this conflict.
 file:/C:/Users/re267981/Training/stub-mes-bw-WaterConsumption/src/main/resources/wsdl/SyncSupplierPartyMaster.wsdl
 [3693,5]: The following location is relevant to the above error
 file:/C:/Users/re267981/Training/stub-mes-bw-WaterConsumption/src/main/resources/wsdl/SyncSupplierPartyMaster.wsdl
 [3453,6]: Property Type is already defined. Use lt;jaxb:property to
 resolve this conflict.
 file:/C:/Users/re267981/Training/stub-mes-bw-WaterConsumption/src/main/resources/wsdl/SyncSupplierPartyMaster.wsdl
 [3472,5]: The following location is relevant to the above error

 (org.apache.cxf:cxf-codegen-plugin:2.6.0.fuse-71-047:wsdl2java:generate-sources:generate-sources)*


 Attaching WSDL file for your reference.

 SyncSupplierPartyMaster.wsdl
 http://camel.465427.n5.nabble.com/file/n5754764/SyncSupplierPartyMaster.wsdl



 This WSDL is created by a OAGIS open standards schema defined for
 Manufacturing Domain. Its a widely used set of schemas in production
 environment around the globe by various manufacturing companies.

 Any ideas would be helpful

 Cheers
 Reji



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/WSDL2Java-error-in-Camel-Project-tp5754764.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Package camel spring into .jar file

2014-07-21 Thread Aki Yoshida
this is not a camel question and actually it has nothing to do with camel.

you need to look at the maven jar archive plugin documentation.
http://maven.apache.org/shared/maven-archiver/

in your case, take a look at how the Class-Path header in the manifest
file of your jar looks like. You probably have wrong values.

usually you will need to add a few properties (e.g., classpathLayout,
classpathPrefix) in the plugin configuration so that the each path
segment represents a valid class path.

for example, if you want your jar to load dependent jars from your
repo, you can add
  classpathLayoutTyperepository/classpathLayoutType
  classpathPrefix${settings.localRepository}/classpathPrefix

and run the build and verify the manifest entry of your generated jar.

regards, aki


2014-07-18 11:03 GMT+02:00 sergarci serga...@gmail.com:
 I've ended using spring-boot:

 /plugin
groupIdorg.springframework.boot/groupId
artifactIdspring-boot-maven-plugin/artifactId
version1.1.4.RELEASE/version
executions
  execution
   goals
 goalrepackage/goal
/goals
   /execution
  /executions
 /plugin/

 With a custom main class:

 /import org.apache.camel.spring.Main;

 public class CamelMain {
 public static void main(String[] args) throws Exception {
 Main main = new Main();
 main.setApplicationContextUri(spring/camel-context.xml);
 main.enableHangupSupport();
 main.start();
 while (true);
 }
 }/

 just running *mvn package* and generated jar file works as if running mvn
 camel:run.

 Thanks everyone

 Used resources:
 camel in action book
 http://docs.spring.io/spring-boot/docs/1.0.1.RELEASE/reference/html/build-tool-plugins-maven-plugin.html



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Package-camel-spring-into-jar-file-tp5753964p5753993.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Passing SOAP XML to the CXF endpoint

2014-07-21 Thread Aki Yoshida
what's the error?
the service returning a soap faull complaing the missign soapaction header?

in that case, you need to set the soapaction header (i.e.,
.setHeader(soapaction, ...) explicitly or set the operation name
header (i.e., .setHeader(operationName, ...) so that the correct
soapaction is generated.

regards, aki

2014-07-18 10:51 GMT+02:00 Raju Mandala irajumand...@gmail.com:
 Hi,
 I have a requirement While routing in camel, i have to call a web
 service. But i am struck with setting SOAP xml to the exchange. Can some
 one help me with this. Please have a look at my code

 public static void main(String[] args) throws Exception {
 CamelContext context = new DefaultCamelContext();
 context.addRoutes(new RouteBuilder() {

 @Override
 public void configure() throws Exception {
 from(file:input?noop=true)
 .process(new Processor() {
 @Override
 public void process(Exchange exchange)
 throws Exception {
 //Setting a String to the exchange body
 exchange.getIn().setBody(Just a String);
 //Now i want to set a SOAP xml to the
 exchange body
 //exchange.getIn().setBody();
 System.out.println(Ravi +
 exchange.getIn().getBody(String.class));
 }
 })

 .to(cxf://http://www.webservicex.net/stockquote.asmx?wsdlURL=src/main/resources/META-INF/stockquote.wsdlserviceName={http://www.webserviceX.NET/}StockQuoteportName={http://www.webserviceX.NET/}StockQuoteSoapdataFormat=MESSAGE;)
 .process(new Processor() {
 @Override
 public void process(Exchange exchange)
 throws Exception {
 System.out.println(Raju + exchange);
 }
 }).to(file:data/destination?fileName=test2.xml);
 }
 });
 context.start();
 Thread.sleep(2);
 context.stop();
 }



 ~Raju


Re: Getting entire Soap Message with header and body in Payload mode

2014-07-11 Thread Aki Yoshida
That would be one possibility but you would be losing the exact form
(the serialised wire message isn't the same as the original wire
message).

If you really need to get a cloned wire message at your camel route,
one option would be to write a CXF interceptor to capture the original
message and pass it to the camel route as an additional runtime
context object. Maybe, actually I think there is no other option.

If a DOM object is acceptable, you can also write a CXF interceptor to
grab it within CXF and pass it to camel.

regards, aki


2014-07-01 19:16 GMT+02:00 ychawla premiergenerat...@yahoo.com:
 Hello All,
 We use payload mode to process our CXF messages.  It is very convenient and
 will properly process the Soap Headers, SAML assertions, WS-Security headers
 etc.

 I have a requirements to get the entire raw Soap message in my camel route
 and call a processor with it.  There are other ways to do this, but the
 requirement explicitly states that the raw soap message is required.

 How can I get the entire raw soap message in Payload mode?  I guess I could
 reconstruct it manually by looping through the soap headers and re-creating
 the DOM but is there another way to get at it?

 Thanks,
 Yogesh



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Getting-entire-Soap-Message-with-header-and-body-in-Payload-mode-tp5753162.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


camel-cxf with rpc/literal style wsdl?

2014-06-24 Thread Aki Yoshida
I am having the following problem and I am not sure if this is a known
limitation.

I have a rpc/literal styled wsdl that works fine with standalone CXF
and would like to use this wsdl in my Camel scenario.

In my Camel scenario, I set up a camel-cxf producer endpoint using a
rpc/literal styled wsdl in the payload mode. That means, for an
operation, its message parts corresponds to the parameters of the
operation. And when the message is serialized, the operation name
becomes the root element of the soap body child that in turn contains
those parameters as its child elements.

When I was passing the XML payload over my camel route to this
endpoint, I thought I could pass the payload XML that has the
operation name as the root element just as if its corresponding
doc/literal wsdl were used. But this didn't work, as CXFEndpoint tried
to match the root element against the message parts of the operation.
That means, if the operation has one parameter and I pass this
parameter as the XML payload, the call succeeds. But for other cases
when there is zero parameter or more than one parameter in the
operation, there is no way to pass a valid payload for this operation,
as the payload is not a wellformed xml document.

Ideally, I think we should be able to pass the same XML payload as if
its corresponding doc/literal converted wsdl were used, that means,
the XML payload with the operationName as the root and CXFEndpoint
should unwrap the operation element for the rpc/literal case to fill
the CXF's message content.

I just wanted to ask if I am doing something wrong here or if this
rpc/literal in camel-cxf is a known limitation?

thanks.
regards, aki


Re: org.apache.cxf.cxf-api-Executor queue is full

2014-06-20 Thread Aki Yoshida
The warning means that the cxf consumer segment is receiving too many
messages than the default WorkQueue at OneWayProcessorInterceptor can
process.
In that case, you could increase the size of the queue as suggested by
the error message (see here for more info
http://cxf.547215.n5.nabble.com/Work-Queue-Configuration-td567763.html)

However, in your case, as you are queueing the messages anyway again
in your camel route, instead of changing the work queue setting, you
may want to use the robust-oneway mode at the cxf consumer endpoint to
skip the cxf's oneway processing queueing (see here for more info
http://camel.465427.n5.nabble.com/Error-handling-when-using-camel-cxf-td5723955.html)

regards, aki

2014-06-17 9:22 GMT+02:00 vs_mahesh vsmahesh...@yahoo.co.in:
 Hi all,

 What is the probable reason for the below warning
 *
 15:15:36,883 | WARN  | 1962481300-86990 | OneWayProcessorInterceptor   |
 170 - org.apache.cxf.cxf-api - 2.6.0.fuse-71-047 | Executor queue is full,
 run the oneway invocation task in caller thread.  Users can specify a larger
 executor queue to avoid this.
 15:15:36,891 | WARN  | 1962481300-60730 | OneWayProcessorInterceptor   |
 170 - org.apache.cxf.cxf-api - 2.6.0.fuse-71-047 | Executor queue is full,
 run the oneway invocation task in caller thread.  Users can specify a larger
 executor queue to avoid this.*

 the camel route is as follows

  bean id=jmsConnectionFactory
 class=org.apache.activemq.ActiveMQConnectionFactory
 property name=brokerURL value=${brokerURL} /

 property name=userName value=${brokerUserName} /
 property name=password value=${brokerPassword} /
 /bean
   bean id=pooledConnectionFactory
 class=org.apache.activemq.pool.PooledConnectionFactory init-method=start
 destroy-method=stop
   property name=maxConnections value=8 /
   property name=connectionFactory ref=jmsConnectionFactory /
   property name=idleTimeout value=0/
   /bean

  bean id=jmsConfig
 class=org.apache.camel.component.jms.JmsConfiguration
   property name=connectionFactory ref=pooledConnectionFactory/
   property name=concurrentConsumers value=10/

   /bean
 bean id=activemq
 class=org.apache.activemq.camel.component.ActiveMQComponent

 property name=configuration ref=jmsConfig /

   /bean
 camelContext xmlns=http://camel.apache.org/schema/spring;
 route
 from uri=cxf:bean:PowerConsumptionPerEquipment /
 

 to uri=Activemq /
 /route
 route 
 from uri=Activemq/

 to uri=SAPClientInvoker /
 /route
 /camelContext

 bean id=SAPClientInvoker class=Invokerclass
 init-method=init destroy-method=destroy
 property name=sapService ref=sapPiProxy /
 /bean
 jaxws:client id=sapPiProxy address=endpointadress
 serviceClass=ABCserviceclass
  /

 How to resolve the above Warning?

 Thanks,
 MAhesh



 -
 Thanks And regards,
 Mahesh
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/org-apache-cxf-cxf-api-Executor-queue-is-full-tp5752404.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXF Endpoint accepts invalid SOAP-Envelope in POJO-Mode

2014-06-16 Thread Aki Yoshida
Hi Jonas,
I created a jira ticket CXF-5805 at the CXF project and linked to this
mail thread.

thanks.
regards, aki

2014-06-13 20:47 GMT+02:00 Aki Yoshida elak...@gmail.com:
 just a minute.
 but this is likely to be not a camel issue but a cxf issue.
 so could you wait a little bit.
 thanks



 2014-06-13 20:39 GMT+02:00 Aki Yoshida elak...@gmail.com:
 hi yuncil,

 i didn't believe it first. ;-)

 but indeed, i see a bogus envelope gets accepted. (but haven't had
 enough time to look into it)
 when the namespace is wrong, the request gets rejected, but when only
 the element name is wrong, it gets processed.
 we should fix this issue.
 could you open a jira ticket?

 i'll look at it next week.
 thanks.

 aki

 2014-06-12 11:56 GMT+02:00 yuncil jonas.stei...@hotmail.de:
 Doesn't have anobody an idea? Is there no option to make sure that the
 incoming message is a valid SOAP-Request?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/CXF-Endpoint-accepts-invalid-SOAP-Envelope-in-POJO-Mode-tp5751971p5752195.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXF Endpoint accepts invalid SOAP-Envelope in POJO-Mode

2014-06-13 Thread Aki Yoshida
hi yuncil,

i didn't believe it first. ;-)

but indeed, i see a bogus envelope gets accepted. (but haven't had
enough time to look into it)
when the namespace is wrong, the request gets rejected, but when only
the element name is wrong, it gets processed.
we should fix this issue.
could you open a jira ticket?

i'll look at it next week.
thanks.

aki

2014-06-12 11:56 GMT+02:00 yuncil jonas.stei...@hotmail.de:
 Doesn't have anobody an idea? Is there no option to make sure that the
 incoming message is a valid SOAP-Request?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/CXF-Endpoint-accepts-invalid-SOAP-Envelope-in-POJO-Mode-tp5751971p5752195.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXF Endpoint accepts invalid SOAP-Envelope in POJO-Mode

2014-06-13 Thread Aki Yoshida
just a minute.
but this is likely to be not a camel issue but a cxf issue.
so could you wait a little bit.
thanks



2014-06-13 20:39 GMT+02:00 Aki Yoshida elak...@gmail.com:
 hi yuncil,

 i didn't believe it first. ;-)

 but indeed, i see a bogus envelope gets accepted. (but haven't had
 enough time to look into it)
 when the namespace is wrong, the request gets rejected, but when only
 the element name is wrong, it gets processed.
 we should fix this issue.
 could you open a jira ticket?

 i'll look at it next week.
 thanks.

 aki

 2014-06-12 11:56 GMT+02:00 yuncil jonas.stei...@hotmail.de:
 Doesn't have anobody an idea? Is there no option to make sure that the
 incoming message is a valid SOAP-Request?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/CXF-Endpoint-accepts-invalid-SOAP-Envelope-in-POJO-Mode-tp5751971p5752195.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue - waiting for namespace handlers [http://www.springframework.org/schema/osgi]

2014-06-10 Thread Aki Yoshida
you are mixing the spring stuff with blueprint. As a result, it ends
up incorrectly looking up the spring osgi namespace handler.
you have to use the reference element from the blueprint namespace instead.

regards, aki

2014-06-09 20:23 GMT+02:00 Happy User happyuser828...@gmail.com:
 Tried to expose activemq as OSGI service in activemq.xml and tried to
 reference it in blueprint. But I am getting the waiting for namespace
 issue. Have the spring-osgi.* jars in maven dependencies already.

 blueprint.xml:

 blueprint xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:camel=http://camel.apache.org/schema/blueprint;
xmlns:cxf=http://camel.apache.org/schema/blueprint/cxf;
xmlns:osgi=http://www.springframework.org/schema/osgi;
xmlns:cm=http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0
 
xsi:schemaLocation=
http://www.osgi.org/xmlns/blueprint/v1.0.0
 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint
 http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
http://camel.apache.org/schema/blueprint/cxf
 http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd
 http://www.springframework.org/schema/osgi
 http://www.springframework.org/schema/osgi/spring-osgi.xsd
 http://www.springframework.org/schema/osgi
 http://www.springframework.org/schema/osgi/spring-osgi.xsd;

 osgi:reference id=activemq interface=org.apache.camel.Component
 filter=(component=activemq)/

   camelContext trace=false id=blueprintContext xmlns=
 http://camel.apache.org/schema/blueprint;

 route
 from uri=file:camel/input/
 log message=Moving ${file:name} to the output directory/
 to uri=file:camel/output/
 /route

 /camelContext
 /blueprint

 activemq.xml:

 bean id=activemq
 class=org.apache.activemq.camel.component.ActiveMQComponent 
 property name=connectionFactory
   bean class=org.apache.activemq.ActiveMQConnectionFactory
 property name=brokerURL
 value=vm://localhost?create=falseamp;waitForStart=1 /
 property name=userName value=system/
 property name=password value=manager/
   /bean
 /property
 /bean
  service ref=activemq interface=org.apache.camel.Component/

 pom.xml:

  plugin
 groupIdorg.apache.felix/groupId
 artifactIdmaven-bundle-plugin/artifactId
 version2.3.4/version
 extensionstrue/extensions
 configuration
 manifestLocationMETA-INF/manifestLocation
 instructions

 Bundle-SymbolicName${pom.artifactId}/Bundle-SymbolicName
 Import-Package
 org.apache.activemq.camel.component,
 org.apache.camel,
 */Import-Package

 Include-Resourcesrc/main/resources/Include-Resource

 Spring-Context*;publish-context:=false;create-asynchronously:=true/Spring-Context
 Private-Package/Private-Package
 /instructions
 /configuration
   /plugin

 -Thanks


Re: How to send file

2014-04-25 Thread Aki Yoshida
when you using POST, you probably need to set the content-type header
as well so that the server can interpret the data.

you can find some examples in the online documentation of the file and
http components and you can just combine the two segments of the
configuration that fit to your requirement.

2014-04-24 11:28 GMT+02:00 a746076drdrb a746...@drdrb.net:
 Hello,

 what is the proper way to send file from folder to http endpoint?

 from(file:src/data?noop=true)
 .setHeader(Exchange.HTTP_METHOD, constant(POST))
 .to(http://example.com/upload;);

 I couldn't find any example for it











 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-to-send-file-tp5750523.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Split XML with xmlTokenizer and add root element?

2014-04-24 Thread Aki Yoshida
regarding the integration to 2.11.x, I think the code using the
current regex approach is available from 2.11.1, it should be possible
to get the patch integrated into your 2.11 copy.
if your copy was derived from 2.11.0, you have to get a bunch of classes copied.

I'll be integrating this patch down to 2.12.x and see if I already get
hit by some merging issue. If I get hit, that's a bad news for me a
good news for you because you can take my merged 2.12 patch to
integrate it into your 2.11 copy. we will see ;-)



2014-04-24 14:34 GMT+02:00 cgiera christoph.gi...@mic-cust.com:
 I see there are some changes between 2.11.0 and master regarding the
 TokenXML* classes.
 In the master version there is a new class TokenXMLExpressionIterator
 where you did your changes, in 2.11.0 which i use there is only the
 TokenXMLPairExpressionIterator.

 Maybe you can be so kind and help me patching 2.11.0?

 kind regards,
 Christoph



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Split-XML-with-xmlTokenizer-and-add-root-element-tp5750237p5750530.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AW: Split XML with xmlTokenizer and add root element?

2014-04-24 Thread Aki Yoshida
we can't have any footers because that will force the tokenizer to
parse the entire document before start splitting the tokens.


2014-04-24 14:32 GMT+02:00 arnaudeprez arnaudep...@gmail.com:
 Hi jhm,

 I agree, this kind of stuff can be very useful especially for huge file
 (otherwise we can use xslt and split combinaition).

 The problem here is how to keep the configuration of the tokenizer simple.

 For example, we can have :
 Input :
 root
 header1.../header1
 header2.../header2
 body
 data.../data
 data.../data
 /body
 footer.../footer
 /root

 Expected splitted result :

 root
 header.../header
 body
 data.../data
 /body
 footer.../footer
 /root

 root
 header.../header
 body
 data.../data
 data.../data
 /body
 footer.../footer
 /root

 We also may have a message with many headers and/or footers.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Split-XML-with-xmlTokenizer-and-add-root-element-tp5750237p5750529.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Handling soap request in http endpoint ? possible?

2014-04-24 Thread Aki Yoshida
I don't know what you mean by the soap method name. the soap action
header should be in the camel headers.
the operation name (i.e., the operations defined in the wsdl) is not
available, unless you use an endpoint that has the operation meta info
(e.g., a wsdl or a generated jaxws service class) that can determine
the operation based on the request message.

But going back to the beginning, I don't know what motivates you to
switch to camel-http to handle soap invocations.
If there is no particular reason except that you want to handle
arbitrary soap messages (e.g., payload types), you can just expose a
provider based service or use the default generic provider based
service that can take any soap requests. When using the generic
provider, you get the flexibility of taking arbitrary request messages
while using some specific web service features or error handling. Its
limitation is that you cannot determine the operation name as you are
not using the meta data.

regards, aki


2014-04-24 11:49 GMT+02:00 komal bhola komalbh...@gmail.com:
 Hi ,

 Currently I am using cxf endpoint to listen to soap requests. Actually I
 want to use http endpoint only to listen to soap requests. I need to provide
 different services on only 1 URL. So I want soap method name to be populated
 in camel headers, based on which I can call different different services.
 Please suggest a way out if any one has already tried this.

 Thanks




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Handling-soap-request-in-http-endpoint-possible-tp5750524.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Split XML with xmlTokenizer and add root element?

2014-04-24 Thread Aki Yoshida
Hi Christoph,

I verified that patch is easily integrable even down to 2.11.x but as
I mentioned, not to 2.11.0.
if you want to stay with your copy of 2.11.0, you need to get the
commit history of TokenXMLExpressionIterator and merge all those
commits on a few classes to your 2.11.0 copy.
Alternatively, make your copy from the latest 2.11.x version and just
apply the patch directly there.

regards, aki



2014-04-24 15:31 GMT+02:00 Aki Yoshida elak...@gmail.com:
 regarding the integration to 2.11.x, I think the code using the
 current regex approach is available from 2.11.1, it should be possible
 to get the patch integrated into your 2.11 copy.
 if your copy was derived from 2.11.0, you have to get a bunch of classes 
 copied.

 I'll be integrating this patch down to 2.12.x and see if I already get
 hit by some merging issue. If I get hit, that's a bad news for me a
 good news for you because you can take my merged 2.12 patch to
 integrate it into your 2.11 copy. we will see ;-)



 2014-04-24 14:34 GMT+02:00 cgiera christoph.gi...@mic-cust.com:
 I see there are some changes between 2.11.0 and master regarding the
 TokenXML* classes.
 In the master version there is a new class TokenXMLExpressionIterator
 where you did your changes, in 2.11.0 which i use there is only the
 TokenXMLPairExpressionIterator.

 Maybe you can be so kind and help me patching 2.11.0?

 kind regards,
 Christoph



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Split-XML-with-xmlTokenizer-and-add-root-element-tp5750237p5750530.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: URI encoding is giving me problems

2014-04-24 Thread Aki Yoshida
@Claus

I think there is something strange with the encoding/decoding logic,
concretely speaking, what URISupport's parseQuery does.
what I find it strange is that the query string passed from URI to the
EndpointConfiguration is already decoded, as URI decodes it.
So decoding it again when setting this value within EC as it is done
currently will double-decode %2B, no?

I don't think the RAW mode was necessary.
Also  strange and appears incorrect in this method is the way how the
raw mode is detected (i.e., the string buffer's toString is gets
repeatedly invoked).

How do you think?
regards, aki


2014-04-22 9:03 GMT+02:00  ravindra.godb...@cognizant.com:
 Claus

 Even after adding RAW the output of key still comes as RAW(+) and not only + 
 as expected.

 addParameter method of URISupport class should strip out the RAW() and just 
 retain + against passwd.

 Here is what I tried.

 EndpointConfiguration conf = 
 comp.createConfiguration(test:https://test.com?PASSWD=RAW(+));
 System.out.println(conf.getParameter(PASSWD));

 Any idea what is missing ?

 -Original Message-
 From: Claus Ibsen [mailto:claus.ib...@gmail.com]
 Sent: Tuesday, April 22, 2014 10:51 AM
 To: users@camel.apache.org
 Subject: Re: URI encoding is giving me problems

 Hi

 See this FAQ
 http://camel.apache.org/how-do-i-configure-password-options-on-camel-endpoints-without-the-value-being-encoded.html

 On Tue, Apr 22, 2014 at 6:17 AM, Stephen Cameron steve.cameron...@gmail.com 
 wrote:
 Hi,

 I have a plus (+) symbol in a parameter value that is being converted
 to a space. When I encode this as %2B it still ends up as a space in
 the parameter value.

 In fact, both %20 and %2B end up giving me spaces in the parameter value.

 The following shows the issue

 DefaultCamelContext context = new DefaultCamelContext(); MockComponent
 comp = new MockComponent(); comp.setCamelContext(context);
 EndpointConfiguration conf = comp.createConfiguration(test:
 https://test.com?secretKey=A%2B-%20A;);
 System.out.println(conf.getParmeter(secretKey));
 conf.setParameter(secretKey,A+- A);
 System.out.println(conf.getParmeter(secretKey));

 Output is:

 A - A
 A+- A

 The first should be the same as the second.

 Thanks
 Steve Cameron



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: cib...@redhat.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 hawtio: http://hawt.io/
 fabric8: http://fabric8.io/
 This e-mail and any files transmitted with it are for the sole use of the 
 intended recipient(s) and may contain confidential and privileged 
 information. If you are not the intended recipient(s), please reply to the 
 sender and destroy all copies of the original message. Any unauthorized 
 review, use, disclosure, dissemination, forwarding, printing or copying of 
 this email, and/or any action taken in reliance on the contents of this 
 e-mail is strictly prohibited and may be unlawful.


Re: Split XML with xmlTokenizer and add root element?

2014-04-23 Thread Aki Yoshida
hi,
I just filed CAMEL-7388 and committed the change. (only in master at the moment)

This enclosing/wrapping mode gets enabled with the
inheritNamespaceToken property is set to *.
One might say, I am misusing the inheritNamespaceToken property to
provide this extra option.

But this actually fits nicely, as this property will become useless
under the root enclosing/wrapping mode and so using this property
name to configure this mode is a benefit of not needing to introduce
another property that can semantically conflict with the
inheritNamespaceToken property.

Let me know if you dislike this configuration option.
thanks
regards, aki

2014-04-23 9:34 GMT+02:00 Claus Ibsen claus.ib...@gmail.com:
 On Fri, Apr 18, 2014 at 9:11 AM, cgiera christoph.gi...@mic-cust.com wrote:
 Hi all,

 should we create a camel jira issue for this?


 Yeah fell free to log a JIRA ticket. And as always contributions is welcome
 http://camel.apache.org/contributing

 kind regards,
 Christoph



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Split-XML-with-xmlTokenizer-and-add-root-element-tp5750237p5750360.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: cib...@redhat.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 hawtio: http://hawt.io/
 fabric8: http://fabric8.io/


Re: Split XML with xmlTokenizer and add root element?

2014-04-23 Thread Aki Yoshida
as it seems the corresponding source files have not been linked to the
jira ticket,

you can find examples/test cases at:

https://git-wip-us.apache.org/repos/asf?p=camel.git;a=tree;f=camel-core/src/test/java/org/apache/camel/language/tokenizer;h=72c5debe203cc31f7cd0a7e369c162b721c7308d;hb=01d587525f937b3135791f1c1d100909b245382a

 
camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeWrapLanguageTest.java


2014-04-23 10:25 GMT+02:00 Aki Yoshida elak...@gmail.com:
 hi,
 I just filed CAMEL-7388 and committed the change. (only in master at the 
 moment)

 This enclosing/wrapping mode gets enabled with the
 inheritNamespaceToken property is set to *.
 One might say, I am misusing the inheritNamespaceToken property to
 provide this extra option.

 But this actually fits nicely, as this property will become useless
 under the root enclosing/wrapping mode and so using this property
 name to configure this mode is a benefit of not needing to introduce
 another property that can semantically conflict with the
 inheritNamespaceToken property.

 Let me know if you dislike this configuration option.
 thanks
 regards, aki

 2014-04-23 9:34 GMT+02:00 Claus Ibsen claus.ib...@gmail.com:
 On Fri, Apr 18, 2014 at 9:11 AM, cgiera christoph.gi...@mic-cust.com wrote:
 Hi all,

 should we create a camel jira issue for this?


 Yeah fell free to log a JIRA ticket. And as always contributions is welcome
 http://camel.apache.org/contributing

 kind regards,
 Christoph



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Split-XML-with-xmlTokenizer-and-add-root-element-tp5750237p5750360.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: cib...@redhat.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 hawtio: http://hawt.io/
 fabric8: http://fabric8.io/


Re: Split XML with xmlTokenizer and add root element?

2014-04-15 Thread Aki Yoshida
I think you are right.
currently, the result is a series of child elements and the parent
context information is not included in the result (except the
namespace binding information that can be extracted into the split
child elements).

When I pushed the current implementation, I had the code sitting
around in my repo to add such options of either wrapping the child
with the its parent container part or set the parent container part in
a separate header. But I didn't push that part, as I was not sure
about whether this was useful (I mean, to be included directly in the
splitter, as opposed to have this parent extraction step separately)
and how to expose the configuration parameter for it.

Probably including the extraction in the splitter is a good idea. I'll
look at it again.
regards, aki



2014-04-15 12:04 GMT+02:00 cgiera christoph.gi...@mic-cust.com:
 Hello,

 I have to deal with large xml data in our camel application. In the camel
 documentation I've found the splitting with the
 xmltokenizer(split().xmlTokenize(tag)).
 First it looked fine for me, but then I noticed that there is no possibility
 to add the root element to the splitted xml's.

 Xml looks like this:
 root
   tosplit
   /tosplit
   tosplit
   /tosplit
   tosplit
   /tosplit
   tosplit
   /tosplit
 ...
 /root

 Output of xmltokenize(tosplit):
 1. xml:
 tosplit
 /tosplit
 2. xml:
 tosplit
 /tosplit
 ...

 Output needed:
 1. xml:
 root
   tosplit
   /tosplit
 root
 2. xml:
 root
   tosplit
   /tosplit
 root
 ...

 Maybe I missed something in the camel docu, is there a way in camel to get
 the output from above?
 Perhaps I can use something other than the xmltokenizer?

 kind regards,
 Christoph




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Split-XML-with-xmlTokenizer-and-add-root-element-tp5750237.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to consume a Rest Web Service passing through a proxy server

2014-03-12 Thread Aki Yoshida
If you are using the cxf component, you will need to configure the
client setting in the cxf component.
Here is the link:
https://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-Theclientelement

regards, aki

2014-03-12 20:02 GMT+01:00 Fernando Cesar da Silva fsi...@synchro.com.br:
 Hi,

 I'm using CXFRS Component to consume a Rest Web Service and everything is 
 working fine so far.

 Now I have to make the connection go through a proxy server.

 Using the HTTP Component, I have explicitly set the proxy in CamelContext and 
 the connection reach the proxy as expected, but the CXFRS Component seems to 
 ignore these settings.





 CamelContext context = obterCamelContext()
 context.getProperties().put(http.proxyHost,cavmtapp99)
 context.getProperties().put(http.proxyPort,3128)




 How / where could I set my proxy host and port to the CXFRS Component?




 Thanks!
 Fernando Cesar



Re: NullPointerException in FileInputStreamCache

2014-02-13 Thread Aki Yoshida
it looks life the stream has been closed and thus destroyed but it was re-used.

For the dev community, I think camel's CachedOutputStream is hard to
use as it targets for a single owner usage compared to cxf's one which
does reference counting for opened connections to support multiple
threads reading from the stream. Maybe we should consider creating a
common one to be used by both projects and later putting it into
commons-ii or somewhere?

regards, aki

2014-02-13 5:03 GMT+01:00 Rural Hunter ruralhun...@gmail.com:
 Hi,

 I'm using Camel 2.12.2 and enabled stream caching with this code:
 context.setStreamCaching(true);

 Sometimes I got NullPointerException related to stream cache:

 Stacktrace
 ---
 java.lang.NullPointerException
 at
 org.apache.camel.converter.stream.FileInputStreamCache.init(FileInputStreamCache.java:52)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.converter.stream.CachedOutputStream.newStreamCache(CachedOutputStream.java:199)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:79)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:103)[camel-jms-2.12.2.jar:2.12.2]
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
 at
 org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1103)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
 at
 org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1095)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
 at
 org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:992)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_51]
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_51]
 at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
 2014-02-13 11:56:56 WARN Camel (camel-1) thread #0 -
 JmsConsumer[com.test.letter]
 org.apache.camel.component.jms.EndpointMessageListener - Execution of JMS
 message listener failed. Caused by: [org.apache.camel.RuntimeCamelException
 - java.lang.NullPointerException]
 org.apache.camel.RuntimeCamelException: java.lang.NullPointerException
 at
 org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1352)[camel-core-2.12.2.jar:2.12.2]
 at
 org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:186)[camel-jms-2.12.2.jar:2.12.2]
 at
 org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:107)[camel-jms-2.12.2.jar:2.12.2]
 at
 

Re: How to return null element with Camel-CXF

2014-02-13 Thread Aki Yoshida
I'm not sure if it is valid to return a null for that POJO
request-response web service that you have.
If you had a generic provider based request-response interface
(javax.xml.ws.Provider), you can return a null to dynamically simulate
oneway invocations. But I'm not sure about the POJO case...

2014-02-12 16:57 GMT+01:00 Chubutin ramp...@gmail.com:
 My new route with the fix is

 .choice()
 .when().simple(${in.body} contains 'vessel')
 .unmarshal(getJaxbDataFormat())
 .otherwise()
 .process(new Processor() {

 @Override
 public void process(Exchange 
 exchange) throws Exception {
 ListVesselVisitor body = 
 new ArrayListVesselVisitor();
 body.add(null);
 
 exchange.getOut().setBody(body);
 }
 })
 .endChoice()


 I know this is not performant, but It's a solution



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-to-return-null-element-with-Camel-CXF-tp5747194p5747196.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Customize http ports change /cxf to / for different services hosted on Fuse container

2014-02-11 Thread Aki Yoshida
If no other services are running under different context at the same
port, can you just set the cxf's servlet context to / to make the
cxf services accessible at that root path context?

2014-02-10 22:25 GMT+01:00 lkrao31 lavin.koruka...@broadridge.com:
 Hello All,

 We have a requirement where in we have multiple services deployed on our
 container and these containers are in a cluster spread across different
 hosts.

 Below is our Infra design

 It has 2 hosts which have fuse software instlled. ssh is not available
 between the 2 nor is internet access. all containers created are children of
 either host.

 Fuse ESB Version 6 and patch 5

 * All containers on same version
 * seprate profile for web service
 * 3 jvms (2 root and one extra on server2) for ensemble cluster. These will
 not host any applications. They are purely meant for zookeeper registry.
  * Camel/cxf fabs to be deployed in web service profile
 * 2 jvms/containers for web services(one on each host)
 * Setup custom port for webservice 9001.


 We thought of achieving load balancing via a load balancer. ie create a vip
 for the 2 service endpoints. CSS being the load balancer.

 Services are supposed to be deployed in 2 containers with the following
 configs:

 Web-Service-1 URL =http://ip1:9001/contexrtoor1
 Web-Service-1 URL=http://ip2:9001/contextroot1


 Web-Service-2 URL =http://ip1:9001/contexrtoor2
 Web-Service-2 URL=http://ip2:9001/contextroot2


 The web service would be called by the consumers by using a loadbalancer VIP

 http://vip/contexroot1 and
 http://vip/contextroot2

 We were able to cusmtomize the http ports by installing the cxf feature and
 pax web server and we have addded a custom filed in the file
 org.ops4j.pax.web.properties  as org.osgi.service.http.port=9001 now our
 container is binded to 9001 but the issue is our web-service ends points are
 only accessible as


 Web-Service-1 URL =http://ip1:9001/cxf/contexrtoor1
 Web-Service-1 URL=http://ip2:9001/cxf/contextroot1


 Web-Service-2 URL =http://ip1:9001/cxf/contexrtoor2
 Web-Service-2 URL=http://ip2:9001/cxf/contextroot2

 http://vip/cxf/contexroot1 and
 http://vip/cxf/contextroot2

 if we remove '/cxf' from the context root is trowing a 404 error and this is
 not acceptable by the dev because as per the design they want the consumers
 to access their services as

 http://vip/contexroot1 and
 http://vip/contextroot2

 I know that one solution will be  to

 Add org.apache.cxf.osgi.cfg  file into $FUSE _ESB/etc/ folder, add an
 entry
 org.apache.cxf.servlet.context=/mycontext

 but my doing that it is always explicitly set to only one service , and for
 the consumers to access other service again they should have to go through

 Web-Service-2 URL =http://ip1:9001/contestroot1/contexrtoor2 , which is not
 desired by our architecture team since in future they could be many services
 running on this container and each service should have to be independently
 accessed.



 Please kindly guide me on how to achieve this.

 Thanks



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Customize-http-ports-change-cxf-to-for-different-services-hosted-on-Fuse-container-tp5747052.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: error when invoking service in camel (java.lang.NoSuchMethodError: org.apache.cxf.message.Exchange.getBindingOperationInfo()Lorg/apache/cxf/service/model/BindingOperationInfo) through soap ui)

2013-12-18 Thread Aki Yoshida
it looks like you have some very old cxf library on your tomcat, which
is picked up instead of the one intended.

Can you verify which jars are deployed and make sure the deployed cxf
jars are consistent?

regards, aki




2013/12/18 reena upadhyay reena2...@outlook.com:
 I have a web application deployed on Tomcat container. I have created a route 
 in camel. When I am trying to invoke the webservice through soap UI. I get 
 following error:

 soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;
soap:Body
   soap:Fault
  faultcodesoap:Server/faultcode


 faultstringorg.apache.cxf.message.Exchange.getBindingOperationInfo()Lorg/apache/cxf/service/model/BindingOperationInfo;/faultstring
   /soap:Fault
/soap:Body
 /soap:Envelope

 I am trying to run the sample example taken from site:


 http://10-99.blogspot.in/2011/03/camel-and-cxf-integration-use-cases.html

 I am able to invoke the service through soap ui when the war is deployed on 
 jetty container, but if I deploy the war on tomcat I get the mentioned error.


 On Tomcat console I am able to see below error, When I make request to a 
 service through SOAP UI:

 WARNING: Interceptor has thrown exception, unwinding now
 org.apache.cxf.interceptor.Fault: 
 org.apache.cxf.message.Exchange.getBindingOperationInfo()Lorg/apache/cxf/service/model/BindingOperationInfo;
 at 
 org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:115)
 at 
 org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
 at 
 org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
 at 
 org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)
 at 
 org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:452)
 at 
 org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:196)
 at 
 org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:220)
 at 
 org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:153)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
 at 
 org.apache.cxf.transport.servlet.AbstractCXFServlet.service(AbstractCXFServlet.java:211)
 at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
 at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
 at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
 at 
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
 at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
 at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
 at 
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
 at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
 at 
 org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:261)
 at 
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
 at 
 org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1773)
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:724)
 Caused by: java.lang.NoSuchMethodError: 
 org.apache.cxf.message.Exchange.getBindingOperationInfo()Lorg/apache/cxf/service/model/BindingOperationInfo;



Re: GsonDataFormat.java mashaling/unmarshaling problem

2013-12-06 Thread Aki Yoshida
this issue has been fixed in 2.12.2 with
https://issues.apache.org/jira/browse/CAMEL-6873

the charset name will be taken from the charset name property
(Excahnge.CHARSET_NAME) of the exchange.

regards, aki

2013/12/6 차정호 jh...@barunmo.com:
 Dear Camel developers.



 I have tested json marshaling / unmarshaling with gson library,

 and found there was charset assignment missing

 at org.apache.camel.component.gson.GsonDataFormat.java

 in Camel version 2.12.0



 The marshal and unmarshal methods should create a stream writer or reader
 with the charset UTF-8”.

 If not, Gson fails when unmarshaling non ascii character json stream like
 {“name”: “차”}.

 This is the exception.

 com.google.gson.JsonSyntaxException:
 com.google.gson.stream.MalformedJsonException: Unterminated string at line
 1 column 14

at com.google.gson.Gson.fromJson(Gson.java:818)

at com.google.gson.Gson.fromJson(Gson.java:741)

at
 org.apache.camel.component.gson.GsonDataFormat.unmarshal(GsonDataFormat.java
 :105)

 …



 So I suggest that GsonDataFormat.java be modified to have the charset
 assignment part like below.

…

public void marshal(Exchange exchange, Object graph,
 OutputStream stream) throws Exception {

  BufferedWriter writer = IOHelper.buffered(new
 OutputStreamWriter(stream, UTF-8)); // - modify here, please

  gsontoJson(graph, writer);

  writer.close();

}



…

public Object unmarshal(Exchange exchange, InputStream stream)
 throws Exception {

  BufferedReader reader = IOHelper.buffered(new
 InputStreamReader(stream, UTF-8)); // - modify here, please

  Object result = gson.fromJson(reader,
 this.unmarshalType);

 reader.close();

 return result;

 }

 See https://sites.google.com/site/gson/streaming



 Maybe I have misunderstood this, but check it please.



 Thanks.





null expression for setting body to null?

2013-11-18 Thread Aki Yoshida
I would like to set the body to null using xml and would like do
something as simple as
setBodysimple${null}/simple/setBody

I experimented with this idea and added this null-expression to the
simple expression builder so that this expression works.

But I was not sure if there is already another way to do this without
introducing this expression. I know a workaround to set the body to
null by using something non-existent (e.g., ${header.ugly}), but that
is ugly.

So if there is no other way, I would like to add this simple
expression to camel.

regards, aki


Re: null expression for setting body to null?

2013-11-18 Thread Aki Yoshida
One use case is for a request-response scenario using a jaxws provider
(at camel-cosnumer) and when you want to return a null to this
endpoint so that it can return an HTTP 202 response to the caller
instead of returning some xml data which was in the body (i.e., using
the rule described in jaws spec)

Jaxws spec
5.1.1 Invocation
A Provider based service instance’s invoke method is called for each
message received for the service.
When an invoke method returns null, it is considered that no response
needs to be sent by service.

regards, aki


2013/11/18 Claus Ibsen claus.ib...@gmail.com:
 What is the use-case for setting the body as null ?

 On Mon, Nov 18, 2013 at 11:59 AM, Aki Yoshida elak...@gmail.com wrote:
 I would like to set the body to null using xml and would like do
 something as simple as
 setBodysimple${null}/simple/setBody

 I experimented with this idea and added this null-expression to the
 simple expression builder so that this expression works.

 But I was not sure if there is already another way to do this without
 introducing this expression. I know a workaround to set the body to
 null by using something non-existent (e.g., ${header.ugly}), but that
 is ugly.

 So if there is no other way, I would like to add this simple
 expression to camel.

 regards, aki



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: cib...@redhat.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen


Re: null expression for setting body to null?

2013-11-18 Thread Aki Yoshida
hi claus,
thanks.
regards, aki

2013/11/18 Claus Ibsen claus.ib...@gmail.com:
 Hi

 Yeah we could add that ${null} function to the simple language.
 Then we dont introduce a new DSL which likely is overkill for a not so
 often use-case.



 On Mon, Nov 18, 2013 at 2:35 PM, Aki Yoshida elak...@gmail.com wrote:
 One use case is for a request-response scenario using a jaxws provider
 (at camel-cosnumer) and when you want to return a null to this
 endpoint so that it can return an HTTP 202 response to the caller
 instead of returning some xml data which was in the body (i.e., using
 the rule described in jaws spec)

 Jaxws spec
 5.1.1 Invocation
 A Provider based service instance’s invoke method is called for each
 message received for the service.
 When an invoke method returns null, it is considered that no response
 needs to be sent by service.

 regards, aki


 2013/11/18 Claus Ibsen claus.ib...@gmail.com:
 What is the use-case for setting the body as null ?

 On Mon, Nov 18, 2013 at 11:59 AM, Aki Yoshida elak...@gmail.com wrote:
 I would like to set the body to null using xml and would like do
 something as simple as
 setBodysimple${null}/simple/setBody

 I experimented with this idea and added this null-expression to the
 simple expression builder so that this expression works.

 But I was not sure if there is already another way to do this without
 introducing this expression. I know a workaround to set the body to
 null by using something non-existent (e.g., ${header.ugly}), but that
 is ugly.

 So if there is no other way, I would like to add this simple
 expression to camel.

 regards, aki



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: cib...@redhat.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: cib...@redhat.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen


Re: Namespace list - blueprint - xpath

2013-11-04 Thread Aki Yoshida
I don't know what you are trying to do actually after reading your response.

If what you want to do is to pick up the node
/ns0:userResponse/User/id where prefix ns0 is mapped to a certain
namespace uri which you know, say urn:whichiknow you can just set it
in the map using an arbitrary prefix like ns9=urn:whichiknow and look
up the node /ns9:userResponse/User/id.

regards, aki

2013/11/1 Nurali Techie nurali.tec...@yahoo.com:
 Hi All,

 I have got the solution .. :)

 I have used xpath expression to get all namespace.  Here is the part of
 code:

 String searchAllNamespacesXpathExpr = //namespace::*;// xpath
 expr to search all namespace
 XPathExpression nsXpath = new
 XPathExpression(searchAllNamespacesXpathExpr);
 nsXpath.setResultType(NodeList.class);
 NodeList nsNodeList = (NodeList) nsXpath.evaluate(exchange,
 Object.class);  // this NodeList contains all namespaces

 From NodeList object, I prepare namespace Map which I set to XpathExpression
 object.

 XPathExpression xpathExprObj = new
 XPathExpression(/ns0:userResponse/User/id));
 xpathExprObj.setNamespaces(namespaceMap); // set namespace Map
 which was prepared from NodeList
 xpathExprObj.setResultType(String.class);
 Object result = xpathExprObj.evaluate(exchange, Object.class);

 Now, xpath with namespace (i.e /ns0:userResponse/User/id) will be evaluated
 correctly.

 Thanks Aki and All for you help.

 Let me know; in case you see any flaw in above way.

 Cheers,
 Nurali


 On Friday, November 1, 2013 2:50 PM, Nurali Techie nurali.tec...@yahoo.com
 wrote:
 Thanks Aki for your thoughts ..

 Yes, I should call setNamespaces() .. but I need namespace Map which I can
 pass to ..
 So, my question remain same .. is there any API or service .. which I can
 use to get Namespace Map ..
 And I hv Camel Exchange and Camel Endpoint object with me ..

 Parsing blueprint beans.xml and to extract Namespace from blueprint tag;
 looks hack and dirty way ..
 Also, I don't know how can I get beans.xml InputStream to parse for ..

 I also debugged and found that .. for standard xpath tag having namespace
 xpath in beans.xml .. the blueprint container do magic to pass all namespace
 while creating xpath expression object.  It means; namespace list is with
 blueprint container .. but I don't know how I can reached to there when I
 only have Camel Exchange and Endpoint object with me.

 Thanks,
 Nurali



 On Thursday, October 31, 2013 9:24 PM, Aki Yoshida elak...@gmail.com
 wrote:

 for the first part of the question, maybe you forgot the set the
 namespace context (the prefix-nsuri map) in the expression?

 setNamespaces(MapString,String namespaces)

 for the second part, you probably need to parse the file that will
 scan all the namespaces declared and you will see them in the
 corresponding namespace declaration handler.


 2013/10/31 Nurali Techie nurali.tec...@yahoo.com:
 Hi Friends,

 I want to execute xpath in my code.  It means; I have xpath expression, I
 have exchange object with In Message.

 Using 'XPathExpression' and 'XPathBuilder' classes; I succeed to do so.
 Below is the code snippet.

 XPathExpression xpathExprObj = new
 XPathExpression(/userResponse/User/id);
 xpathExprObj.setResultType(String.class);

 Object result = xpathExprObj.evaluate(exchange, Object.class);

 But, if I have xpath with namespace (i.e xpath =
 /ns0:userResponse/User/id).. above code throwing exception .. saying -
 Prefix must resolve to a namespace: ns0

 Part of Exception:

 org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath:
 /ns0:userResponse/User/id. Reason: javax.xml.xpath.XPathExpressionException
 at
 org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:767)
 ~[bundlefile:2.11.2-sap-02]
 at
 org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:748)
 ~[bundlefile:2.11.2-sap-02]
 at
 org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:168)
 ~[bundlefile:2.11.2-sap-02]
 at *** My project code calling from here ..
 ..
 ---
 Caused by:
 com.sun.org.apache.xpath.internal.domapi.XPathStylesheetDOM3Exception:
 Prefix must resolve to a namespace: ns0
 at
 com.sun.org.apache.xpath.internal.compiler.XPathParser.errorForDOM3(XPathParser.java:653)
 ~[na:1.6.0_33]
 at
 com.sun.org.apache.xpath.internal.compiler.Lexer.mapNSTokens(Lexer.java:638)
 ~[na:1.6.0_33]
 at
 com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:265)
 ~[na:1.6.0_33]
 at
 com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:96)
 ~[na:1.6.0_33]
 at
 com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(XPathParser.java:110)
 ~[na:1.6.0_33]
 at com.sun.org.apache.xpath.internal.XPath.init(XPath.java:176)
 ~[na:1.6.0_33]
 at com.sun.org.apache.xpath.internal.XPath.init(XPath.java:264)
 ~[na:1.6.0_33]
 at
 com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:385)
 ~[na:1.6.0_33

Re: Namespace list - blueprint - xpath

2013-10-31 Thread Aki Yoshida
for the first part of the question, maybe you forgot the set the
namespace context (the prefix-nsuri map) in the expression?

setNamespaces(MapString,String namespaces)

for the second part, you probably need to parse the file that will
scan all the namespaces declared and you will see them in the
corresponding namespace declaration handler.

2013/10/31 Nurali Techie nurali.tec...@yahoo.com:
 Hi Friends,

 I want to execute xpath in my code.  It means; I have xpath expression, I 
 have exchange object with In Message.

 Using 'XPathExpression' and 'XPathBuilder' classes; I succeed to do so.  
 Below is the code snippet.

 XPathExpression xpathExprObj = new 
 XPathExpression(/userResponse/User/id);
 xpathExprObj.setResultType(String.class);

 Object result = xpathExprObj.evaluate(exchange, Object.class);

 But, if I have xpath with namespace (i.e xpath = /ns0:userResponse/User/id).. 
 above code throwing exception .. saying - Prefix must resolve to a namespace: 
 ns0

 Part of Exception:

 org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath: 
 /ns0:userResponse/User/id. Reason: javax.xml.xpath.XPathExpressionException
 at 
 org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:767) 
 ~[bundlefile:2.11.2-sap-02]
 at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:748) 
 ~[bundlefile:2.11.2-sap-02]
 at org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:168) 
 ~[bundlefile:2.11.2-sap-02]
 at *** My project code calling from here ..
 ..
 ---
 Caused by: 
 com.sun.org.apache.xpath.internal.domapi.XPathStylesheetDOM3Exception: Prefix 
 must resolve to a namespace: ns0
 at 
 com.sun.org.apache.xpath.internal.compiler.XPathParser.errorForDOM3(XPathParser.java:653)
  ~[na:1.6.0_33]
 at 
 com.sun.org.apache.xpath.internal.compiler.Lexer.mapNSTokens(Lexer.java:638) 
 ~[na:1.6.0_33]
 at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:265) 
 ~[na:1.6.0_33]
 at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:96) 
 ~[na:1.6.0_33]
 at 
 com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(XPathParser.java:110)
  ~[na:1.6.0_33]
 at com.sun.org.apache.xpath.internal.XPath.init(XPath.java:176) 
 ~[na:1.6.0_33]
 at com.sun.org.apache.xpath.internal.XPath.init(XPath.java:264) 
 ~[na:1.6.0_33]
 at 
 com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:385) 
 ~[na:1.6.0_33]

 Upon digging; I found that .. I need to set namespaces to XPathExpression 
 object .. So, I need list of all namespace.
 I am using blueprint beans.xml .. so I need list of all namespaces defined 
 with blueprint tag in beans.xml.

 I have camel exchange and camel endpoint object with me.
 I want programmatic solution.

 Thanks,
 Nurali


Re: cxf proxy

2013-10-30 Thread Aki Yoshida
you need to create a response soap message and set to it to the camel
message body. Basically, this is the reverse operation of what you are
doing in your processor that reads the soap message from the camel's
message body.



2013/10/24 cbuxbaum cbuxb...@tradestonesoftware.com:
 Hi all,

 I have successfully implemented a proxy web service, and now have another
 question.

 If I expose my proxy web service, and then use Camel Processors to do some
 processing of the input like using the input xml to make  Web Service calls
 (outside of the cxf context), is there a simple way of attaching the result
 to the outbound CXF message?  Basically, I want to get my response and then
 wrap it in whatever CXF needs to be understood.  Here is my example route,
 wherte I have commented out the CXF bean to call the real webservice, and am
 instead using my getquotewebserviceClient to make a WS post end retrieve the
 response.  Now I want to return that response in the context of CXF.:


   camelContext xmlns=http://camel.apache.org/schema/spring;
 endpoint id=callRealWebService
 uri={{webserviceproxy.realwsurl}}?throwExceptionOnFailure=false/

 route

   from uri=cxf:bean:webserviceProxy?dataFormat=MESSAGE/

   to uri=log:input/
   to uri=bean:filterRequest/

   process ref=getquotewebServiceClient/


   to uri=log:output/
 /route
   /camelContext

 Thanks,

 Carl



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/cxf-proxy-tp5742132.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: cxf:bean vs. cxfbean: ?

2013-09-16 Thread Aki Yoshida
hi,
the names are confusing but they are doing two different things.

cxf:bean  is for receiving a message (e.g. soap) and processing it in
the camel route or sending a message to an external service.

cxfbean is for hosting a cxf service and invoking it from the camel route.

regards, aki


2013/9/15 Christian Müller christian.muel...@gmail.com:
 We have both:
 http://camel.apache.org/cxf.html
 http://camel.apache.org/cxf-bean-component.html

 Not sure whether the second one provides additional/other features than the
 first one...

 Best,
 Christian
 -

 Software Integration Specialist

 Apache Camel committer: https://camel.apache.org/team
 V.P. Apache Camel: https://www.apache.org/foundation/
 Apache Member: https://www.apache.org/foundation/members.html

 https://www.linkedin.com/pub/christian-mueller/11/551/642


 On Sun, Sep 15, 2013 at 5:45 AM, Robert James Liguori 
 glies...@yahoo.comwrote:

 Is it cxf:bean (http://camel.apache.org/components.html)


 or

 cxfbean: (http://camel.apache.org/cxf-bean-component.html)
 ?


Re: org.apache.cxf.binding.soap.SoapFault: Can't find the BindingOperationInfo with operation name

2013-09-13 Thread Aki Yoshida
since you are using the generic dispatch/provider mode for the cxf
endpoints, you will need to set the target operation name in the route
(or as the default operation at the endpoint).

set headers
operationNamespace to http://camel.apache.org/cxf/jaxws/dispatch;
and
operationName to Invoke.

or set these as default operation names (see camel-dxf endpoint
configuration page).

and depending on your camel-version, the MESSAGE mode may not be
working at the jaxws-provider (i.e., at the camel-cxf consumer side)
and also for the cxf interceptor handling at the camel-producer side.
So, I would suggest you to use the PAYLOAD mode.

regarding the default operation remark, I think we could add this
setting automatically when the endpoint is configured using the
dispatcher mode. we can think about that.

regards, aki

2013/9/13 hutao1 279125...@qq.com:
 stacktrace:
 javax.xml.ws.soap.SOAPFaultException: Can't find the BindingOperationInfo
 with operation name
 {http://www.ibsplc.com/iloyal/member/authenticatemember/wsdl}authenticateMember.
 Please check the message headers of operationName and operationNamespace.
 at 
 org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)
 at $Proxy70.authenticateMember(Unknown Source)
 at org.member.test.memberTest.runTest(memberTest.java:200)
 at org.member.test.memberTest.testReportIncident(memberTest.java:147)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
 at
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
 at
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
 at
 org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
 at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
 at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
 at
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
 at
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
 at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
 Caused by: org.apache.cxf.binding.soap.SoapFault: Can't find the
 BindingOperationInfo with operation name
 {http://www.ibsplc.com/iloyal/member/authenticatemember/wsdl}authenticateMember.
 Please check the message headers of operationName and operationNamespace.
 at
 org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)
 at
 org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
 at
 org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
 at
 org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
 at
 org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
 at
 org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
 at
 org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
 at
 org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
 at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:811)
 at
 org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1694)
 at
 org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1530)
 at
 

Re: WSDL-error

2013-09-12 Thread Aki Yoshida
you can check if the wsdl file is in the reported path  D:\Program
Files\fuse-esb-full-7.1.0.fuse-047\fuse-esb-7.
1.0.fuse-047\wsdl\SI_ID52_MaterialConsumption_async_outService3.wsdl


and it's probably not there, so either you need to put it there or
change the path to point to where the wsdl file actually resides.


2013/8/30 mahii.in87 mahesh.so...@wipro.com:

 Hi

 When i replaced the wsdl i am getting the following error.I replaced the
 wsdl SI_ID52_MaterialConsumption_async_outService3 with
 SI_ID52_MaterialConsumption_async_outService.I changed the path in pom
 also.but error is thorwing. Can anyone help me in this.

 javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem
 parsing 'wsdl/SI_ID52_MaterialConsum
 ption_async_outService3.wsdl'.: java.io.FileNotFoundException: D:\Program
 Files\fuse-esb-full-7.1.0.fuse-047\fuse-esb-7.
 1.0.fuse-047\wsdl\SI_ID52_MaterialConsumption_async_outService3.wsdl (The
 system cannot find the path specified)
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown
 Source)[171:org.apache.servicemix.bundles.wsdl4j:1.6.2.6]
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown
 Source)[171:org.apache.servicemix.bundles.wsdl4j:1.6.2.6]
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown
 Source)[171:org.apache.servicemix.bundles.wsdl4j:1.6.2.6]
at
 org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:249)[168:org.apache.cxf.cxf-rt-core:
 2.6.0.fuse-71-047]
at
 org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:192)[168:org.apache.cxf.cxf-rt-core:2
 .6.0.fuse-71-047]
at
 org.apache.cxf.wsdl11.WSDLServiceFactory.init(WSDLServiceFactory.java:92)[168:org.apache.cxf.cxf-rt-core:2.6
 .0.fuse-71-047]
... 32 more



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/WSDL-error-tp5738304.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Jetty or CXF Http:Conduit for SSL?

2013-08-26 Thread Aki Yoshida
have you verified by which certificate your service provider (SAP
PI)'s certificate is signed and if this certificate is in your
truststore? I think it's not in there, so the cxf client can't verify
the provider's certificate.



2013/8/26 contactreji contactr...@gmail.com:
 hi Bharath

 its as follows
 http:conduit
 
 name={urn:outotec:pi:mes:id56:CopperRecovery}.HTTPS_Port.http-conduit

 http:tlsClientParameters

 sec:keyManagers keyPassword=fuseesb
 sec:keyStore type=JKS password=fuseesb
 resource=certs/keystore.jks /
 /sec:keyManagers
 sec:trustManagers
 sec:keyStore type=JKS password=fuse
 resource=certs/truststore.jks /
 /sec:trustManagers


 sec:cipherSuitesFilter

 sec:include.*_EXPORT_.*/sec:include
 sec:include.*_EXPORT1024_.*/sec:include
 sec:include.*_WITH_DES_.*/sec:include
 sec:include.*_WITH_AES_.*/sec:include
 sec:include.*_WITH_NULL_.*/sec:include
 sec:exclude.*_DH_anon_.*/sec:exclude
 /sec:cipherSuitesFilter
 /http:tlsClientParameters

 http:client AutoRedirect=true Connection=Keep-Alive /

 /http:conduit

 I am getting following exception
 *
 Caused by: javax.net.ssl.SSLHandshakeException: SSLHandshakeException
 invoking
 https://ascsq14:8105/XISOAPAdapter/MessageServlet?senderParty=senderService=BS_Q_MES_MiheevskyreceiverParty=receiverService=interface=SI_ID56_CopperRecovery_async_outinterfaceNamespace=urn:outotec:pi:mes:id56:CopperRecovery:
 sun.security.validator.ValidatorException: PKIX path building failed:
 sun.security.provider.certpath.SunCertPathBuilderException: unable to find
 valid certification path to requested target
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)[:1.6.0_45]
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
 Source)[:1.6.0_45]
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
 Source)[:1.6.0_45]
 at java.lang.reflect.Constructor.newInstance(Unknown 
 Source)[:1.6.0_45]
 at
 org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1467)[178:org.apache.cxf.cxf-rt-transports-http:2.6.0.fuse-71-047]
 at
 org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1452)[178:org.apache.cxf.cxf-rt-transports-http:2.6.0.fuse-71-047]
 at
 org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
 at
 org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:660)[178:org.apache.cxf.cxf-rt-transports-http:2.6.0.fuse-71-047]
 at
 org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)[169:org.apache.cxf.cxf-api:2.6.0.fuse-71-047]
 ... 65 more
 Caused by: javax.net.ssl.SSLHandshakeException:
 sun.security.validator.ValidatorException: PKIX path building failed:
 sun.security.provider.certpath.SunCertPathBuilderException: unable to find
 valid certification path to requested target
 at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown
 Source)[:1.6]
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown 
 Source)[:1.6]
 at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown 
 Source)[:1.6]
 at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown 
 Source)[:1.6]
 at 
 com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown
 Source)[:1.6]
 at 
 com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
 Source)[:1.6]
 at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown
 Source)[:1.6]
 at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown
 Source)[:1.6]
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown
 Source)[:1.6]
 at
 com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
 Source)[:1.6]
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown
 Source)[:1.6]
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown
 Source)[:1.6]
 at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown
 Source)[:1.6]
 at
 sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown
 Source)[:1.6]
 at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown
 Source)[:1.6.0_45]
 at
 sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown
 

Re: Can't find the BindingOperationInfo with operation name

2013-08-13 Thread Aki Yoshida
how the operations are exactly defined in your wsdl?
I suppose the operation name is not defined as serviceOperation so
it is not found under this name.


2013/8/9 clarkcb clar...@gmail.com:
 Hello,
 I'm trying to access a remote web service, and getting stuck at the point
 where I get a BindingOperationInfo error:
 
 15:23:56.831 [main] ERROR o.a.c.processor.DefaultErrorHandler - Failed
 delivery for (MessageId: ID-neptune-local-51487-1376000635460-0-1 on
 ExchangeId: ID-neptune-local-51487-1376000635460-0-2). Exhausted after
 delivery attempt: 1 caught: java.lang.IllegalArgumentException: *Can't find
 the BindingOperationInfo with operation name
 {http://remote.service.com/}serviceOperation. Please check the message
 headers of operationName and operationNamespace.*
 java.lang.IllegalArgumentException: Can't find the BindingOperationInfo with
 operation name {http://remote.service.com/}serviceOperation. Please check
 the message headers of operationName and operationNamespace.
 
 Header operationName is set to serviceOperation.
 I have tried not setting the operationNamespace header, also setting it to
 namespace defined in the wsdl (http://remote.service.com/;), also setting
 to empty string. I get basically the same error with each.
 Do I need to set operationNamespace to something else? I would have thought
 it would be the same as for serviceName and portName. Or is this not the
 problem?
 Here's the relevant part of my camel-cxf.xml (note the xmlns:ns namespace
 definition):
 
 lt;beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:cxf=http://camel.apache.org/schema/cxf;
 xmlns:ns=http://remote.service.com/;
 xsi:schemaLocation=http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
 http://camel.apache.org/schema/cxf
 http://camel.apache.org/schema/cxf/camel-cxf.xsdgt;  lt;import
 resource=classpath:META-INF/cxf/cxf.xml/gt;  lt;!-- endpoint definition
 for remote service --gt;  lt;cxf:cxfEndpoint id=remoteService
 address=http://remote.service.com:8088/remoteService;
 serviceClass=com.company.entities.RemoteServiceSoap
 endpointName=ns:remoteServiceSoap
 serviceName=ns:remoteService
 wsdlURL=http://remote.service.com:8088/remoteService?wsdlgt;
 
 Other possibly relevant information:
 I'm developing in scala.
 I'm using scalaxb to generate code from the wsdl.
 The serviceClass com.company.entities.RemoteServiceSoap is a
 (scalaxb-generated) trait and has all methods defined but the case differs
 between the method names in the trait and the operation names in the wsdl.
 Almost all method parameters are wrapped in Option.
 Thanks,
 Cary



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Can-t-find-the-BindingOperationInfo-with-operation-name-tp5737011.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


mvn build with -Pfastinstall not enabling noassembly flag?

2013-07-19 Thread Aki Yoshida
I would like to avoid the lengthy assembly step in the build at the
end when I quickly just build the camel project.

By looking at camel's parent/pom.xml, it seems that it was intended to
not assemble the distribution when built with the fastinstall profile.
profile
  idfastinstall/id
  activation
property
  namefastinstall/name
/property
  /activation
  properties
maven.test.skip.exectrue/maven.test.skip.exec
noassemblytrue/noassembly
  /properties

but I see the assembly phase is always executed when I built it with
-Pfastinstall.

I can only disable the assembly step by setting the noassembly flag
explicitly like:

mvn -Dnoassembly=true -Pfastinstall

Not sure if anyone have this problem, it is intended that way or has
something to do with my environment?

thanks.
aki


Re: Camel blueprint in JBoss AS

2013-07-05 Thread Aki Yoshida
that means you don't have org.apache.aries.blueprint stuff.
I don't know what needs to be done for your JBoss container to set up the
aries blueprint.

regards, aki


2013/7/5 Gnanaguru S gnanaguru.sattanat...@wipro.com

 Hi,

 Thanks, I added the blueprint bundle. But it shows an error. Is it because
 of the version conflict. I couldnt understand the error message.

 15:29:06,328 ERROR [org.apache.camel.camel-blueprint] (Thread-62)
 FrameworkEvent ERROR: org.apache.felix.log.LogException: o
 .osgi.framework.BundleException: Cannot resolve bundle resModule:
 [org.apache.camel.camel-blueprint:2.10.0]
 at

 org.jboss.osgi.framework.internal.ResolverPlugin.resolve(ResolverPlugin.java:157)
 at

 org.jboss.osgi.framework.internal.AbstractBundleState.ensureResolved(AbstractBundleState.java:551)
 at

 org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:211)
 at

 org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494)
 at

 org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144)
 at

 org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119)
 at

 org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416)
 at

 org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49)
 at

 org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954)
 at

 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 [rt.jar:1.6.0_17]
 at

 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 [rt.jar:1.6.0_17]
 at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_17]
 Caused by: org.apache.felix.log.LogException:
 org.jboss.osgi.resolver.XResolverException: Unable to resolve
 Module[org.apach
 camel.camel-blueprint:2.10.0]: missing requirement
 [Module[org.apache.camel.camel-blueprint:2.10.0]] package; ((package=org
 pache.aries.blueprint)(version=0.2.0)(!(version=2.0.0)))
 at

 org.jboss.osgi.resolver.felix.FelixResolver.resolveInternal(FelixResolver.java:117)
 at

 org.jboss.osgi.resolver.spi.AbstractResolver.resolve(AbstractResolver.java:149)
 at

 org.jboss.osgi.framework.internal.ResolverPlugin.resolve(ResolverPlugin.java:155)
 ... 11 more

 15:29:06,372 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2)
 JBAS018559: Deployed camel-blueprint-2.10.0.jar

 Regards
 Guru



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-blueprint-in-JBoss-AS-tp5735183p5735200.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel blueprint in JBoss AS

2013-07-04 Thread Aki Yoshida
if you are talking about the camel components, you will also need
camel-blueprint.



2013/7/4 Gnanaguru S gnanaguru.sattanat...@wipro.com

 Hi,

 I am trying to deploy a camel-config.xml directly in JBoss deployment
 directory.

 I have wrapped the camel context with blueprint tags, I have deployed
 camel-core.jar in the same deployment directory. camel-core is shown as a
 active bundle in the bundles list.

 The camel-config.xml is showing as deployed, but the routes are not
 working.
 ( A simple file to file use case)

 Do I need to deploy any blueprint specific bundles ?

 I have a Java application which will collect from/to endpoints from a web
 portal and creates a camel-config.xml dynamically. I want this to be
 deployed on a server, that is the reason why I prefered blueprint as a
 option to deploy xml's directly.

 Sample code:


 blueprint xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

 xmlns:cm=http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0;
xmlns:jaxws=http://cxf.apache.org/blueprint/jaxws;
xmlns:cxf=http://cxf.apache.org/blueprint/core;
xmlns:camel=http://camel.apache.org/schema/blueprint;
xmlns:camelcxf=http://camel.apache.org/schema/blueprint/cxf;
xsi:schemaLocation=
  http://www.osgi.org/xmlns/blueprint/v1.0.0
 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
  http://cxf.apache.org/blueprint/jaxws
 http://cxf.apache.org/schemas/blueprint/jaxws.xsd
  http://cxf.apache.org/blueprint/core
 http://cxf.apache.org/schemas/blueprint/core.xsd
  


   camelContext id=camel xmlns=http://camel.apache.org/schema/blueprint
 

   route

 from uri=file://e:\input /

 to uri=file://e:\output /


 /route

   /camelContext

 /blueprint

 Thanks
 Guru
 gnanaguru.com






 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-blueprint-in-JBoss-AS-tp5735183.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: two way ssl with a camel cxf proxy use case on Tomcat

2013-06-18 Thread Aki Yoshida
these are two different things (the inbound side configuration you already
have and the outbound side configuration you asked for) and depending on
what you need at each side, you can configure them independently.



2013/6/17 Nico Mommaerts nico.mommae...@gmail.com

 Ok thanks! Had already read that but wasn't sure if that was needed if ssl
 is also defined in Tomcat itself (is it harmful to also configure it
 there?)

 On Mon, Jun 17, 2013 at 4:35 PM, Aki Yoshida elak...@gmail.com wrote:

  you configure the ssl setting at your http conduit configuration.
  and this is explained in this cxf's online documentation:
 
 
 http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport%28includingSSLsupport%29-ConfiguringSSLSupport
 
  regards, aki
 
 
  2013/6/17 Nico Mommaerts nico.mommae...@gmail.com
 
   Hey,
  
   I'm trying to setup a Camel CXF proxy with two way ssl (message gets
 sent
   to camel app over http, camel forwards to an external customer over
  https,
   2 way).
   My Camel app is running on Tomcat (without Jetty running for CXF, I'm
  using
   the CXFServlet). I have experience in setting up Tomcat for 2 way ssl
  with
   Spring Webservices, but for Camel/CXF I see some literature about http
   conduits and keystores.
   So I'm not sure how to set this up for Camel/CXF, is it enough to
  configure
   this on Tomcat level, like I do for normal Spring webservices, or do I
  need
   to use the http conduit element in my configuration?
  
   Thanks in advance,
   Nicolas Mommaerts
  
 



Re: Not able to send out SOAP request through camel

2013-06-14 Thread Aki Yoshida
maybe you can describe your scenario in more detail. It's not clear what is
configured. It sounds like you are just using cxf in camel instead of using
the camel-cxf component, no?


2013/6/13 suyash.singh suyash.si...@gmail.com

 Hi,

 I am facing an issue sending out a SOAP request through camel.

 Observations:
 1) When I call invoke on the Dispatch stream, I get a sockettimeout error.
 2) A simple wget to the same SOAP URL works on the same machine.

 any idea if there is a known issue with sending SOAP requests through
 CAMEL?



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Not-able-to-send-out-SOAP-request-through-camel-tp5734169.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel-Cxf Payload Mode - DefaultSEI not found

2013-06-13 Thread Aki Yoshida
Hi Lalit,
do you see if your bundle is importing package org.apache.camel.component.cxf?
Could you look at the manifest file in your bundle jar? Unless you
explicitly added this package in the pom's Import-Package section, it will
not be added in the manifest's import package section. If missing, please
add it there and rerun your test?

regards, aki


2013/6/12 lmanchanda75 lmanchand...@gmail.com

 Hi Experts,

 I am writing a PAYLOAD mode client and for the same I have defined
 following
 blueprint:



 ?xml version=1.0 encoding=UTF-8?
 blueprint xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:camel=http://camel.apache.org/schema/blueprint;

 xmlns:cm=http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0;
xmlns:jaxws=http://cxf.apache.org/blueprint/jaxws;
xmlns:cxf=http://cxf.apache.org/blueprint/core;
xmlns:camel-cxf=http://camel.apache.org/schema/blueprint/cxf;
xsi:schemaLocation=
  http://www.osgi.org/xmlns/blueprint/v1.0.0
 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
  http://camel.apache.org/schema/blueprint
 http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
  http://cxf.apache.org/blueprint/jaxws
 http://cxf.apache.org/schemas/blueprint/jaxws.xsd
  http://cxf.apache.org/blueprint/core
 http://cxf.apache.org/schemas/blueprint/core.xsd
  http://camel.apache.org/schema/blueprint/cxf
 http://camel.apache.org/schema/cxf/camel-cxf-2.10.0-blueprint.xsd
  

   bean id=helloBean class=manchanda.lalit.cxfclient.HelloBean
   property name=say value=Hi from Camel/
   /bean


  bean id=cxfClient class=manchanda.lalit.cxfclient.TestCxfClient/


  camel-cxf:cxfEndpoint xmlns:hy=http://bd.prws.ksrtc.com; id=ksrtc

 address=http://111.93.131.108:9080/AWATAR_WSRouter/services/ResvAdaptee;

 serviceName=hy:ResvAdapteeService

 /camel-cxf:cxfEndpoint



   camelContext trace=false id=blueprintContext
 xmlns=http://camel.apache.org/schema/blueprint;
 route id=timerToLog
 from uri=timer:foo?period=5/
   bean ref=cxfClient method=dispatchByCamel/
 log message=The message contains ${body}/
 to uri=mock:result/
 /route

 route id=ksrtc-request
 from uri=direct:ksrtc/
 to

 uri=cxf:bean:ksrtc?portName=hy:ResvAdapteeamp;dataFormat=PAYLOADamp;allowStreaming=true/
 /route

 /camelContext

 /blueprint




 But my application does not start and gives the following exception:




 12:27:13,273 | ERROR | t-0.1.0-thread-1 | BlueprintCamelContext
  |
 138 - org.apache.camel.camel-blueprint - 2.10.0.redhat-60024 | Error
 occurred during starting Camel: CamelContext(blueprintContext) due Failed
 to
 create Producer for endpoint:

 Endpoint[cxf://bean:ksrtc?allowStreaming=truedataFormat=PAYLOADportName=hy%3AResvAdaptee].
 Reason: java.lang.ClassNotFoundException:
 org.apache.camel.component.cxf.DefaultSEI not found by
 manchanda.lalit.TryCxfClient [595]^M
 org.apache.camel.FailedToCreateProducerException: Failed to create Producer
 for endpoint:

 Endpoint[cxf://bean:ksrtc?allowStreaming=truedataFormat=PAYLOADportName=hy%3AResvAdaptee].
 Reason: java.lang.ClassNotFoundException:
 org.apache.camel.component.cxf.DefaultSEI not found by
 manchanda.lalit.TryCxfClient [595]^M
 at
 org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:395)^M
 at

 org.apache.camel.impl.ProducerCache.acquireProducer(ProducerCache.java:114)^M
 at
 org.apache.camel.impl.ProducerCache.startProducer(ProducerCache.java:145)^M
 at
 org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:175)^M
 at
 org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)^M
 at
 org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)^M
 at
 org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:52)^M
 at
 org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:73)^M
 at

 org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)^M
 at
 org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)^M
 at
 org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)^M
 at
 org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:52)^M
 at
 org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:73)^M
 at

 org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)^M
 at

 org.apache.camel.processor.interceptor.TraceInterceptor.doStart(TraceInterceptor.java:358)^M
 at
 org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)^M
 at
 org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)^M
 at
 

Re: Camel-Cxf Payload Mode - DefaultSEI not found

2013-06-13 Thread Aki Yoshida
Hi Willem,
that would be an option (or alternatively setting your own SE using
serviceClassI).

But I thought Lalit didn't have a WSDL nor SEI and wanted to use the
default dispatcher SEI. In that case, I think the import section needs to
be fixed.

@Lalit,
so there are three options:
1. fix the import and use the defaultSEI
2. use your own WSDL
3. use your own SEI

regards, aki


2013/6/12 Willem Jiang willem.ji...@gmail.com

 You need to specify the wsdlUrl attribute in the cxfEndpoint element.

 发自我的 iPhone

 在 2013-6-12,下午3:18,lmanchanda75 lmanchand...@gmail.com 写道:

  Hi Experts,
 
  I am writing a PAYLOAD mode client and for the same I have defined
 following
  blueprint:
 
 
 
  ?xml version=1.0 encoding=UTF-8?
  blueprint xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:camel=http://camel.apache.org/schema/blueprint;
 
  xmlns:cm=http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0;
xmlns:jaxws=http://cxf.apache.org/blueprint/jaxws;
xmlns:cxf=http://cxf.apache.org/blueprint/core;
xmlns:camel-cxf=http://camel.apache.org/schema/blueprint/cxf;
xsi:schemaLocation=
  http://www.osgi.org/xmlns/blueprint/v1.0.0
  http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
  http://camel.apache.org/schema/blueprint
  http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
  http://cxf.apache.org/blueprint/jaxws
  http://cxf.apache.org/schemas/blueprint/jaxws.xsd
  http://cxf.apache.org/blueprint/core
  http://cxf.apache.org/schemas/blueprint/core.xsd
  http://camel.apache.org/schema/blueprint/cxf
  http://camel.apache.org/schema/cxf/camel-cxf-2.10.0-blueprint.xsd
  
 
   bean id=helloBean class=manchanda.lalit.cxfclient.HelloBean
   property name=say value=Hi from Camel/
   /bean
 
 
  bean id=cxfClient class=manchanda.lalit.cxfclient.TestCxfClient/
 
 
  camel-cxf:cxfEndpoint xmlns:hy=http://bd.prws.ksrtc.com; id=ksrtc
 
  address=http://111.93.131.108:9080/AWATAR_WSRouter/services/ResvAdaptee
 
 serviceName=hy:ResvAdapteeService
 
  /camel-cxf:cxfEndpoint
 
 
 
   camelContext trace=false id=blueprintContext
  xmlns=http://camel.apache.org/schema/blueprint;
 route id=timerToLog
 from uri=timer:foo?period=5/
   bean ref=cxfClient method=dispatchByCamel/
 log message=The message contains ${body}/
 to uri=mock:result/
 /route
 
 route id=ksrtc-request
 from uri=direct:ksrtc/
 to
 
 uri=cxf:bean:ksrtc?portName=hy:ResvAdapteeamp;dataFormat=PAYLOADamp;allowStreaming=true/
 /route
 
  /camelContext
 
  /blueprint
 
 
 
 
  But my application does not start and gives the following exception:
 
 
 
 
  12:27:13,273 | ERROR | t-0.1.0-thread-1 | BlueprintCamelContext
|
  138 - org.apache.camel.camel-blueprint - 2.10.0.redhat-60024 | Error
  occurred during starting Camel: CamelContext(blueprintContext) due
 Failed to
  create Producer for endpoint:
 
 Endpoint[cxf://bean:ksrtc?allowStreaming=truedataFormat=PAYLOADportName=hy%3AResvAdaptee].
  Reason: java.lang.ClassNotFoundException:
  org.apache.camel.component.cxf.DefaultSEI not found by
  manchanda.lalit.TryCxfClient [595]^M
  org.apache.camel.FailedToCreateProducerException: Failed to create
 Producer
  for endpoint:
 
 Endpoint[cxf://bean:ksrtc?allowStreaming=truedataFormat=PAYLOADportName=hy%3AResvAdaptee].
  Reason: java.lang.ClassNotFoundException:
  org.apache.camel.component.cxf.DefaultSEI not found by
  manchanda.lalit.TryCxfClient [595]^M
 at
 
 org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:395)^M
 at
 
 org.apache.camel.impl.ProducerCache.acquireProducer(ProducerCache.java:114)^M
 at
 
 org.apache.camel.impl.ProducerCache.startProducer(ProducerCache.java:145)^M
 at
 
 org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:175)^M
 at
  org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)^M
 at
  org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)^M
 at
  org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:52)^M
 at
 
 org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:73)^M
 at
 
 org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)^M
 at
  org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)^M
 at
  org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)^M
 at
  org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:52)^M
 at
 
 org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:73)^M
 at
 
 org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)^M
 at
 
 

Re: Camel-Cxf Payload Mode - DefaultSEI not found

2013-06-13 Thread Aki Yoshida
maybe this handling of javax prop is missing in the camel-cxf's dispatch
mode. If that is the case (not sure util looking at it), it can be added.

but as a workaround, you couldt set the soapaction value at the camel route
somewhere before calling the to-cxt step
...
camel:setHeader
headerName=soapactioncamel:constant.../camel:constant/camel:setHeader
camel:to uri=cxf:





2013/6/13 lmanchanda75 lmanchand...@gmail.com

 Hi ,

 I am stuck with other issue, where the server is responding with


 soapenv:FaultfaultcodeClient.NoSOAPAction/faultcodefaultstring![CDATA[WSWS3147E:
 Error: no SOAPAction header!]]

 When I was using cxf libarary using Dispatch mechanism I got a way out
 using
 the following:

 DispatchStreamSource dispStreamSrcMessage =
 service.createDispatch(portName, StreamSource.class, Mode.MESSAGE, new
 AddressingFeature());




 dispStreamSrcMessage.getRequestContext().put(Dispatch.SOAPACTION_USE_PROPERTY,true);


 dispStreamSrcMessage.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY,
 http://www.webserviceX.NET/ChangeAccelerationUnit;);


 But using cxfEndpoint, not sure how to do this.

 Appreciate any help.

 Regds
 Lalit



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-Cxf-Payload-Mode-DefaultSEI-not-found-tp5734122p5734176.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel 2.9.2, CXF 2.6.2 - How should the response look for CXF producer using Payload dataformat

2013-06-06 Thread Aki Yoshida
2013/6/6 Monga, Sunita (GE Healthcare) sunita.mo...@ge.com

 Hi William,

 I had tried specifying the wsdlURL but did not work. Not sure if my path
 was not wrong. I had put in web-app\wsdl\my.wsdl. Does it need to be under
 web-inf?

 Finally I tried generating client classes from the wsdl (using maven code
 gen plugin) and specified the serviceClass attribute pointing to the
 generated service class. It worked after that.

 Just wondering, are those fields not optional for producer? The request
 was going through fine just response handling was failing.


yeah. actually they are indeed optional for the producer part since 2.8.0.
so I replied to the earlier mail by saying it's strange that you are
getting this error.
and when I ran a test with the same combination of camel and cxf versions,
it works fine.
So I suspect that you might be picking up another version of camel or cxf
that has some interoperability issue.


 Thanks

 Sunita

 -Original Message-
 From: Willem jiang [mailto:willem.ji...@gmail.com]
 Sent: Wednesday, June 05, 2013 10:11 PM
 To: users@camel.apache.org
 Subject: Re: Camel 2.9.2, CXF 2.6.2 - How should the response look for CXF
 producer using Payload dataformat

 Hi,

 I just found you didn't specify the wsdlURL or serviceClass attributes in
 you CxfEndpoint element.
 They are useful when CXF is trying to build up ServiceModel for handling
 the request and response.
 Can you add either one of them to your CxfEndpoint definition?



 --
 Willem Jiang

 Red Hat, Inc.
 FuseSource is now part of Red Hat
 Web: http://www.fusesource.com | http://www.redhat.com
 Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
 (English)
   http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
 Twitter: willemjiang
 Weibo: 姜宁willem





 On Wednesday, June 5, 2013 at 10:23 PM, sunita wrote:

  Hi William,
 
  Thanks for your response. I was initially posting only on camel user
  group but since I did not get any responses to my earlier posts, I
  decided to post on both since it may have different audiences.
 
  Do you know why I am getting this error when I wrap the response in
  soap envelope. I had posted this question earlier as well.
 
   org.apache.cxf.interceptor.Fault: Unexpected element
   {http://model.webservices.ihe.adapters.ccg.dataexchange.hcit.ge.com/
   CcdaXdrService}ccdaResponse
   found. Expected
   {http://camel.apache.org/cxf/jaxws/dispatch}InvokeResponse.
  
  
  
   at
   org.apache.cxf.interceptor.DocLiteralInInterceptor.validatePart(DocL
   iteralInInterceptor.java:258)
  
  
  
   at
   org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(Doc
   LiteralInInterceptor.java:200)
 
 
 
 
  see the Post with following tittle for more details
 
  Camel 2.9.2 - Error parsing custom CXF response -
  org.apache.cxf.interceptor.Fault: Unexpected element
  {http://CcdaXdrService}ccdaResponse found. Expected
  {http://camel.apache.org/cxf/jaxws/dispatch}InvokeResponse
 
 
 
 
 
 
 
  --
  View this message in context:
  http://camel.465427.n5.nabble.com/Camel-2-9-2-CXF-2-6-2-How-should-the
  -response-look-for-CXF-producer-using-Payload-dataformat-tp5733748p573
  3881.html Sent from the Camel - Users mailing list archive at
  Nabble.com (http://Nabble.com).






  1   2   >