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.jaxws.CxfEndpoint
- All Implemented Interfaces:
AutoCloseable,Cloneable,org.apache.camel.AsyncEndpoint,org.apache.camel.CamelContextAware,org.apache.camel.ComponentAware,org.apache.camel.Endpoint,org.apache.camel.IsSingleton,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasCamelContext,org.apache.camel.spi.HasId,org.apache.camel.spi.HeaderFilterStrategyAware,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="1.0.0",
scheme="cxf",
title="CXF",
syntax="cxf:beanId:address",
category={HTTP,WEBSERVICE},
headersClass=org.apache.camel.component.cxf.common.message.CxfConstants.class)
@Metadata(annotations="protocol=http")
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassWe need to override theClientImpl.setParameters(java.lang.Object[], org.apache.cxf.message.Message)method to insert parameters into CXF Message forDataFormat.PAYLOADmode. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.cxf.Busprotected booleanprotected booleanprotected final AtomicBooleanFields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy()org.apache.cxf.endpoint.ClientCreate a CXF client objectprotected org.apache.cxf.frontend.ClientFactoryBeanCreate a client factory bean object without serviceClass interface.org.apache.cxf.frontend.ClientFactoryBeancreateClientFactoryBean(Class<?> cls) Create a client factory bean object.org.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor) org.apache.camel.Producerprotected org.apache.cxf.frontend.ServerFactoryBeanCreate a CXF server factory beanprotected voiddoInit()protected voiddoStop()org.apache.cxf.binding.BindingConfigurationorg.apache.cxf.BusgetBus()longorg.apache.camel.http.base.cookie.CookieHandlerorg.apache.camel.component.cxf.common.CxfBindingorg.apache.cxf.databinding.DataBindingorg.apache.camel.component.cxf.common.DataFormatList<org.apache.cxf.feature.Feature> List<jakarta.xml.ws.handler.Handler> org.apache.camel.spi.HeaderFilterStrategyList<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> intList<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> Class<?> org.apache.camel.support.jsse.SSLContextParametersbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanprotected StringvoidsetAddress(String address) The service publish address.voidsetAllowStreaming(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.voidvoidsetBindingConfig(org.apache.cxf.binding.BindingConfiguration bindingConfig) voidsetBindingId(String bindingId) The bindingId for the service model to use.voidsetBus(org.apache.cxf.Bus bus) To use a custom configured CXF Bus.voidsetCamelContext(org.apache.camel.CamelContext c) voidsetContinuationTimeout(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.voidsetCookieHandler(org.apache.camel.http.base.cookie.CookieHandler cookieHandler) Configure a cookie handler to maintain a HTTP sessionvoidsetCxfBinding(org.apache.camel.component.cxf.common.CxfBinding cxfBinding) To use a custom CxfBinding to control the binding between Camel Message and CXF Message.voidsetCxfConfigurer(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.voidsetDataBinding(org.apache.cxf.databinding.DataBinding dataBinding) voidsetDataFormat(org.apache.camel.component.cxf.common.DataFormat format) The data type messages supported by the CXF endpoint.voidsetDefaultBus(boolean defaultBus) Will set the default bus when CXF endpoint create a bus by itselfvoidThis option will set the default operationName that will be used by the CxfProducer which invokes the remote service.voidsetDefaultOperationNamespace(String namespace) This option will set the default operationNamespace that will be used by the CxfProducer which invokes the remote service.voidsetEndpointName(String name) voidsetEndpointNameAsQName(QName qName) voidsetFeatures(List<org.apache.cxf.feature.Feature> f) voidsetHandlers(List<jakarta.xml.ws.handler.Handler> h) voidsetHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy) To use a custom HeaderFilterStrategy to filter header to and from Camel message.voidsetHostnameVerifier(HostnameVerifier hostnameVerifier) The hostname verifier to be used.voidsetInFaultInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors) voidsetInInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors) voidsetLoggingFeatureEnabled(boolean loggingFeatureEnabled) This option enables CXF Logging Feature which writes inbound and outbound SOAP messages to log.voidsetLoggingSizeLimit(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.voidsetMergeProtocolHeaders(boolean mergeProtocolHeaders) Whether to merge protocol headers.voidsetMtomEnabled(boolean mtomEnabled) To enable MTOM (attachments).voidsetOutFaultInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors) voidsetOutInterceptors(List<org.apache.cxf.interceptor.Interceptor<? extends org.apache.cxf.message.Message>> interceptors) voidsetPassword(String password) This option is used to set the basic authentication information of password for the CXF client.voidsetPortName(String port) The endpoint name this service is implementing, it maps to the wsdl:port@name.voidsetPortNameAsQName(QName qName) voidsetProperties(Map<String, Object> properties) To set additional CXF options using the key/value pairs from the Map.voidThis option can override the endpointUrl that published from the WSDL which can be accessed with service address url plus ?voidsetSchemaLocations(List<String> sc) voidsetSchemaValidationEnabled(Boolean schemaValidationEnabled) voidsetServiceClass(Class<?> cls) The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.voidsetServiceClass(Object instance) The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.voidsetServiceClass(String type) The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.voidsetServiceFactory(Object serviceFactoryBean) voidsetServiceFactoryBean(Object serviceFactoryBean) voidsetServiceName(String service) The service name this service is implementing, it maps to the wsdl:service@name.voidsetServiceNameAsQName(QName qName) voidsetSkipFaultLogging(boolean skipFaultLogging) This option controls whether the PhaseInterceptorChain skips logging the Fault that it catches.voidsetSkipPayloadMessagePartCheck(boolean skipPayloadMessagePartCheck) Sets whether SOAP message validation should be disabled.voidsetSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) The Camel SSL setting reference.voidsetSynchronous(boolean synchronous) voidsetTransportId(String transportId) protected voidsetupClientFactoryBean(org.apache.cxf.frontend.ClientFactoryBean factoryBean, Class<?> cls) protected voidsetupHandlers(org.apache.cxf.frontend.ClientFactoryBean factoryBean, org.apache.cxf.endpoint.Client client) protected voidsetupServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean sfb, Class<?> cls) Populate server factory beanvoidsetUsername(String username) This option is used to set the basic authentication information of username for the CXF client.voidsetWrapped(boolean wrapped) Which kind of operation that CXF endpoint producer will invokevoidsetWrappedStyle(Boolean wrapped) The WSDL style that describes how parameters are represented in the SOAP body.voidsetWsdlURL(String url) The location of the WSDL.protected voidupdateEndpointUri(String endpointUri) Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, 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, toStringMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.ComponentAware
getComponent, getComponent, setComponentMethods inherited from interface org.apache.camel.Endpoint
configureExchange, configureProperties, createAsyncProducer, createExchange, createExchange, createPollingConsumer, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, getExchangePattern, isLenientProperties, isRemote, isSingletonProducerMethods inherited from interface org.apache.camel.IsSingleton
isSingletonMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Field Details
-
bus
@UriParam(label="advanced") protected org.apache.cxf.Bus bus -
defaultBus
@UriParam(label="advanced") protected boolean defaultBus -
createBus
protected volatile boolean createBus -
getBusHasBeenCalled
-
-
Constructor Details
-
CxfEndpoint
public CxfEndpoint() -
CxfEndpoint
-
-
Method Details
-
copy
-
updateEndpointUri
-
createProducer
- Specified by:
createProducerin interfaceorg.apache.camel.Endpoint- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Specified by:
createConsumerin interfaceorg.apache.camel.Endpoint- Throws:
Exception
-
setupServerFactoryBean
Populate server factory bean -
createClientFactoryBean
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) -
createClient
Create a CXF client object- Throws:
Exception
-
checkName
-
createServerFactoryBean
Create a CXF server factory bean- Throws:
Exception
-
resolvePropertyPlaceholders
-
getBeanId
-
setBeanId
-
getDataFormat
public org.apache.camel.component.cxf.common.DataFormat getDataFormat() -
setDataFormat
public void setDataFormat(org.apache.camel.component.cxf.common.DataFormat format) The data type messages supported by the CXF endpoint. -
getPublishedEndpointUrl
-
setPublishedEndpointUrl
This option can override the endpointUrl that published from the WSDL which can be accessed with service address url plus ?wsd -
getWsdlURL
-
setWsdlURL
The location of the WSDL. Can be on the classpath, file system, or be hosted remotely. -
getServiceClass
-
setServiceClass
The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not. -
setServiceClass
The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not. -
setServiceClass
The class name of the SEI (Service Endpoint Interface) class which could have JSR181 annotation or not.- Throws:
ClassNotFoundException
-
setServiceName
The service name this service is implementing, it maps to the wsdl:service@name. -
getServiceName
-
getServiceNameAsQName
-
setServiceNameAsQName
-
getPortNameAsQName
-
setPortNameAsQName
-
getPortName
-
setPortName
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
-
setEndpointNameAsQName
-
getDefaultOperationName
-
setDefaultOperationName
This option will set the default operationName that will be used by the CxfProducer which invokes the remote service. -
getDefaultOperationNamespace
-
setDefaultOperationNamespace
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
-
setWrappedStyle
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
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
-
setCxfBinding
public void setCxfBinding(org.apache.camel.component.cxf.common.CxfBinding cxfBinding) To use a custom CxfBinding to control the binding between Camel Message and CXF Message. -
getCxfBinding
public org.apache.camel.component.cxf.common.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:
setHeaderFilterStrategyin interfaceorg.apache.camel.spi.HeaderFilterStrategyAware
-
getHeaderFilterStrategy
public org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()- Specified by:
getHeaderFilterStrategyin 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. -
getProperties
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext c) - Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware- Specified by:
setCamelContextin interfaceorg.apache.camel.Endpoint- Overrides:
setCamelContextin classorg.apache.camel.support.DefaultEndpoint
-
setProperties
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
- Overrides:
doInitin classorg.apache.camel.support.DefaultEndpoint- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
setAddress
The service publish address. -
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
-
setPassword
This option is used to set the basic authentication information of password for the CXF client. -
getUsername
-
setUsername
This option is used to set the basic authentication information of username for the CXF client. -
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
-
getFeatures
-
setHandlers
-
getHandlers
-
setSchemaLocations
-
getSchemaLocations
-
getTransportId
-
setTransportId
-
getBindingId
-
setBindingId
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
-
setServiceFactoryBean
-
setServiceFactory
-
getCxfConfigurer
-
setCxfConfigurer
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
-
setHostnameVerifier
The hostname verifier to be used. Use the # notation to reference a HostnameVerifier from the registry. -
getSchemaValidationEnabled
-
setSchemaValidationEnabled
-