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.
  • 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

      protected final AtomicBoolean getBusHasBeenCalled
  • Constructor Details

    • CxfEndpoint

      public CxfEndpoint()
    • CxfEndpoint

      public CxfEndpoint(String remaining, CxfComponent cxfComponent)
  • Method Details

    • copy

      public CxfEndpoint copy()
    • updateEndpointUri

      protected void updateEndpointUri(String endpointUri)
    • createProducer

      public org.apache.camel.Producer createProducer() throws Exception
      Specified by:
      createProducer in interface org.apache.camel.Endpoint
      Throws:
      Exception
    • createConsumer

      public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
      Specified by:
      createConsumer in interface org.apache.camel.Endpoint
      Throws:
      Exception
    • setupServerFactoryBean

      protected void setupServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean sfb, Class<?> cls)
      Populate server factory bean
    • createClientFactoryBean

      public 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)
    • createClient

      public org.apache.cxf.endpoint.Client createClient() throws Exception
      Create a CXF client object
      Throws:
      Exception
    • checkName

      public void checkName(Object value, String name)
    • createServerFactoryBean

      protected org.apache.cxf.frontend.ServerFactoryBean createServerFactoryBean() throws Exception
      Create a CXF server factory bean
      Throws:
      Exception
    • resolvePropertyPlaceholders

      protected String resolvePropertyPlaceholders(String str)
    • getBeanId

      public String getBeanId()
    • setBeanId

      public void setBeanId(String beanId)
    • 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

      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(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:
      setHeaderFilterStrategy in interface org.apache.camel.spi.HeaderFilterStrategyAware
    • getHeaderFilterStrategy

      public org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
      Specified by:
      getHeaderFilterStrategy in interface org.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

      public Map<String,Object> getProperties()
    • setCamelContext

      public void setCamelContext(org.apache.camel.CamelContext c)
      Specified by:
      setCamelContext in interface org.apache.camel.CamelContextAware
      Specified by:
      setCamelContext in interface org.apache.camel.Endpoint
      Overrides:
      setCamelContext in class org.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 class org.apache.camel.support.DefaultEndpoint
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      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()
    • setHandlers

      public void setHandlers(List<jakarta.xml.ws.handler.Handler> h)
    • getHandlers

      public List<jakarta.xml.ws.handler.Handler> getHandlers()
    • setSchemaLocations

      public void setSchemaLocations(List<String> sc)
    • getSchemaLocations

      public List<String> getSchemaLocations()
    • 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.
    • getSchemaValidationEnabled

      public Boolean getSchemaValidationEnabled()
    • setSchemaValidationEnabled

      public void setSchemaValidationEnabled(Boolean schemaValidationEnabled)