Configuring the components - 7.3

Apache CXF (Mediation)

Version
7.3
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > Apache CXF components (Mediation)
Data Quality and Preparation > Third-party systems > Apache CXF components (Mediation)
Design and Development > Third-party systems > Apache CXF components (Mediation)
Last publication date
2024-01-26

Procedure

  1. Double-click the cBeanRegister component to display its Basic settings view in the Component tab.
  2. The cBeanRegister component registers a Java bean, in which the customer information is set with the firstName, lastName, city, and id values.
    In the Id field, enter "customers" to name the bean.
    Select the Customized option and enter the following code in the Code box to create two customers and set the firstName, lastName, city, and id values for each of them:
    beans.Customers customers = new beans.Customers();
    
    beans.Customer customer = new beans.Customer();
    customer.setFirstName(TalendDataGenerator.getFirstName());
    customer.setLastName(TalendDataGenerator.getLastName());
    customer.setCity(TalendDataGenerator.getUsCity());
    customers.addCustomer(customer);
    
    customer = new beans.Customer();
    customer.setFirstName(TalendDataGenerator.getFirstName());
    customer.setLastName(TalendDataGenerator.getLastName());
    customer.setCity(TalendDataGenerator.getUsCity());
    customers.addCustomer(customer);
    
    beanInstance = customers;
  3. Double-click the cREST component to display its Basic settings view in the Component tab.
  4. The cREST component is used to provide the REST service.
    In the Endpoint field, type in the endpoint URL where the Web service will be provided, "http://localhost:8040/services/customers" in this example.
    From the Type list, select Manual to determine the REST API mapping manually.
    In the REST API mapping table, click [+] to add a row in the table. In the Output Flow field, enter getAllCustomers as the name of it. Select GET in the HTTP Verb list. Keep the default settings in the other columns.
  5. Double-click the cSetBody component to display its Basic settings view in the Component tab.
  6. Select SIMPLE from the Dataformat list. In the Expression field, enter "${ref:customers}" to refer to the bean defined in the cBeanRegister component as the message body of the service response.
  7. Keep the default settings of the cLog component to log the message exchanges.
  8. Press Ctrl+S to save your route.