-
15. Re: Marshalling/Unmarshalling XML Messages
willem.jiang Jul 11, 2013 1:10 AM (in response to anirban.gupta4)Which version of JBoss Fuse are you using?
If you are using Fuse 6.0, you can not use camel-jxpath, as it is not part of camel-2.10.x.
-
16. Re: Marshalling/Unmarshalling XML Messages
anirban.gupta4 Jul 11, 2013 2:39 AM (in response to willem.jiang)Ok that is the problem, so it i part of a higher version of camel? (2.11)
-
17. Re: Marshalling/Unmarshalling XML Messages
willem.jiang Jul 11, 2013 3:20 AM (in response to anirban.gupta4)You need to update the Camel version before you run it.
-
18. Re: Marshalling/Unmarshalling XML Messages
ffang Jul 11, 2013 3:38 AM (in response to willem.jiang)Hi,
Just a quick reminder, upgrade camel version yourself may not be that easy, especially 2.a ==> 2.b, a lot of dependencies(like cxf, spring, etc) need get upgraded as well, so if you do it you are pretty much on your own.
Freeman
-
19. Re: Marshalling/Unmarshalling XML Messages
anirban.gupta4 Jul 11, 2013 3:59 AM (in response to ffang)Ok fine, I'm stuk at point for which I am searching the answer and trying out various combinations.
1. Input SOAP meage from a consumer
2. validate the message against the input XSD
3. Tranform the message to a SOAP message the producer understands.
4. Call the producer
I was able to do all except the 3rd step. Previously I was trying wit dataFormat MESSAGE,but a the validation step required the dataFormat to be POJO, I switched to POJO dataFormat. Now I am able to access the message body, headers but not transform the message to another SOAP message. Also I'm not finding any suitable examples/discusion that dicusses about this. Plz help.
-
20. Re: Marshalling/Unmarshalling XML Messages
willem.jiang Jul 11, 2013 4:26 AM (in response to anirban.gupta4)For the step 3, you may need to convert the object to the other object which can be used for the invoke the service that you want.
-
21. Re: Marshalling/Unmarshalling XML Messages
anirban.gupta4 Jul 11, 2013 5:12 AM (in response to willem.jiang)Yes I can change the SOAP body by using the add and remove methods on MessageContentsList, which I am getting by exchange.getIn().getBody(). It is fine, but if the namespace of the two XSDs are different, which i mostly the case, I am not able to modify the namespaces.
-
22. Re: Marshalling/Unmarshalling XML Messages
ffang Jul 11, 2013 5:17 AM (in response to anirban.gupta4)Hi,
FYI, if you just wanna change the namespace, likely use cxf transformation feature[1] is more simple, I believe you can configure this feature for your camel-cxf provider endpoint.
[1]http://cxf.apache.org/docs/transformationfeature.html
Freeman
-
23. Re: Marshalling/Unmarshalling XML Messages
anirban.gupta4 Jul 11, 2013 7:37 AM (in response to ffang)Seem it will solve the purpose, will you kindly give an example of how to integrate it with camel? Like I wanted to replace all namepaces http://orderproducer.java.com to http://orderconsumer.java.com. I have declared the bean in pring xml like thi:
<bean id="transformFeatures" class="org.apache.cxf.feature.StaxTransformFeature">
<property name="outTransformElements">
<map>
<entry key="{http://orderproducer.java.com}" value="{http://orderconsumer.java.com}"/>
</map>
</property>
</bean>Now I'm integrating with cxf endpoint declaration like this:
<cxf:cxfEndpoint id="orderConsumerEndpoint"
address="http://localhost:8002/order/"
serviceClass="com.java.orderproducer.Order"
wsdlURL="wsdl/order_consumer.wsdl">
<cxf:outInterceptors>
<ref bean="transformFeatures"/>
</cxf:outInterceptors>
</cxf:cxfEndpoint>I used outInterceptors a I could not find another uitable element.
-
24. Re: Marshalling/Unmarshalling XML Messages
ffang Jul 11, 2013 7:55 AM (in response to anirban.gupta4)Hi,
You should use features element as it's a feature, something like
<cxf:cxfEndpoint id="orderConsumerEndpoint"
address="http://localhost:8002/order/"
serviceClass="com.java.orderproducer.Order"
wsdlURL="wsdl/order_consumer.wsdl">
<cxf:features>
<ref bean="transformFeatures"/>
</cxf:features>
</cxf:cxfEndpoint>
-
25. Re: Marshalling/Unmarshalling XML Messages
anirban.gupta4 Jul 15, 2013 3:04 AM (in response to ffang)Thank everybody for the solution, another quetion I have is is there a way to convert SOAP messages in POJO dataformat to raw xml as in MESAGE dataFormat?
Regards,
Anirban
-
26. Re: Marshalling/Unmarshalling XML Messages
willem.jiang Jul 15, 2013 3:39 AM (in response to anirban.gupta4)If you are using POJO dataformat, you need to use camel-cxf producer to send the request the remote service.
camel-cxf will generate the SOAP request for you.
-
27. Re: Marshalling/Unmarshalling XML Messages
anirban.gupta4 Jul 15, 2013 6:09 AM (in response to willem.jiang)Another question, suppose I'm inputting soap message using camel cxf consumer and dataFormat=MESSAGE, is there a way to perform schema validation on the message against the xsd?
-
28. Re: Marshalling/Unmarshalling XML Messages
willem.jiang Jul 15, 2013 9:57 AM (in response to anirban.gupta4)When you are using the MESSAGE dataformat, camel-cxf will not touch the input stream, the schema validation doesn't work this time.
-
29. Re: Marshalling/Unmarshalling XML Messages
anirban.gupta4 Jul 16, 2013 7:15 AM (in response to willem.jiang)Hi,
can you also give me some idea about the CXF_MESSAGE dataFormat? Like it speciality, how to get the soap meage using that dataFormat.