August 17, 2023

cCXF – Docs for ESB 5.x

cCXF

ccxf_icon32_white.png

cCXF properties

Component Family

Messaging

Function

cCXF provides integration with
Apache CXF for connecting to JAX-WS services.

Purpose

cCXF is used to provide or consume
Web services.

Basic settings

Service/Address

The service endpoint URL where the Web service is provided.

In case cCXF is used to consume a
Web service and the endpoint lookup shall use the Service Locator
(the Use Service Locator check box
is selected), the URL needs to be
"locator://anyAddress/".

 

Service/Type

Select which type you want to use to provide Web service. Either
wsdlURL or serviceClass.

wsdlURL: Select this type to
provide the Web service from a WSDL file. Choose Repository or File to provide the Web service from a Route
Resource or the file system.

serviceClass: Select this type to
provide the Web service from an SEI (Service Endpoint Interface)
Java class.

 

Service/WSDL File

This field appears when the wsdlURL service type is selected. If the WSDL file
is from the file system, browse to or enter the path to the WSDL
file. If the WSDL file is from a Route Resource, click […] and select the one you want from
the Resources tree view. The Version list appears allowing you to choose from all
the versions of the Route Resource.

 

Service/Service configuration

This option appears when wsdlURL
is selected in the Type list. It
allows you to configure the service endpoint information
conveniently. Click […] to open
the service configuration wizard.

The WSDL field in the wizard is
filled in with the WSDL file defined in the WSDL File field automatically. You can also set the
WSDL file directly in the service configuration wizard in one of the
following ways:

  • Click Browse… to browse
    to or enter the path to the WSDL file in the file
    system.

  • Click Services to select
    a service under the Services node in the Integration perspective of the Studio,

  • Click Resources to select
    a service under the Resources node.

After setting the WSDL file, click refresh_button.png to show the port(s) and operation(s) available
in the Port Name and Operation boxes respectively. Select the
one you want to use and click Finish. The Operation box only shows when the cCXF component is used to consume a Web
service.

 

Service/Service Class

This field appears when the serviceClass service type is selected. Enter the
name of the service class to be used to provide the Web service.

 

Service/Dataformat

The exchange data style. POJO,
PAYLOAD, RAW, or CXF_MESSAGE.

POJOs (Plain Old Java Objects)
are the Java parameters to the method being invoked on the target
server.

PAYLOAD is the message payload,
the contents of the soap:body.

RAW is the raw message that is
received from the transport layer without SAM (Service Activity
Monitor) support.

CXF_MESSAGE is the raw message
that is received from the transport layer with SAM support.

  Service Name The service name this service is implementing. It maps
to the wsdl:service@name in the format of
ns:SERVICE_NAME where ns is a namespace
prefix valid at this scope. This field gets filled in automatically upon
completion of the Service
configuration
.
  Port Name The endpoint name this service is implementing. It maps
to the wsdl:port@name, in the format of
ns:PORT_NAME where ns is a namespace
prefix valid at this scope. This field gets filled in automatically upon
completion of the Service
configuration
.
 

Operation Name

The operation name this service is implementing. It maps to the
wsdl:operation@name, in the format of
ns:OPERATION_NAME where ns is a
namespace prefix valid at this scope. This option appears when the
cCXF component is used consume
a Web service. This field gets filled in automatically upon
completion of the Service
configuration
.

 

Use Service Registry

This option is only available if you subscribed to Talend Enterprise
ESB solutions.

Select this check box to enable the service registry. It provides
dynamic endpoint lookup and allows services to be redirected based
upon information retrieved from the registry. It works in Runtime
only.

When the cCXF component is used
to provide a Web service, the service deployed in Runtime will work
with the service registry.

When the cCXF component is used
to consume a Web service:

In the Correlation Value field,
specify a correlation ID or leave this field empty. For more
information, see the Use Business
Correlation
option.

In the Username and the Password fields, enter the authentication
credentials. To enter the password, click the […] button next to the password field, and then in
the pop-up dialog box enter the password between double quotes and
click OK to save the
settings.

