Configuring the components - Cloud - 8.0

Apache CXF (Mediation)

Version
Cloud
8.0
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
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-02-21

Procedure

  1. In the Basic settings view of the cTimer component, enter 1 in the Repeat field to trigger the message exchange one time.
  2. In the Basic settings view of the cSetHeader component, click the [+] button to add two headers in the Headers table, and then give each header a name and a value.
    In this example, name the first header "Authorization" and give its value an email address.
    The other header is org.apache.camel.component.cxf.common.message.CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS. Set it value to String.class to turn the response object to string.
  3. In the Basic settings view of the cSetBody component:
    1. Select SIMPLE from the Language list to trigger a simple text message exchange in this example.
    2. In the Expression field, enter {\"user\":\"test\",\"password\":\"t@l3nd\}" in double quotation marks as the content of the message.
  4. In the Basic settings view of the first cLog component, click Specify output log message in the Options area and enter "Test.cLog_1 HEADER ${in.headers} BODY ${in.body} " in the message field to log the message header and body.
  5. In the Basic settings view of the cREST component:
    1. Fill the Endpoint field with the URL of the Web service you are going to invoke.
    2. From the Type list, select Manual to determine the REST API mapping manually.
    3. In the Relative Path field, enter constant("").
    4. Select POST in the HTTP Method list.
    5. Select JSON in the Content Type and Accept Type lists.
    6. In the Response Class field, enter javax.ws.rs.core.Response.
  6. In the Basic settings view of the second cLog component, select Specify output log messge in the Options area and enter "Test.cLog_2 HEADER ${in.headers} BODY ${in.body} Exception ${exception.message}" in the message field to log the header and body of the response message and the exception.
  7. Press Ctrl+S to save your Route.