Options - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

Name

Required

Description

wsdlURL

No

The location of the WSDL. It is obtained from endpoint address by default.

Example: file://local/wsdl/hello.wsdl or wsdl/hello.wsdl

serviceClass

Yes

The name of the SEI (Service Endpoint Interface) class. This class can have, but does not require, JSR181 annotations.

This option is only required by POJO mode. If the wsdlURL option is provided, serviceClass is not required for PAYLOAD and MESSAGE mode. When wsdlURL option is used without serviceClass, the serviceName and portName (endpointName for Spring configuration) options MUST be provided. It is possible to use # notation to reference a serviceClass object instance from the registry. For example, serviceClass=#beanName. The serviceClass for a CXF producer (that is, the to endpoint) should be a Java interface.

It is possible to omit both wsdlURL and serviceClass options for PAYLOAD and MESSAGE mode. When they are omitted, arbitrary XML elements can be put in CxfPayload's body in PAYLOAD mode to facilitate CXF Dispatch Mode.

Please be advised that the referenced object cannot be a Proxy (Spring AOP Proxy is OK) as it relies on Object.getClass().getName() method for non Spring AOP Proxy.

Example: org.apache.camel.Hello

serviceClassInstance

Yes

Use either serviceClass or serviceClassInstance.

Deprecated in 2.x. In 1.6.x serviceClassInstance works like serviceClass=#beanName, which looks up a serviceObject instance from the registry.

Example: serviceClassInstance= beanName

serviceName

No

The service name this service is implementing, it maps to the wsdl:service@name

*Required for camel-cxf consumer since camel-2.2.0 or if more than one serviceName is present in WSDL.