If SAML token is registered in the service registry, you need to
specify the client’s role in the Role field. You can also select the Propagate Credentials check box to make
the call on behalf of an already authenticated user by propagating
the existing credentials. You can enter the username and the
password to authenticate with STS to propagate credentials using
username and password, or provide the alias, username and the
password to propagate using certificate. For more information, see
the Use Authentication
option.

For more information about how to set up and use the Service
Registry, see the Talend Administration Center User Guide and Talend ESB Infrastructure
Services Configuration Guide
.

  Use Service Locator

Provides service consumers with a mechanism to discover service
endpoints at runtime without specifying the physical location of the
endpoint. Additionally, it allows service providers to automatically
register and unregister their service endpoints at the Service
Locator.

Note

For service consumers, the URL additionally needs to be set to
"locator://anyAddress/" in the CXF Configuration / Address
field.

The Custom Properties table
appears when the Use Service
Locator
check box is selected. Click plus_button.png to add as many properties as needed to the
table. Enter the name and the value of each property in the
Property Name field and the
Property Value field
respectively to identify the service. For more information, see
Talend ESB Infrastructure
Services Configuration Guide
for how to install and
configure the Service Locator.

  Use Service Activity Monitor

Captures events and stores this information to facilitate in-depth
analysis of service activity and track-and-trace of messages
throughout a business transaction. This can be used to analyze
service response times, identify traffic patterns, perform root
cause analysis and more.

This feature is not supported when MESSAGE is used as the processing mode. When
MESSAGE is selected in the
Dataformat field, the Use Service Activity Monitor check box is
disabled.

This option is also disabled when the Use
Service Registry
check box is selected if you
subscribed to Talend Enterprise ESB solutions.

  Use Authentication

Select this check box to enable the authentication option. Select
from Username Token, SAML Token (ESB runtime only), HTTP Basic, and HTTP Digest.

When the cCXF component is used
to produce a Web service, authentication with the Username Token, SAML token, and HTTP
Basic
work in runtime only. HTTP Digest is not supported. When SAML Token (ESB runtime only) is
selected, cCXF will get the SAML
Token from the request header for further use in the message
routing.

When the cCXF component is used
to consume a Web service, authentication with the Username Token, HTTP Basic, and HTTP
Digest
work in both the studio and runtime.
Authentication with the SAML token
works in runtime only. Enter a username and a password in the
corresponding fields as required. To enter the password, click the
[…] button next to the
password field, and then in the pop-up dialog box enter the password
between double quotes and click OK
to save the settings.

When SAML Token (ESB runtime
only)
is selected, you can either provide the user
credentials to send the request or make the call on behalf of an
already authenticated user by propagating the existing credentials.
Select from:

: Enter the username and the
password in the corresponding fields to access the service.

Propagate using U/P: Enter the
user name and the password used to authenticate via STS.

Propagate using Certificate:
Enter the alias and the password used to authenticate via
STS.

This check box disappears when the Use
Service Registry
check box is selected.

 

Use Authorization

This option is only available if you subscribed to Talend Enterprise
ESB solutions. It appears when SAML Token (ESB
runtime only)
is selected in the Use Authentication list.

When the cCXF component is used
to provide a Web service, select this check box to enable
authorization.

When the cCXF component is used
to consume a Web service, select this check box to invoke authorized
call and specify the client’s role in the Role field.

For more information about the management of user roles and
rights, see the Talend Administration Center User Guide and Talend ESB Infrastructure Services Configuration
Guide
.

 

Use Business Correlation

Select this check box to enable the correlation option so that
chained service calls will be grouped under the same correlation
ID.

When cCXF is used to provide a
Web service:

cCXF will extract the correlation
ID from the request message.

If the request message does not contain a correlation ID, the
provider will create a correlation ID automatically in the SOAP
header.

When cCXF is used to consume a
Web service:

You can specify a correlation ID in the Correlation Value field using a string or a simple
expression. If you leave this field empty, this value will be
generated automatically at runtime. The correlation ID will be
created in the custom SOAP header of the request message and passed
on to the service it calls.

This check box disappears when the Use
Service Registry
check box is selected or RAW is selected in the Dataformat list.

Advanced settings Arguments Set the optional arguments in the corresponding table.
Click [+] as many times as required to
add arguments to the table. Then click the corresponding Value field and enter a value. See the site
http://camel.apache.org/cxf.html for available URI
options.

