All you've got to do is something similar to:
// create the XML bindings
IBindingFactory bfact = BindingDirectory.getFactory("XXX", MyClass.class);
IUnmarshallingContext mctx = bfact.createUnmarshallingContext();
// unmarshall the XML to object
Object object = mctx.unmarshalDocument(new StringReader(xml));
if (logger.isLoggable(Level.INFO)) {
logger.fine("Retrieved XML: " + xml);
logger.fine("Unmarshalled to: " + object);
}
where XXX is the name of the binding you'd like to use, MyClass is the
class you are trying to deserialize to, and xml is the XML content as
a string.
Hope this helps,
Jérôme.
On 5/2/06, Jay Blanton <[EMAIL PROTECTED]> wrote:
I have a single object model that represents a response I get from a Web
Service.
The Web Service sends three different types of responses...with totally
different formats...that I want to push into the same object model.
I was going to create three separate binding files, but how would I know
through the factory and basing in my base Object...which binding file would
be used?
Can I do this?
Thanks,
--
jay blanton
[EMAIL PROTECTED]
--
Jérôme BERNARD,
Kalixia, SARL.
http://weblog.kalixia.com
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users