Hey Linus and everyone, thought I'd finish this thread and say that
combining what I learned about how jibx finds it binding classes in
the classloader - it uses the binding attribute name as part of the
name of the binding class to load - and using Linus' suggestion of
having the mapping listed twice in the binding file worked for me. So
after running jibxwsdl, I'm editing the file so it doesn't need to use
an abstract mapping when trying to do export / import outside of web
services.
Thanks everyone for helping,
Robert
On Nov 19, 2007 4:26 PM, Linus Kamb <[EMAIL PROTECTED]> wrote:
> Robert,
>
> We send objects out over the wire using Axis2/JiBX, and marshall out to
> disk as straight XML also using JiBX.
> We aren't using jibx2wsdl, but that should not be relevant.
>
> Below is a snippet from the mapping file:
>
> <mapping type-name="phase:PhaseQueryReturnType"
> class="edu.iris.ws.phasepick.PhasePickQueryReturn" abstract="true" >
> <structure name="IteratorInfo" field="iterator"
> map-as="phase:IteratorInfoType" usage="optional" />
> <collection field="events" >
> <structure name="Event" map-as="ws:EventType" />
> </collection>
> </mapping>
>
> <mapping name="PhaseQuery"
> class="edu.iris.ws.phasepick.PhasePickQueryReturn" >
> <!-- This mapping is used when writing the PhasePickQuery response
> to disk as XML. -->
> <collection field="events" >
> <structure name="Event" map-as="ws:EventType" />
> </collection>
> </mapping>
>
> note one abstract iwth a type-name, one concrete with a name. Same class.
>
> Below is snippet of code that does the marshalling to disk.
>
> private void bindDataToXml(PhasePickQueryReturn qReturn, File
> outputFile) throws JiBXException, FileNotFoundException, IOException {
> IBindingFactory bfact =
> BindingDirectory.getFactory(PhasePickQueryReturn.class);
> IMarshallingContext mctx = bfact.createMarshallingContext();
> FileOutputStream fout = new FileOutputStream(outputFile);
> mctx.marshalDocument(qReturn, "UTF-8", null, fout);
> fout.close();
> }
>
> Hope this helps,
> Linus
>
>
>
> robert lazarski wrote:
> > Hi Nigel,
> >
> > I can run axis2 web services just fine - the binding compiler is
> > working for me. What I can't figure out is how to prevent jib2wsdl
> > from creating abstract mappings or marshalling with an abstract type
> > and a type-name. If anyone has any ideas, please help.
> >
> > Robert
> >
> > On Nov 18, 2007 7:33 PM, Nigel Charman <[EMAIL PROTECTED]> wrote:
> >
> >> Hi Robert
> >>
> >> The IMarshallable interface is added to the class file by the JiBX
> >> binding compiler. So long as you are running the binding compiler, the
> >> IMarshallable interface will be available at runtime. In the Jibx2Wsdl
> >> examples, search for the "bind" taskdef in the build.xml file to see an
> >> example of invoking the binding compiler.
> >>
> >> Cheers
> >> Nigel
> >>
> >> robert lazarski wrote:
> >> <snip>
> >>
> >>> Yet 'ExchangePermissionBO bo' doesn't implement IMarshallable. You say
> >>> it doesn't need to. ok, so I'm approaching this wrong. What's the
> >>> right way - or any way - to do this?
> >>>
> >>> Please help,
> >>> Robert
> >>>
> >>>
> >>
> >>
> >> -------------------------------------------------------------------------
> >> This SF.net email is sponsored by: Microsoft
> >> Defy all challenges. Microsoft(R) Visual Studio 2005.
> >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> >> _______________________________________________
> >> jibx-users mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/jibx-users
> >>
> >>
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2005.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > jibx-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/jibx-users
> >
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> jibx-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users