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
FieldsFields 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
ConstructorsConstructorDescriptionRemember 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.JAXBContextAdded the generated SOAP package to the JAXB context so Soap datatypes are availableprotected voiddoStart()booleanvoidmarshal(org.apache.camel.Exchange exchange, Object inputObject, OutputStream stream) Marshal inputObjects to SOAP xml.voidsetElementNameStrategy(Object nameStrategy) voidsetIgnoreUnmarshalledHeaders(boolean ignoreUnmarshalledHeaders) voidsetVersion(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, setXmlStreamWriterWrapperMethods 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, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
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:
getDataFormatNamein interfaceorg.apache.camel.spi.DataFormatName- Overrides:
getDataFormatNamein classorg.apache.camel.converter.jaxb.JaxbDataFormat
-
doStart
- Overrides:
doStartin 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:
marshalin interfaceorg.apache.camel.spi.DataFormat- Overrides:
marshalin 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:
unmarshalin interfaceorg.apache.camel.spi.DataFormat- Overrides:
unmarshalin 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:
createContextin 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
-