Usage

cCXF can be a start, middle or
end component in a Route.

Limitation

Due to the license incompatibility, one or more JAR files required to use this component are
not provided. You can install these missing JAR files by clicking the Install button in the Basic settings view
of the Component tab. For more information, see the section
about how to configure the Studio of the Talend Installation and Upgrade Guide.

 Multiple cCXF components with
the same label in a Route is not supported.

When cCXF is used to consume a
Web service, if you use the CXF_MESSAGE data format, the request body type need
to be javax.xml.transform.Source.class, or the request
body will be empty.

For simple proxy use cases, for example, from cCXF to cProcessor to cCXF,
if you use the RAW data format, the
request body will be reset. If it is printed by cProcessor, the output request body will
be empty.

When cCXF is used to consume a
Web service and the data format is POJO, PAYLOAD, or
CXF_MESSAGE, if fault response
is returned the message routing will stop. In this case, it is
recommended to use the cErrorHandler component to catch the fault message.
For more information about cErrorHandler, see cErrorHandler.

Scenario 1: Providing a Web service using cCXF from a WSDL file

In this scenario, a Web service is produced by a cCXF
component using a WSDL file.

use_case_ccxf1.png

Dropping and linking the components

This use case requires one cCXF component and one
cProcessor component.

  1. From the Palette, expand the Messaging folder, and drop a cCXF component onto the design workspace.

  2. Expand the Processor folder, and drop a cProcessor component onto the design
    workspace.

  3. Right-click the cCXF component, select Row > Route from
    the contextual menu and click the cProcessor component.

  4. Label the cCXF component for better
    identification of its functionality.

Configuring the components

In this scenario, the cProcessor component is used only to
enable the cCXF component to function as a service
producer. Therefore, it does not need any configuration.

  1. Double-click the cCXF component to
    display its Basic settings view in the
    Component tab.

    use_case_ccxf2.png
  2. In the Address field, type in the service
    endpoint URL for the Web service to be provided, http://192.168.0.212:8000/service.endpoint in this
    example.

  3. From the Type list, select wsdlURL to enable producing the Web service from
    a WSDL file.

  4. In the Wsdl File field, browse to or type
    in the path to the WSDL file to be used.

  5. Click […] next to Service Configuration to open the service configuration
    wizard. The WSDL field has been filled in
    with the selected WSDL file. Click refresh_button.png to show the available port in the Port Name box. Select the airportSoap port and
    click Finish to close the wizard. The
    Service Name and Port Name fields in the Basic
    settings
    view are filled in automatically.

    use_case_ccxf17.png
  6. From the Dataformat list, select
    PAYLOAD mode for the wsdlURL data format.

  7. Press Ctrl+S to save your route.

Viewing code and executing the Route

  1. Click the Code tab at the bottom of the
    design workspace to have a look at the generated code.

    use_case_ccxf3.png

    As shown in the code, the cCXF component
    labelled WebService_producer produces the Web service from an
    input file airport_soap_route.wsdl using the endpoint URL
    http://192.168.0.212:8000/service.endpoint.

  2. Click the Run view to display it and
    click the Run button to launch the
    execution of your Route. You can also press F6 to execute it.

    RESULT: The service is successfully started. You can access it from a Web
    browser using the service endpoint URL followed by ?wsdl.

    use_case_ccxf4.png

Scenario 2: Providing a Web service using cCXF from a Java class

In this scenario, a Web service is provided from a Java class file using a cCXF component.

Creating a Java class

  1. From the repository tree view, expand the Code node and right click the Beans node. In the contextual menu, select Create Bean.

    use_case_ccxf5.png
  2. The [New Bean] wizard opens. In the Name field, type in a name for the bean, for
    example, CXFdemobean. Click Finish to close the wizard.

    use_case_ccxf6.png
  3. Change the class type to interface, change the return type
    to string and remove the message body.

  4. Press Ctrl+S to save your bean.

Dropping and linking the components

use_case_ccxf1.png

This use case requires one cCXF
component and one cProcessor component.

  1. From the Palette, expand the Messaging folder, select the cCXF component and drop it onto the design
    workspace.

  2. Expand the Processor folder, select the
    cProcessor component and drop it onto
    the design workspace.

  3. Right-click the cCXF component, select
    Row > Route in the contextual menu and click the cProcessor component.

  4. Label the components for better identification of their
    functionality.

