Package org.apache.camel.component.cxf
Class CxfEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.component.cxf.CxfEndpoint
-
- All Implemented Interfaces:
AutoCloseable
,Cloneable
,org.apache.camel.AsyncEndpoint
,org.apache.camel.CamelContextAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasId
,org.apache.camel.spi.HeaderFilterStrategyAware
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
- Direct Known Subclasses:
CxfSpringEndpoint
@UriEndpoint(firstVersion="1.0.0", scheme="cxf", title="CXF", syntax="cxf:beanId:address", category={SOAP,WEBSERVICE}) public class CxfEndpoint extends org.apache.camel.support.DefaultEndpoint implements org.apache.camel.AsyncEndpoint, org.apache.camel.spi.HeaderFilterStrategyAware, org.apache.camel.Service, Cloneable
Expose SOAP WebServices using Apache CXF or connect to external WebServices using CXF WS client.
-
-
Constructor Summary
Constructors Constructor Description CxfEndpoint()
CxfEndpoint(String remaining, CxfComponent cxfComponent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CxfEndpoint
copy()
protected org.apache.cxf.frontend.ClientFactoryBean
createClientFactoryBean()
Create a client factory bean object without serviceClass interface.protected org.apache.cxf.frontend.ClientFactoryBean
createClientFactoryBean(Class<?> cls)
Create a client factory bean object.org.apache.camel.Consumer
createConsumer(org.apache.camel.Processor processor)
org.apache.camel.Producer
createProducer()
protected void
doInit()
protected void
doStop()
String
getAddress()
Boolean
getAllowStreaming()
String
getBeanId()
org.apache.cxf.binding.BindingConfiguration
getBindingConfig()
String
getBindingId()
org.apache.cxf.Bus
getBus()
CxfConfigurer
getChainedCxfConfigurer()
long
getContinuationTimeout()
org.apache.camel.http.base.cookie.CookieHandler
getCookieHandler()
CxfBinding
getCxfBinding()
CxfConfigurer
getCxfConfigurer()
org.apache.cxf.databinding.DataBinding
getDataBinding()
DataFormat
getDataFormat()
String
getDefaultOperationName()
String
getDefaultOperationNamespace()
List<org.apache.cxf.feature.Feature>
getFeatures()
List<Handler>
getHandlers()
org.apache.camel.spi.HeaderFilterStrategy
getHeaderFilterStrategy()
HostnameVerifier
getHostnameVerifier()
List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>>
getInFaultInterceptors()
List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>>
getInInterceptors()
int
getLoggingSizeLimit()
List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>>
getOutFaultInterceptors()
List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>>
getOutInterceptors()
String
getPassword()
String
getPortName()
QName
getPortNameAsQName()
Map<String,Object>
getProperties()
String
getPublishedEndpointUrl()
List<String>
getSchemaLocations()
Class<?>
getServiceClass()
Object
getServiceFactoryBean()
String
getServiceName()
QName
getServiceNameAsQName()
org.apache.camel.support.jsse.SSLContextParameters
getSslContextParameters()
String
getTransportId()
String
getUsername()
Boolean
getWrappedStyle()
String
getWsdlURL()
boolean
isDefaultBus()
boolean
isLoggingFeatureEnabled()
boolean
isMergeProtocolHeaders()
boolean
isMtomEnabled()
boolean
isSkipFaultLogging()
boolean
isSkipPayloadMessagePartCheck()
boolean
isSynchronous()
boolean
isWrapped()
protected String
resolvePropertyPlaceholders(String str)
void
setAddress(String address)
The service publish address.void
setAllowStreaming(Boolean allowStreaming)
This option controls whether the CXF component, when running in PAYLOAD mode, 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.void
setBeanId(String beanId)
void
setBindingConfig(org.apache.cxf.binding.BindingConfiguration bindingConfig)
void
setBindingId(String bindingId)
The bindingId for the service model to use.void
setBus(org.apache.cxf.Bus bus)
To use a custom configured CXF Bus.void
setCamelContext(org.apache.camel.CamelContext c)
void
setContinuationTimeout(long continuationTimeout)
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.void
setCookieHandler(org.apache.camel.http.base.cookie.CookieHandler cookieHandler)
Configure a cookie handler to maintain a HTTP sessionvoid
setCxfBinding(CxfBinding cxfBinding)
To use a custom CxfBinding to control the binding between Camel Message and CXF Message.void
setCxfConfigurer(CxfConfigurer configurer)
This option could apply the implementation of org.apache.camel.component.cxf.CxfEndpointConfigurer which supports to configure the CXF endpoint in programmatic way.void
setDataBinding(org.apache.cxf.databinding.DataBinding dataBinding)
void
setDataFormat(DataFormat format)
The data type messages supported by the CXF endpoint.void
setDefaultBus(boolean defaultBus)
Will set the default bus when CXF endpoint create a bus by itselfvoid
setDefaultOperationName(String name)
This option will set the default operationName that will be used by the CxfProducer which invokes the remote service.void
setDefaultOperationNamespace(String namespace)
This option will set the default operationNamespace that will be used by the CxfProducer which invokes the remote service.void
setEndpointName(String name)
void
setEndpointNameAsQName(QName qName)
void
setFeatures(List<org.apache.cxf.feature.Feature> f)
void
setHandlers(List<Handler> h)
void
setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
To use a custom HeaderFilterStrategy to filter header to and from Camel message.void
setHostnameVerifier(HostnameVerifier hostnameVerifier)
The hostname verifier to be used.void
setInFaultInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors)
void
setInInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors)
void
setLoggingFeatureEnabled(boolean loggingFeatureEnabled)
This option enables CXF Logging Feature which writes inbound and outbound SOAP messages to log.void
setLoggingSizeLimit(int loggingSizeLimit)
To limit the total size of number of bytes the logger will output when logging feature has been enabled and -1 for no limit.void
setMergeProtocolHeaders(boolean mergeProtocolHeaders)
Whether to merge protocol headers.void
setMtomEnabled(boolean mtomEnabled)
To enable MTOM (attachments).void
setOutFaultInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors)
void
setOutInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors)
void
setPassword(String password)
This option is used to set the basic authentication information of password for the CXF client.void
setPortName(String port)
The endpoint name this service is implementing, it maps to the wsdl:port@name.void
setPortNameAsQName(QName qName)
void
setProperties(Map<String,Object> properties)
To set additional CXF options using the key/value pairs from the Map.void
setPublishedEndpointUrl(String url)
This option can override the endpointUrl that published from the WSDL which can be accessed with service address url plus ?wsdvoid
setSchemaLocations(List<String> sc)
void
setServiceClass(Class<?> cls)
The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.void
setServiceClass(Object instance)
The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.void
setServiceClass(String type)
The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.void
setServiceFactory(Object serviceFactoryBean)
void
setServiceFactoryBean(Object serviceFactoryBean)
void
setServiceName(String service)
The service name this service is implementing, it maps to the wsdl:service@name.void
setServiceNameAsQName(QName qName)
void
setSkipFaultLogging(boolean skipFaultLogging)
This option controls whether the PhaseInterceptorChain skips logging the Fault that it catches.void
setSkipPayloadMessagePartCheck(boolean skipPayloadMessagePartCheck)
Sets whether SOAP message validation should be disabled.void
setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
The Camel SSL setting reference.void
setSynchronous(boolean synchronous)
void
setTransportId(String transportId)
protected void
setupClientFactoryBean(org.apache.cxf.frontend.ClientFactoryBean factoryBean, Class<?> cls)
protected void
setupHandlers(org.apache.cxf.frontend.ClientFactoryBean factoryBean, org.apache.cxf.endpoint.Client client)
protected void
setupServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean sfb, Class<?> cls)
Populate server factory beanvoid
setUsername(String username)
This option is used to set the basic authentication information of username for the CXF client.void
setWrapped(boolean wrapped)
Which kind of operation that CXF endpoint producer will invokevoid
setWrappedStyle(Boolean wrapped)
The WSDL style that describes how parameters are represented in the SOAP body.void
setWsdlURL(String url)
The location of the WSDL.protected void
updateEndpointUri(String endpointUri)
-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doStart, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.camel.Endpoint
configureExchange, configureProperties, createAsyncProducer, createExchange, createExchange, createPollingConsumer, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, getExchangePattern, isLenientProperties, isSingletonProducer
-
-
-
-
Constructor Detail
-
CxfEndpoint
public CxfEndpoint()
-
CxfEndpoint
public CxfEndpoint(String remaining, CxfComponent cxfComponent)
-
-
Method Detail
-
copy
public CxfEndpoint copy()
-
updateEndpointUri
protected void updateEndpointUri(String endpointUri)
-
createProducer
public org.apache.camel.Producer createProducer() throws Exception
- Specified by:
createProducer
in interfaceorg.apache.camel.Endpoint
- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
- Specified by:
createConsumer
in interfaceorg.apache.camel.Endpoint
- Throws:
Exception
-
setupServerFactoryBean
protected void setupServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean sfb, Class<?> cls)
Populate server factory bean
-
createClientFactoryBean
protected org.apache.cxf.frontend.ClientFactoryBean createClientFactoryBean(Class<?> cls)
Create a client factory bean object. Notice that the serviceClass must be an interface.
-
createClientFactoryBean
protected org.apache.cxf.frontend.ClientFactoryBean createClientFactoryBean()
Create a client factory bean object without serviceClass interface.
-
setupHandlers
protected void setupHandlers(org.apache.cxf.frontend.ClientFactoryBean factoryBean, org.apache.cxf.endpoint.Client client) throws Exception
- Throws:
Exception
-
setupClientFactoryBean
protected void setupClientFactoryBean(org.apache.cxf.frontend.ClientFactoryBean factoryBean, Class<?> cls)
-
getBeanId
public String getBeanId()
-
setBeanId
public void setBeanId(String beanId)
-
getDataFormat
public DataFormat getDataFormat()
-
setDataFormat
public void setDataFormat(DataFormat format)
The data type messages supported by the CXF endpoint.
-
getPublishedEndpointUrl
public String getPublishedEndpointUrl()
-
setPublishedEndpointUrl
public void setPublishedEndpointUrl(String url)
This option can override the endpointUrl that published from the WSDL which can be accessed with service address url plus ?wsd
-
getWsdlURL
public String getWsdlURL()
-
setWsdlURL
public void setWsdlURL(String url)
The location of the WSDL. Can be on the classpath, file system, or be hosted remotely.
-
getServiceClass
public Class<?> getServiceClass()
-
setServiceClass
public void setServiceClass(Class<?> cls)
The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.
-
setServiceClass
public void setServiceClass(Object instance)
The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.
-
setServiceClass
public void setServiceClass(String type) throws ClassNotFoundException
The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.- Throws:
ClassNotFoundException
-
setServiceName
public void setServiceName(String service)
The service name this service is implementing, it maps to the wsdl:service@name.
-
getServiceName
public String getServiceName()
-
getServiceNameAsQName
public QName getServiceNameAsQName()
-
setServiceNameAsQName
public void setServiceNameAsQName(QName qName)
-
getPortNameAsQName
public QName getPortNameAsQName()
-
setPortNameAsQName
public void setPortNameAsQName(QName qName)
-
getPortName
public String getPortName()
-
setPortName
public void setPortName(String port)
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.
-
setEndpointName
public void setEndpointName(String name)
-
setEndpointNameAsQName
public void setEndpointNameAsQName(QName qName)
-
getDefaultOperationName
public String getDefaultOperationName()
-
setDefaultOperationName
public void setDefaultOperationName(String name)
This option will set the default operationName that will be used by the CxfProducer which invokes the remote service.
-
getDefaultOperationNamespace
public String getDefaultOperationNamespace()
-
setDefaultOperationNamespace
public void setDefaultOperationNamespace(String namespace)
This option will set the default operationNamespace that will be used by the CxfProducer which invokes the remote service.
-
isWrapped
public boolean isWrapped()
-
setWrapped
public void setWrapped(boolean wrapped)
Which kind of operation that CXF endpoint producer will invoke
-
getWrappedStyle
public Boolean getWrappedStyle()
-
setWrappedStyle
public void setWrappedStyle(Boolean wrapped)
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
-
setAllowStreaming
public void setAllowStreaming(Boolean allowStreaming)
This option controls whether the CXF component, when running in PAYLOAD mode, 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.
-
getAllowStreaming
public Boolean getAllowStreaming()
-
setCxfBinding
public void setCxfBinding(CxfBinding cxfBinding)
To use a custom CxfBinding to control the binding between Camel Message and CXF Message.
-
getCxfBinding
public CxfBinding getCxfBinding()
-
setHeaderFilterStrategy
public void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
To use a custom HeaderFilterStrategy to filter header to and from Camel message.- Specified by:
setHeaderFilterStrategy
in interfaceorg.apache.camel.spi.HeaderFilterStrategyAware
-
getHeaderFilterStrategy
public org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
- Specified by:
getHeaderFilterStrategy
in interfaceorg.apache.camel.spi.HeaderFilterStrategyAware
-
setBus
public void setBus(org.apache.cxf.Bus bus)
To use a custom configured CXF Bus.
-
getBus
public org.apache.cxf.Bus getBus()
-
setDefaultBus
public void setDefaultBus(boolean defaultBus)
Will set the default bus when CXF endpoint create a bus by itself
-
isDefaultBus
public boolean isDefaultBus()
-
setLoggingFeatureEnabled
public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled)
This option enables CXF Logging Feature which writes inbound and outbound SOAP messages to log.
-
isLoggingFeatureEnabled
public boolean isLoggingFeatureEnabled()
-
getLoggingSizeLimit
public int getLoggingSizeLimit()
-
setLoggingSizeLimit
public void setLoggingSizeLimit(int loggingSizeLimit)
To limit the total size of number of bytes the logger will output when logging feature has been enabled and -1 for no limit.
-
isSkipPayloadMessagePartCheck
public boolean isSkipPayloadMessagePartCheck()
-
setSkipPayloadMessagePartCheck
public void setSkipPayloadMessagePartCheck(boolean skipPayloadMessagePartCheck)
Sets whether SOAP message validation should be disabled.
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext c)
- Specified by:
setCamelContext
in interfaceorg.apache.camel.CamelContextAware
- Specified by:
setCamelContext
in interfaceorg.apache.camel.Endpoint
- Overrides:
setCamelContext
in classorg.apache.camel.support.DefaultEndpoint
-
setProperties
public void setProperties(Map<String,Object> properties)
To set additional CXF options using the key/value pairs from the Map. For example to turn on stacktraces in SOAP faults, properties.faultStackTraceEnabled=true
-
getCookieHandler
public org.apache.camel.http.base.cookie.CookieHandler getCookieHandler()
-
setCookieHandler
public void setCookieHandler(org.apache.camel.http.base.cookie.CookieHandler cookieHandler)
Configure a cookie handler to maintain a HTTP session
-
isSynchronous
public boolean isSynchronous()
-
setSynchronous
public void setSynchronous(boolean synchronous)
-
doInit
protected void doInit() throws Exception
- Overrides:
doInit
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
-
setAddress
public void setAddress(String address)
The service publish address.
-
getAddress
public String getAddress()
-
setMtomEnabled
public void setMtomEnabled(boolean mtomEnabled)
To enable MTOM (attachments). This requires to use POJO or PAYLOAD data format mode.
-
isMtomEnabled
public boolean isMtomEnabled()
-
getPassword
public String getPassword()
-
setPassword
public void setPassword(String password)
This option is used to set the basic authentication information of password for the CXF client.
-
getUsername
public String getUsername()
-
setUsername
public void setUsername(String username)
This option is used to set the basic authentication information of username for the CXF client.
-
getChainedCxfConfigurer
public CxfConfigurer getChainedCxfConfigurer()
-
getOutFaultInterceptors
public List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> getOutFaultInterceptors()
-
getInFaultInterceptors
public List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> getInFaultInterceptors()
-
getInInterceptors
public List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> getInInterceptors()
-
getOutInterceptors
public List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> getOutInterceptors()
-
setInInterceptors
public void setInInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors)
-
setInFaultInterceptors
public void setInFaultInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors)
-
setOutInterceptors
public void setOutInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors)
-
setOutFaultInterceptors
public void setOutFaultInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors)
-
setFeatures
public void setFeatures(List<org.apache.cxf.feature.Feature> f)
-
getFeatures
public List<org.apache.cxf.feature.Feature> getFeatures()
-
getTransportId
public String getTransportId()
-
setTransportId
public void setTransportId(String transportId)
-
getBindingId
public String getBindingId()
-
setBindingId
public void setBindingId(String bindingId)
The bindingId for the service model to use.
-
getBindingConfig
public org.apache.cxf.binding.BindingConfiguration getBindingConfig()
-
isSkipFaultLogging
public boolean isSkipFaultLogging()
-
setSkipFaultLogging
public void setSkipFaultLogging(boolean skipFaultLogging)
This option controls whether the PhaseInterceptorChain skips logging the Fault that it catches.
-
isMergeProtocolHeaders
public boolean isMergeProtocolHeaders()
-
setMergeProtocolHeaders
public void setMergeProtocolHeaders(boolean mergeProtocolHeaders)
Whether to merge protocol headers. If enabled then propagating headers between Camel and CXF becomes more consistent and similar. For more details see CAMEL-6393.
-
setBindingConfig
public void setBindingConfig(org.apache.cxf.binding.BindingConfiguration bindingConfig)
-
getDataBinding
public org.apache.cxf.databinding.DataBinding getDataBinding()
-
setDataBinding
public void setDataBinding(org.apache.cxf.databinding.DataBinding dataBinding)
-
getServiceFactoryBean
public Object getServiceFactoryBean()
-
setServiceFactoryBean
public void setServiceFactoryBean(Object serviceFactoryBean)
-
setServiceFactory
public void setServiceFactory(Object serviceFactoryBean)
-
getCxfConfigurer
public CxfConfigurer getCxfConfigurer()
-
setCxfConfigurer
public void setCxfConfigurer(CxfConfigurer configurer)
This option could apply the implementation of org.apache.camel.component.cxf.CxfEndpointConfigurer which supports to configure the CXF endpoint in programmatic way. User can configure the CXF server and client by implementing configure{Server|Client} method of CxfEndpointConfigurer.
-
getContinuationTimeout
public long getContinuationTimeout()
-
setContinuationTimeout
public void setContinuationTimeout(long continuationTimeout)
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.
-
getSslContextParameters
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters()
-
setSslContextParameters
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
The Camel SSL setting reference. Use the # notation to reference the SSL Context.
-
getHostnameVerifier
public HostnameVerifier getHostnameVerifier()
-
setHostnameVerifier
public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
The hostname verifier to be used. Use the # notation to reference a HostnameVerifier from the registry.
-
-