Hello,
I am trying to use Axis just to serialize (and deserialize) my arbitrary
java beans, that is, I don't really use the SOAP invocation side of Axis
right now.
I don't have any problems with serialization, as I enabled AutoTyping:
(i.e. mapping.setDoAutoTypes(true)). The serializationContext.serialize(...)
call produces the proper XML for the bean I'm trying to serialize, with no
SOAP-related elements, which I don't need anyway... The simple serialized
bean (complete XML document) would look like this:
<ns1:ENSEvent xmlns:ns1="urn:ENS">
<groupLast xsi:type="xsd:boolean"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
false
</groupLast>
<groupSeq xsi:type="xsd:int"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
0
</groupSeq>
<timestamp xsi:type="xsd:long"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
1045342453230
</timestamp>
</ns1:ENSEvent>
With DEserialization, however, I could use some help:
My approach to deserialization is to create a DeserializationContextImpl
instance, and use its parse() method (not sure if it is the best way).
Unfortunately, among three Constructors, which DeserializationContextImpl
provides, none seem to be working for me. First two:
DeserializationContextImpl(
org.xml.sax.InputSource is,
MessageContext ctx,
java.lang.String messageType)
DeserializationContextImpl(
org.xml.sax.InputSource is,
MessageContext ctx,
java.lang.String messageType,
SOAPEnvelope env)
require Input XML to contain SOAP tags (right?). The third one seems like an
appropriate alternative:
DeserializationContextImpl(
MessageContext ctx,
SOAPHandler initialHandler)
because it allows me to skip EnvelopeBuilder, but for some reason it does
not accept InputSource parameter.
Well, this is basically my question: how to deserialize the bean from
AXIS-produced XML, if the XML doesn't contain SOAP tags.
Thank you in advance,
Igor