Hi, 1/ First solution: use SMX components First, you need two endpoints:- the first one is CXF-BC or HTTP component based. This endpoint expects incoming SOAP envelop. For exemple, using the HTTP component, the xbean.xml looks like:
<beans xmlns:example="http://www.example.org" xmlns:http="http://servicemix.apache.org/http/1.0"> <http:soap-consumer service="example:stoc" target="http" targetService="example:stoc" targetEndpoint="transform" locationURI="http://0.0.0.0:8192/example" wsdl="classpath:stoc.wsdl"/> </beans>- the second one is the file endpoint that write an incomding Normalized Message into a file:
<bean xmlns:example="http://www.example.org" xmlns:file="http://servicemix.apache.org/file/1.0"> <file:sender service="example:stoc" target="file" directory="file:target/files"/> </bean>- the third one is the endpoint in the middle (between the HTTP and the file one) that take the soap env (coming from the HTTP endpoint) the in normalized message, transforms to csv format and send to the file endpoint. You can achieve it using servicemix-bean. I let you implement the transformation logic.
2/ Second solution: use CamelAnother solution is to use Camel to apply transformation. For example using a velocity template or a bean.
For example, using velocity
from("jbi:a").to("velocity:myvel.vm").to("file:target/file.csv")
or using bean:
from("jbi:a").beanRef("mybean",
"mytransformmethod").to("file:target/file.csv")
where A is a HTTP SOAP endpoint. I hope it helps you. Regards JB lekkie wrote:
Hi guys, I'd like to convert a soap request to a csv file. Also, I'd like the element names to to be the headers for the csv data. kr.
