camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "viral.patel69" <>
Subject how to pass parameter to camel custom datafotmat?
Date Tue, 11 Feb 2014 08:58:49 GMT
I am new to camel

i have implemented custom dataformat

*Now i want to use custom property in marshel or unmarshal method.*

Is this possible to do this in camel?

please give example if there is way.

My custom dataformat code is as follows

package com.camel.spring.test.dataFormat;

import groovy.xml.MarkupBuilder;

import java.util.HashMap;

import org.apache.camel.Exchange;
import org.apache.camel.spi.DataFormat;
import com.predic8.wsdl.Definitions;
import com.predic8.wsdl.WSDLParser;
import com.predic8.wstool.creator.RequestCreator;
import com.predic8.wstool.creator.SOARequestCreator;

public final class SOAPDataFormat implements DataFormat {

    public void marshal(Exchange exchange, Object dataDefination,
OutputStream stream) throws Exception {
            WSDLParser parser = new WSDLParser();
            Definitions wsdl = parser
            StringWriter writer = new StringWriter();
            HashMap<String, Object> formParams = new HashMap<String,
            SOARequestCreator creator = new SOARequestCreator(wsdl,
                    new RequestCreator(), new MarkupBuilder(writer));
            creator.setBuilder(new MarkupBuilder(writer));
            creator.setCreator(new RequestCreator());

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

*my route configuration is*

        <from uri="file:d:/inbox/wsJson?noop=true" />
        <marshal >
            <custom ref="soapDataFormat" />

I am just working on marshaling so ignore unmarshal code.

i want to pass
"getApplication","TestServiceHttpBinding" values runtime that is changed on
request to request basis.

i found 1 work aroung by setting header values, but which is not proper

please help me

Thanks in advance.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message