Example: {http:­//org.apache.camel}ServiceName

endpointName

No

The port name this service is implementing, it maps to the wsdl:port@name

*Required for camel-cxf consumer since camel-2.2.0 or if more than one portName is present under serviceName. Example: {http:­//org.apache.camel}PortName

dataFormat

No

The data type messages supported by the CXF endpoint.

Default: POJO

Example: POJO,PAYLOAD,MESSAGE

relayHeaders

No

Please see the Description of relayHeaders option section for this option in 2.0. Should a CXF endpoint relay headers along the route. Currently only available when dataFormat=POJO

Default: true

Example:true,false

wrapped

No

Which kind of operation that CXF endpoint producer will invoke.

Default:false

Example:true,false

wrappedStyle

No

New in 2.5.0 The WSDL style that describes how parameters are represented in the SOAP body. If the value is false, CXF will chose the document-literal unwrapped style. If the value is true, CXF will chose the document-literal wrapped style.

Default: Null

Example:true,false

setDefaultBus

No

This will set the default bus when CXF endpoint create a bus by itself.

Default: false

Example:true,false

bus

No

New in 2.0. A default bus created by CXF Bus Factory. Use # notation to reference a bus object from the registry. The referenced object must be an instance of org.apache.cxf.Bus .

Example: bus=#busName

cxfBinding

No

New in 2.0, use # notation to reference a CXF binding object from the registry. The referenced object must be an instance of org.apache.camel.component.cxf.CxfBinding (use an instance of org.apache.camel.component.cxf. DefaultCxfBinding).

Example: cxfBinding=#bindingName

headerFilterStrategy

No

Use # notation to reference a header filter strategy object from the registry. The referenced object must be an instance of org.apache.camel.spi.HeaderFilterStrategy (use an instance of org.apache.camel.component.cxf. CxfHeaderFilter-Strategy). .

Example: headerFilterStrategy=#strategyName

loggingFeatureEnabled

No

New in 2.3, this option enables CXF Logging Feature which writes inbound and outbound SOAP messages to log.

Default:false

Example:loggingFeatureEnabled=true

defaultOperationName

No

New in 2.4, this option will set the default operationName that will be used by the CxfProducer which invokes the remote service.

Default: null

Example:defaultOperationName=greetMe

defaultOperationName-space

No

New in 2.4, this option will set the default operationNamespace that will be used by the CxfProducer which invokes the remote service.

Default: null

Example:defaultOperationNamespace= http://apache.org/hello_world_soap_http

synchronous

No

New in 2.5, this option will let cxf endpoint decide to use sync or async API to do the underlying work. The default value is false which means camel-cxf endpoint will try to use async API by default. Default: false

Example: synchronous=true

publishedEndpointUrl

No

New in 2.5, this option can override the endpointUrl that published from the WSDL which can be accessed with service address url plus ?wsdl.

Default: null

Example:publshedEndpointUrl=http://example.com/service

properties.XXX

No

Allows for setting custom properties to CXF in the endpoint URI. For example setting properties.mtom-enabled = true to enable MTOM.

allowStreaming

No

This option controls whether the CXF component, when running in PAYLOAD mode, will parse the incoming messages into DOM Elements or keep the payload as a javax.xml.transform.Source object that would allow streaming in some cases.

skipFaultLogging

No

Starting in 2.11, this option controls whether the PhaseInterceptorChain skips logging Faults that it catches.

username

No

New in Camel 2.12.3 This option is used to set the basic authentication information of username for the CXF client.

password

No

New in Camel 2.12.3 This option is used to set the basic authentication information of password for the CXF client.

continuationTimeout

No

New in Camel 2.14.0 This option is used to set the CXF continuation timeout which could be used in CxfConsumer by default when the CXF server is using Jetty or Servlet transport. (Before Camel 2.14.0, CxfConsumer just set the continuation timeout to be 0, which means the continuation suspend operation never timeout.)

Default: 30000 

Example: continuation=80000

The serviceName and portName are QNames, so if you provide them, be sure to prefix them with their {namespace} as shown in the examples above.

The descriptions of the dataformats

DataFormat

Description

POJO

POJOs (Plain old Java objects) are the Java parameters to the method being invoked on the target server. Both Protocol and Logical JAX-WS handlers are supported.

PAYLOAD

PAYLOAD is the message payload (the contents of the soap:body ) after message configuration in the CXF endpoint is applied. Only Protocol JAX-WS handlers are supported. Logical JAX-WS handlers are not.

MESSAGE

MESSAGE is the raw message that is received from the transport layer. It is not suppose to touch or change Stream, some of the CXF interceptors will be removed if you are using this kind of DataFormat so you can't see any soap headers after the camel-cxf consumer and JAX-WS handler is not supported.

CXF_MESSAGE

Starting with Camel 2.8.2, CXF_MESSAGE allows for invoking the full capabilities of CXF interceptors by converting the message from the transport layer into a raw SOAP message.

You can determine the data format mode of an exchange by retrieving the exchange property, CamelCXFDataFormat. The exchange key constant is defined in org.apache.camel.component.cxf.CxfConstants.DATA_FORMAT_PROPERTY .

Logging Messages

CXF's default logger is java.util.logging . If you want to change it to log4j, proceed as follows. Create a file, in the classpath, named META-INF/cxf/org.apache.cxf.logger . This file should contain the fully-qualified name of the class, org.apache.cxf.common.logging.Log4jLogger, with no comments, on a single line.

Note CXF's LoggingOutInterceptor outputs outbound messages that are sent on the wire to the logging system (Java Util Logging). Since the LoggingOutInterceptor is in PRE_STREAM phase (but PRE_STREAM phase is removed in MESSAGE mode), you have to configure LoggingOutInterceptor to be run during the WRITE phase. The following is an example:

<bean id="loggingOutInterceptor" 
   class="org.apache.cxf.interceptor.LoggingOutInterceptor">
   <!-- it really should have been user-prestream, -->
   <!-- but CXF does have such phase! -->
   <constructor-arg value="write"/> 
</bean>
   		
<cxf:cxfEndpoint id="serviceEndpoint" 
   address="http://localhost:9002/helloworld"  
   serviceClass="org.apache.camel.component.cxf.HelloService">
   <cxf:outInterceptors>
      <ref bean="loggingOutInterceptor"/>
   </cxf:outInterceptors>
   <cxf:properties>
      <entry key="dataFormat" value="MESSAGE"/>
   </cxf:properties>
</cxf:cxfEndpoint>

Description of relayHeaders option

There are in-band and out-of-band on-the-wire headers from the perspective of a JAXWS WSDL-first developer.

The in-band headers are headers that are explicitly defined as part of the WSDL binding contract for an endpoint such as SOAP headers.

The out-of-band headers are headers that are serialized over the wire, but are not explicitly part of the WSDL binding contract.

Headers relaying/filtering is bi-directional.

When a route has a CXF endpoint and the developer needs to have on-the-wire headers, such as SOAP headers, be relayed along the route to be consumed say by another JAXWS endpoint, then relayHeaders should be set to true, which is the default value.

The relayHeaders=true express an intent to relay the headers. The decision on whether a given header is relayed is delegated to a pluggable instance that implements the MessageHeadersRelay interface. A concrete implementation of MessageHeadersRelay will be consulted to decide if a header needs to be relayed or not. There is already an implementation of SoapMessageHeadersRelay which binds itself to well-known SOAP name spaces. Currently only out-of-band headers are filtered, and in-band headers will always be relayed when relayHeaders=true . If there is a header on the wire, whose name space is unknown to the runtime, then a fall back DefaultMessageHeadersRelay will be used, which simply allows all headers to be relayed.

The relayHeaders=false setting asserts that all headers in-band and out-of-band will be dropped.

  • POJO and PAYLOAD modes are supported. In POJO mode, only out-of-band message headers are available for filtering as the in-band headers have been processed and removed from header list by CXF. The in-band headers are incorporated into the MessageContentList in POJO mode. If filtering of in-band headers is required, please use PAYLOAD mode or plug in a (pretty straightforward) CXF interceptor/JAXWS Handler to the CXF endpoint.

  • The Message Header Relay mechanism has been merged into CxfHeaderFilterStrategy . The relayHeaders option, its semantics, and default value remain the same, but it is a property of CxfHeaderFilterStrategy . Here is an example of configuring it:

    <bean id="dropAllMessageHeadersStrategy" 
       class="org.apache.camel.component.cxf.CxfHeaderFilterStrategy">
       <!--  Set relayHeaders to false to drop all SOAP headers -->
       <property name="relayHeaders" value="false"/> 
    </bean>

    Then, your endpoint can reference the CxfHeaderFilterStrategy .

    <route>
       <from uri="cxf:bean:routerNoRelayEndpoint?headerFilterStrategy   //
          #dropAllMessageHeadersStrategy"/>          
       <to uri="cxf:bean:serviceNoRelayEndpoint?headerFilterStrategy   //
          #dropAllMessageHeadersStrategy"/>
    </route>
    
  • The MessageHeadersRelay interface has changed slightly and has been renamed to MessageHeaderFilter . It is a property of CxfHeaderFilterStrategy . Here is an example of configuring user defined Message Header Filters:

    <bean id="customMessageFilterStrategy" 
    			class="org.apache.camel.component.cxf.CxfHeaderFilterStrategy">
       <property name="messageHeaderFilters">
          <list>
             <!-- SoapMessageHeaderFilter is the built in filter.  -->
             <!-- It can be removed by omitting it. -->
             <bean class=
                "org.apache.camel.component.cxf.SoapMessageHeaderFilter"/>
                
             <!--  Add custom filter here -->    
             <bean class=
                "org.apache.camel.component.cxf.soap.CustomHeaderFilter"/>
          </list>
       </property>
    </bean>

  • Other than relayHeaders, there are new properties that can be configured in CxfHeaderFilterStrategy.

    Name

    Description

    type

    Required?

    Default value

    relayHeaders

    All message headers will be processed by Message Header Filters

    boolean

    No

    true

    relayAll-MessageHeaders

    All message headers will be propagated (without processing by Message Header Filters)

    boolean

    No

    false

    allowFilter-NamespaceClash

    If two filters overlap in activation namespace, the property control how it should be handled. If the value is true, last one wins. If the value is false, it will throw an exception

    boolean

    No

    false