Package org.apache.camel.dataformat.soap
Class SoapDataFormat
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.converter.jaxb.JaxbDataFormat
org.apache.camel.dataformat.soap.SoapDataFormat
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.DataFormat
,org.apache.camel.spi.DataFormatContentTypeHeader
,org.apache.camel.spi.DataFormatName
,org.apache.camel.spi.HasCamelContext
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@Dataformat("soap")
public class SoapDataFormat
extends org.apache.camel.converter.jaxb.JaxbDataFormat
Data format supporting SOAP 1.1 and 1.2.
-
Field Summary
Fields 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
ConstructorDescriptionRemember to set the context path when using this constructorSoapDataFormat
(String contextPath) Initialize with JAXB context pathSoapDataFormat
(String contextPath, ElementNameStrategy elementNameStrategy) Initialize the data format. -
Method Summary
Modifier and TypeMethodDescriptioncreateContentFromObject
(Object inputObject, String soapAction) Create body content from a non Exception object.protected jakarta.xml.bind.JAXBContext
Added the generated SOAP package to the JAXB context so Soap datatypes are availableprotected void
doStart()
boolean
void
marshal
(org.apache.camel.Exchange exchange, Object inputObject, OutputStream stream) Marshal inputObjects to SOAP xml.void
setElementNameStrategy
(Object nameStrategy) void
setIgnoreUnmarshalledHeaders
(boolean ignoreUnmarshalledHeaders) void
setVersion
(String version) unmarshal
(org.apache.camel.Exchange exchange, InputStream stream) Unmarshal a given SOAP xml stream and return the content of the SOAP bodyMethods inherited from class org.apache.camel.converter.jaxb.JaxbDataFormat
createMarshaller, createUnmarshaller, doStop, getAccessExternalSchemaProtocols, getCamelContext, getContext, getContextPath, getEncoding, getJaxbProviderProperties, getNamespacePrefix, getNoNamespaceSchemaLocation, getPartClass, getPartNamespace, getSchema, getSchemaFactory, getSchemaLocation, getSchemaSeverityLevel, getXmlStreamWriterWrapper, isContentTypeHeader, isContextPathIsClassName, isFilterNonXmlChars, isFragment, isIgnoreJAXBElement, isMustBeJAXBElement, isObjectFactory, isPrettyPrint, needFiltering, setAccessExternalSchemaProtocols, setCamelContext, setContentTypeHeader, setContext, setContextPath, setContextPathIsClassName, setEncoding, setFilterNonXmlChars, setFragment, setIgnoreJAXBElement, setJaxbProviderProperties, setMustBeJAXBElement, setNamespacePrefix, setNoNamespaceSchemaLocation, setObjectFactory, setPartClass, setPartNamespace, setPrettyPrint, setSchema, setSchemaFactory, setSchemaLocation, setSchemaSeverityLevel, setXmlStreamWriterWrapper
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Field Details
-
SOAP_UNMARSHALLED_HEADER_LIST
- See Also:
-
-
Constructor Details
-
SoapDataFormat
public SoapDataFormat()Remember to set the context path when using this constructor -
SoapDataFormat
Initialize with JAXB context path -
SoapDataFormat
Initialize the data format. The serviceInterface is necessary to determine the element name and namespace of the element inside the soap body when marshalling
-
-
Method Details
-
getDataFormatName
- Specified by:
getDataFormatName
in interfaceorg.apache.camel.spi.DataFormatName
- Overrides:
getDataFormatName
in classorg.apache.camel.converter.jaxb.JaxbDataFormat
-
doStart
- Overrides:
doStart
in classorg.apache.camel.converter.jaxb.JaxbDataFormat
- Throws:
Exception
-
marshal
public void marshal(org.apache.camel.Exchange exchange, Object inputObject, OutputStream stream) throws IOException Marshal inputObjects to SOAP xml. If the exchange or message has an EXCEPTION_CAUGTH property or header then instead of the object the exception is marshaled. To determine the name of the top level xml elements the elementNameStrategy is used.- Specified by:
marshal
in interfaceorg.apache.camel.spi.DataFormat
- Overrides:
marshal
in classorg.apache.camel.converter.jaxb.JaxbDataFormat
- Throws:
IOException
-
createContentFromObject
Create body content from a non Exception object. So the interface should be in doc lit bare style.- Parameters:
inputObject
- object to be put into the SOAP bodysoapAction
- for name resolution- Returns:
- JAXBElement for the body content
-
unmarshal
Unmarshal a given SOAP xml stream and return the content of the SOAP body- Specified by:
unmarshal
in interfaceorg.apache.camel.spi.DataFormat
- Overrides:
unmarshal
in classorg.apache.camel.converter.jaxb.JaxbDataFormat
- Throws:
IOException
-
createContext
protected jakarta.xml.bind.JAXBContext createContext() throws jakarta.xml.bind.JAXBExceptionAdded the generated SOAP package to the JAXB context so Soap datatypes are available- Overrides:
createContext
in classorg.apache.camel.converter.jaxb.JaxbDataFormat
- Throws:
jakarta.xml.bind.JAXBException
-
getElementNameStrategy
-
setElementNameStrategy
-
isIgnoreUnmarshalledHeaders
public boolean isIgnoreUnmarshalledHeaders() -
setIgnoreUnmarshalledHeaders
public void setIgnoreUnmarshalledHeaders(boolean ignoreUnmarshalledHeaders) -
getVersion
-
setVersion
-