...
Code Block | ||
---|---|---|
| ||
cxf:bean:cxfEndpoint?wsdlURL=wsdl/hello_world.wsdl&dataFormat=PAYLOAD |
Options
...
Name | Required | Description |
---|---|---|
| No | The location of the WSDL. It is obtained from endpoint address by default. |
...
or |
...
|
...
| Yes | The name of the SEI (Service Endpoint Interface) class. This class can have, but does not require, JSR181 annotations. |
...
method |
...
for |
...
non |
...
Spring |
...
AOP |
...
Proxy. |
...
|
...
| No | The service name this service is implementing, it maps to the |
...
or |
...
if |
...
more |
...
than |
...
one |
...
|
...
is |
...
present |
...
in |
...
WSDL. |
...
|
...
| No | The port name this service is implementing, it maps to the |
...
or |
...
if |
...
more |
...
than |
...
one |
...
|
...
is |
...
present |
...
under |
...
|
...
. |
...
| No | The data type messages supported by the CXF endpoint. |
| No | Please see the Description of |
| No | Which kind of operation that CXF endpoint producer will invoke |
| 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 |
| No | Will set the default bus when CXF endpoint create a bus by itself |
| No | A default bus created by CXF Bus Factory. Use |
| No | Use |
...
(use |
...
an |
...
instance |
...
of |
...
|
...
). |
...
|
...
| No | Use |
...
(use |
...
an |
...
instance |
...
of |
...
|
...
). |
...
|
...
| No | New in 2.3. |
...
This |
...
option |
...
enables |
...
CXF |
...
Logging |
...
Feature |
...
which |
...
writes |
...
inbound |
...
and |
...
outbound |
...
SOAP |
...
messages |
...
to |
...
log. |
...
| ||
| No | New in 2.4, |
...
this |
...
option |
...
will |
...
set |
...
the |
...
default |
...
operationName |
...
that |
...
will |
...
be |
...
used |
...
by |
...
the |
...
CxfProducer |
...
which |
...
invokes |
...
the |
...
remote |
...
service. |
...
| ||
| No | New in 2.4. |
...
This |
...
option |
...
will |
...
set |
...
the |
...
default |
...
operationNamespace |
...
that |
...
will |
...
be |
...
used |
...
by |
...
the |
...
CxfProducer |
...
which |
...
invokes |
...
the |
...
remote |
...
service. |
...
|
...
| 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. |
...
| ||
| 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. |
...
|
...
|
...
No | Camel 2.8: |
...
Allows |
...
to |
...
set |
...
custom |
...
properties |
...
to |
...
CXF |
...
in |
...
the |
...
endpoint |
...
uri. |
...
For |
...
example |
...
setting |
...
|
...
to |
...
enable |
...
MTOM. | ||
| No | New in 2.8.2. |
...
This |
...
option |
...
controls |
...
whether |
...
the |
...
CXF |
...
component, |
...
when |
...
running |
...
in |
...
PAYLOAD |
...
mode |
...
(see |
...
below), |
...
will |
...
DOM |
...
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. |
...
| No | New in 2.11. |
...
This |
...
option |
...
controls |
...
whether |
...
the |
...
PhaseInterceptorChain |
...
skips |
...
logging |
...
the |
...
Fault |
...
that |
...
it |
...
catches. |
...
| No | New in Camel 2.12.3 |
...
This |
...
option |
...
is |
...
used |
...
to |
...
set |
...
the |
...
basic |
...
authentication |
...
information |
...
of |
...
username |
...
for |
...
the |
...
CXF |
...
client. |
...
| No | New in Camel 2.12.3 |
...
This |
...
option |
...
is |
...
used |
...
to |
...
set |
...
the |
...
basic |
...
authentication |
...
information |
...
of |
...
password |
...
for |
...
the |
...
CXF |
...
client. |
...
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 |
---|---|
| 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. |
| |
| |
| New in Camel 2.8.2, |
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
...
.
...
How to enable CXF's LoggingOutInterceptor in MESSAGE mode
...
POJO
andPAYLOAD
modes are supported. InPOJO
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 theMessageContentList
in POJO mode. Thecamel-cxf
component does make any attempt to remove the in-band headers from theMessageContentList
. If filtering of in-band headers is required, please usePAYLOAD
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
. TherelayHeaders
option, its semantics, and default value remain the same, but it is a property ofCxfHeaderFilterStrategy
.
Here is an example of configuring it.Wiki Markup {snippet:id=dropAllMessageHeadersStrategy|lang=xml|url=camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/soap/headers/CxfMessageHeadersRelayTest-context.xml}
Then, your endpoint can reference the
CxfHeaderFilterStrategy
.Wiki Markup {snippet:id=noRelayRoute|lang=xml|url=camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/soap/headers/CxfMessageHeadersRelayTest-context.xml}
The
MessageHeadersRelay
interface has changed slightly and has been renamed toMessageHeaderFilter
. It is a property ofCxfHeaderFilterStrategy
. Here is an example of configuring user defined Message Header Filters:Wiki Markup {snippet:id=customMessageFilterStrategy|lang=xml|url=camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/soap/headers/CxfMessageHeadersRelayTest-context.xml}
Other than
unmigrated-inline-wiki-markuprelayHeaders
, there are new properties that can be configured inCxfHeaderFilterStrategy
.Name
Required
Description
relayHeaders
No
All message headers will be processed by Message Header Filters
Type:boolean
Default:true
relayAllMessageHeaders
No
All message headers will be propagated (without processing by Message Header Filters)
Type:boolean
Default:false
allowFilterNamespaceClash
No
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 isfalse
, it will throw an exception
Type:boolean
Default:false
Configure the CXF endpoints with Spring
You can configure the CXF endpoint with the Spring configuration file shown below, and you can also embed the endpoint into the
camelContext
tags. When you are invoking the service endpoint, you can set theoperationName
andoperationNamespace
headers to explicitly state which operation you are calling.Code Block xml xml || Name || Required || Description || | {{relayHeaders}} | No | All message headers will be processed by Message Header Filters \\ \\ _Type_: {{boolean}} \\ _Default_: {{true}} | | {{relayAllMessageHeaders}} | No | All message headers will be propagated (without processing by Message Header Filters) \\ \\ _Type_: {{boolean}} \\ _Default_: {{false}} | | {{allowFilterNamespaceClash}} | No | 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 \\ \\ _Type_: {{boolean}} \\ _Default_: {{false}} | h3. Configure the CXF endpoints with Spring You can configure the CXF endpoint with the Spring configuration file shown below, and you can also embed the endpoint into the {{camelContext}} tags. When you are invoking the service endpoint, you can set the {{operationName}} and {{operationNamespace}} headers to explicitly state which operation you are calling. {code:xml} <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://camel.apache.org/schema/cxf" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <cxf:cxfEndpoint id="routerEndpoint" address="http://localhost:9003/CamelContext/RouterPort" serviceClass="org.apache.hello_world_soap_http.GreeterImpl"/> <cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9000/SoapContext/SoapPort" wsdlURL="testutils/hello_world.wsdl" serviceClass="org.apache.hello_world_soap_http.Greeter" endpointName="s:SoapPort" serviceName="s:SOAPService" xmlns:s="http://apache.org/hello_world_soap_http" /> <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="cxf:bean:routerEndpoint" /> <to uri="cxf:bean:serviceEndpoint" /> </route> </camelContext> </beans> {code}
Be
sure
to
include
the
JAX-WS
{{
}}schemaLocation
attribute
specified
on
the
root
beans
element.
This
allows
CXF
to
validate
the
file
and
is
required.
Also
note
the
namespace
declarations
at
the
end
of
the
{{
}}<cxf:cxfEndpoint/>
tag--these
are
required
because
the
combined
{{\{
}}namespace}localName
syntax
is
presently
not
supported
for
this
tag's
attribute
values.
The
{{
}}cxf:cxfEndpoint
element
supports
many
additional
attributes:
|| Name || Value || | {{PortName}} | The endpoint name this service is implementing, it maps to the {{wsdl:port@name}}. In the format of {{}}Name
Value
PortName
The endpoint name this service is implementing, it maps to the
wsdl:port@name
. In the format ofns:PORT_NAME
{{where
}}ns
is
a
namespace
prefix
valid
at
this
| | {{serviceName}} | The service name this service is implementing, it maps to the {{wsdl:service@name}}. In the format of {{scope.
}}serviceName
The service name this service is implementing, it maps to the
wsdl:service@name
. In the format ofns:SERVICE_NAME
{{where
}}ns
is
a
namespace
prefix
valid
at
this
scope.
wsdlURL
The location of the WSDL. Can be on the classpath, file system, or be hosted remotely.
bindingId
The
bindingId
for the service model to use.address
The service publish address.
bus
The bus name that will be used in the JAX-WS endpoint.
serviceClass
The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.
It also supports many child elements:
Name
Value
cxf:inInterceptors
The incoming interceptors for this endpoint. A list of
<bean>
or<ref>
.cxf:inFaultInterceptors
The incoming fault interceptors for this endpoint. A list of
<bean>
or<ref>
.cxf:outInterceptors
The outgoing interceptors for this endpoint. A list of
<bean>
or<ref>
.cxf:outFaultInterceptors
The outgoing fault interceptors for this endpoint. A list of
<bean>
or<ref>
.cxf:properties
A properties map which should be supplied to the JAX-WS endpoint. See below.
cxf:handlers
A JAX-WS handler list which should be supplied to the JAX-WS endpoint. See below.
cxf:dataBinding
You can specify the which
DataBinding
will be use in the endpoint. This can be supplied using the Spring<bean class="MyDataBinding"/>
syntax.cxf:binding
You can specify the
BindingFactory
for this endpoint to use. This can be supplied using the Spring<bean class="MyBindingFactory"/>
syntax.cxf:features
The features that hold the interceptors for this endpoint. A list of {{<bean>}}s or {{<ref>}}s
cxf:schemaLocations
The schema locations for endpoint to use. A list of {{<schemaLocation>}}s
cxf:serviceFactory
The service factory for this endpoint to use. This can be supplied using the Spring
<bean class="MyServiceFactory"/>
syntaxWiki Markup {div} | | {{wsdlURL}} | The location of the WSDL. Can be on the classpath, file system, or be hosted remotely. | | {{bindingId}} | The {{bindingId}} for the service model to use. | | {{address}} | The service publish address. | | {{bus}} | The bus name that will be used in the JAX-WS endpoint. | | {{serviceClass}} | The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not. | It also supports many child elements: || Name || Value || | {{cxf:inInterceptors}} | The incoming interceptors for this endpoint. A list of {{<bean>}} or {{<ref>}}. | | {{cxf:inFaultInterceptors}} | The incoming fault interceptors for this endpoint. A list of {{<bean>}} or {{<ref>}}. | | {{cxf:outInterceptors}} | The outgoing interceptors for this endpoint. A list of {{<bean>}} or {{<ref>}}. | | {{cxf:outFaultInterceptors}} | The outgoing fault interceptors for this endpoint. A list of {{<bean>}} or {{<ref>}}. | | {{cxf:properties}} | A properties map which should be supplied to the JAX-WS endpoint. See below. | | {{cxf:handlers}} | A JAX-WS handler list which should be supplied to the JAX-WS endpoint. See below. | | {{cxf:dataBinding}} | You can specify the which {{DataBinding}} will be use in the endpoint. This can be supplied using the Spring {{<bean class="MyDataBinding"/>}} syntax. | | {{cxf:binding}} | You can specify the {{BindingFactory}} for this endpoint to use. This can be supplied using the Spring {{<bean class="MyBindingFactory"/>}} syntax. | | {{cxf:features}} | The features that hold the interceptors for this endpoint. A list of {{<bean>}}s or {{<ref>}}s | | {{cxf:schemaLocations}} | The schema locations for endpoint to use. A list of {{<schemaLocation>}}s | | {{cxf:serviceFactory}} | The service factory for this endpoint to use. This can be supplied using the Spring {{<bean class="MyServiceFactory"/>}} syntax | {div}
You can find more advanced examples which show how to provide interceptors , properties and handlers here:
http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html
...