Configuring the components

In this scenario, the cProcessor component is used only to
enable the cCXF component to function as a service
producer. Therefore, it does not need any configuration.

  1. Double-click the cCXF component to
    display its Basic settings view in the
    Component tab.

    use_case_ccxf8.png
  2. In the Address field, type in the service
    endpoint URL for the Web service to be provided, http://192.168.0.212:8001/service.endpoint in this
    example.

  3. From the Type from, select serviceClass to start the Web service from a Java
    class.

  4. In the Service Class field, specify the
    predefined bean class, CXFdemobean in
    this example.

  5. From the Dataformat list, select
    POJO as the serviceClass service data format.

  6. Press Ctrl+S to save your Route.

Viewing code and executing the Route

  1. Click the Code tab at the bottom of the
    design workspace to have a look at the generated code.

    use_case_ccxf9.png

    As shown in the code, the cCXF component labelled
    WebService_producer produces the Web service from an
    predefined bean beans.CXFdemobean using the endpoint URL
    http://192.168.0.212:8001/service.endpoint.

  2. Click the Run view to display it and
    click the Run button to launch the
    execution of your Route. You can also press F6 to execute it.

    RESULT: The service is successfully started. You can access it from a Web
    browser using the service endpoint URL followed by ?wsdl.

    use_case_ccxf10.png

Scenario 3: Providing a Web service from a Route Resource

In this scenario, a Web service is provided from a Route Resource using a cCXF component.

Creating a Route Resource

  1. From the Repository tree view, right-click the
    Resources node and select Create Resource from the context menu.

    use_case_ccxf12.png
  2. The [New Route Resource] wizard opens. In the Name field, type in a name for the Resource, for
    example, DemoServiceWsdl. Click Finish to close the wizard.

    use_case_ccxf13.png
  3. Browse to an existing WSDL file from the local file system and click Finish.

  4. Press Ctrl+S to save your Route Resource.

Dropping and linking the components

use_case_ccxf1.png

This use case requires a cCXF and a
cProcessor component.

  1. From the Palette, expand the Messaging folder, and drop a cCXF component onto the design workspace.

  2. Expand the Processor folder, and drop a
    cProcessor component onto the design
    workspace.

  3. Right-click the cCXF component, select
    Row > Route from the contextual menu and click the cProcessor component.

  4. Label the cCXF component for better
    identification of its functionality.

Configuring the components

In this scenario, the cProcessor component is
used only to enable the cCXF component to function
as a service producer. Therefore, it does not need any configuration.

  1. Double-click the cCXF component to
    display its Basic settings view in the
    Component tab.

    use_case_ccxf14.png
  2. In the Address field, type in the service
    endpoint URL for the Web service to be provided, http://localhost:8000/service.endpoint in this
    example.

  3. From the Type list, select wsdlURl and use the Repository property type to start the Web service from the
    Route Resource that we have created.

  4. In the WSDL File field, click the
    […] button and select DemoServiceWsdl from the Resources tree view.
    Click OK to close the wizard.

  5. Click […] next to Service Configuration to open the service configuration
    wizard. The WSDL field has been filled in
    with the selected WSDL file. Click refresh_button.png to show the available port in the Port Name box. Select the DemoServicePort port
    and click Finish to close the wizard. The
    Service Name and Port Name fields in the Basic
    settings
    view are filled in automatically.

    use_case_ccxf18.png
  6. Press Ctrl+S to save your Route.

Viewing code and executing the Route

  1. Click the Code tab at the bottom of the
    design workspace to have a look at the generated code.

    use_case_ccxf15.png

    As shown in the code, the cCXF component labelled
    WebService_producer produces the Web service from an
    predefined Route Resource DemoServiceWsdl using the endpoint
    URL http://localhost:8000/service.endpoint.

  2. Click the Run view to display it and
    click the Run button to launch the
    execution of your Route. You can also press F6 to execute it.

    RESULT: The service is successfully started. You can access it from a Web
    browser using the service endpoint URL followed by ?wsdl.

    use_case_ccxf16.png

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x