hi robert,

i hope that i understand your problem/needs correctly. if so, than you  
need to know that you can only marshall object structures that  
actually begin with the root object that you defined in the mapping  
file. so ExchangePermissionBO must be the root element of your  
resulting xml, and must be the first non-abstract mapping entry in  
your binding.xml.

jibx is not meant to transform objects to xml WITHOUT a defined entry  
point. a solution might be that you use a single binding for each  
class, and join them together as needed (i need to tell you that i  
haven't looked into the include mechanism in detail).

br,
günther



Am 14.11.2007 um 12:19 schrieb robert lazarski:

> Hi all,
>
> I've successfuly been following Dennis' though provoking article 'code
> first' and jibx2wsdl, adapting it to hibernate and axis2. All is
> working fine at the proof of concept level. Now I'm trying to marshal
> hibernate entities to an xml file / unmarshal xml files to hibernate
> entities - outside of an axis2 services.
>
> There's something I'm not getting with respect to the binding file:
> what is the purpose of the binding.xml when marshalling /
> unmarshalling pre-existing objects like hibernate? I mean to say, my
> binding.xml has those entities, so how do I tie that into
> IBindingFactory? For example, when executing:
>
>       IBindingFactory ibf = BindingDirectory.getFactory(clazz);
>        IMarshallingContext mctx = ibf.createMarshallingContext();
>        ByteArrayOutputStream output = new ByteArrayOutputStream();
>        try {
>            XMLOutputFactory ofact = XMLOutputFactory.newInstance();
>            XMLStreamWriter wrtr =  
> ofact.createXMLStreamWriter(output, "UTF-8");
>            mctx.setXmlWriter(new StAXWriter(ibf.getNamespaces(),  
> wrtr));
>            mctx.marshalDocument(bo);
>        } catch (XMLStreamException e) {
>            throw new JiBXException("Error creating writer", e);
>        }
>
> I get:
>
> "Supplied root object of class
> com.wazollc.alphatheory.hibernate.bo.ExchangePermissionBO cannot be
> marshalled without top-level mapping"
>
> When I try:
>
> IBindingFactory ibf =  
> BindingDirectory.getFactory(this.bindingFilePath, clazz);
>
> Its doesn't accept an InputStream argument and looking at the
> BindingDirectory code, things like bname don't appear to be actually
> loading the file. Anyways, I want to load my binding.xml off the
> classpath and simply passing "binding.xml" isn't working.
>
> Please help,
> Robert
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a  
> browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>



-- 
Günther Wieser
creative-it
Guglgasse 6/1/11/1
A-1110 Wien
[EMAIL PROTECTED]
http://www.creative-it.com




-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to