I am a newbie in camel,when I read the camel-example-cxf-proxy demo which in
camel distribution,
I confuse with EnrichBean.java file

the source code of EnrichBean.java is very simple as follows:

public class EnrichBean {

    public Document enrich(Document doc) {
        Node node = doc.getElementsByTagName("incidentId").item(0);
        String incident = node.getTextContent();

        // here we enrich the document by changing the incident id to
another value
        // you can of course do a lot more in your use-case
        node.setTextContent("456");
        System.out.println("Incident was " + incident + ", changed to 456");

        return doc;
    }
}

it was used in camel_config.xml as follows:

  
  <bean id="enrichBean"
class="org.apache.camel.example.cxf.proxy.EnrichBean"/>
  

  <camelContext xmlns="http://camel.apache.org/schema/spring";>
    <endpoint id="callRealWebService"
uri="http://localhost:${real.port}/real-webservice?throwExceptionOnFailure=false"/>
    <route>
      
      <from uri="cxf:bean:reportIncident?dataFormat=MESSAGE"/>
      
      <to uri="log:input"/>
      
      <to uri="bean:enrichBean"/>
      
      <to ref="callRealWebService"/>
      
      <to uri="log:output"/>
    </route>

  </camelContext>

my question is: how EnrichBean.enrich method was called and why the
parameter to enrich() is Document type?

any reply is appriciate!



--
View this message in context: 
http://camel.465427.n5.nabble.com/in-camel-example-cxf-proxy-demo-which-in-camel-distribution-how-EnrichBean-enrich-method-was-called-tp5729745.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to