public interface CustomBinder
CustomBinder
interface has two primary methods, serialize
and
deserialize
, and both methods deal with a Java object and a
javax.xml.soap.SOAPElement
.
Once the binder is recognized by the engine runtime, it communicates with the runtime via the SOAPElement in the following ways:
Serialization:
serialize
method is passed a Java object and
SOAPElement root.
IBMSOAPElement.getIBMSOAPFactory()
method to obtain a factory
for producing the child elements.
Deserialization:
deserialize
method is invoked by the runtime with an
IBMSOAPElement
representing
the xml data.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
QNAME_SCOPE_COMPLEXTYPE |
static java.lang.String |
QNAME_SCOPE_ELEMENT |
static java.lang.String |
QNAME_SCOPE_SIMPLETYPE |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
deserialize(javax.xml.soap.SOAPElement source,
CustomBindingContext context)
Deserialize the
SOAPElement to the Java object. |
java.lang.String |
getJavaName()
Return the class name of the java type to be handled by this CustomBinder
|
javax.xml.namespace.QName |
getQName()
Return the QName of the target XML schema type.
|
java.lang.String |
getQNameScope()
Return the qname scope of the target XML schema type.
|
javax.xml.soap.SOAPElement |
serialize(java.lang.Object bean,
javax.xml.soap.SOAPElement rootNode,
CustomBindingContext context)
Serialize the Java object to the SOAPElement.
|
static final java.lang.String QNAME_SCOPE_ELEMENT
static final java.lang.String QNAME_SCOPE_COMPLEXTYPE
static final java.lang.String QNAME_SCOPE_SIMPLETYPE
javax.xml.namespace.QName getQName()
java.lang.String getQNameScope()
java.lang.String getJavaName()
javax.xml.soap.SOAPElement serialize(java.lang.Object bean, javax.xml.soap.SOAPElement rootNode, CustomBindingContext context) throws javax.xml.soap.SOAPException
bean
- A Java object to be serialized by the custom binder.
The type for this Java object has to be compatiable with what's returned by
getJavaName()
.
If getJavaName()
returns a name for a concrete class, the class for this "bean"
object should be either the exact class or the derived class. If getJavaName()
returna a name for a Java interface, the class for this "bean" has to implement
this interface.
rootNode
- A SOAPElement
representing the root node upon which the custom binder operates.
This SOAPElement
is created by the runtime with the QName matching the
QName of the "element" element defined in the schema and it does not have any child elements.context
- An object representing the binding context.SOAPElement
representing the serialized XML data.javax.xml.soap.SOAPException
- when:
CustomBinder
java.lang.Object deserialize(javax.xml.soap.SOAPElement source, CustomBindingContext context) throws javax.xml.soap.SOAPException
SOAPElement
to the Java object.source
- a SOAPElement
representing the XML message from the wire. It has all necessary
namespace declarations, including those inherited from the parent element.context
- An object representing the binding context.SOAPElement
. Its type has to be
compatible with what's returned by the getJavaName()
method.javax.xml.soap.SOAPException
- when it fails to deserialize the passed SOAPElement
to
the appropriate object.CustomBinder