You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Li Shen <li...@gmail.com> on 2006/10/09 03:54:10 UTC

Can JAXB/XMLBeans work with axis binding now

Hi,

I noticed that in the helloworldws sample, now only SDO gets used. If I want
to use JAXB/XMLBeans instead of SDO, what shall I do then?

Basically, I know I may need to register the SCDL of JAXB/XMLBeans to my
Tuscany runtime, and replace some configurations such as
@DataType(name="commonj.sdo.DataObject") and <dbsdo/> in helloworldws with
JAXB/XMLBeans specific stuff. Is that correct? How will <dbjaxb/> and
<dbxmlbeans/>look like? The same as SDO? Also, looks like for now there is
still no SCDL available for JAXB/XMLBeans, do you guys have any plan to add
them?

Thanks,
Li


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


RE: Can JAXB/XMLBeans work with axis binding now

Posted by Li Shen <li...@gmail.com>.
> -----Original Message-----
> From: Jim Marino [mailto:jmarino@myromatours.com]
> Sent: Tuesday, October 10, 2006 9:26 AM
> To: tuscany-dev@ws.apache.org
> Subject: Re: Can JAXB/XMLBeans work with axis binding now
> 
> Li, I think it would be great if we can get some of the JAXB and
> XMLBeans stuff working.

I think I can have a try later.

> I have a feeling it may be required for XBeans. Li, do you know
> offhand how custom types are loaded in XBeans (and the JAXB RI for
> that matter)?

I've not yet worked with JAXB/XMLBeans.

>From the JAXB tutorial, I saw that to load custom types, looks like JAXB
requires the package name of the pre-generated classes:

JAXBContext jc = JAXBContext.newInstance( "primer.po" );

Not sure if we need to tell the data binding framework the package name
"primer.po". 

For regular XMLBeans usage, looks like we may directly use the pre-generated
classes to do marshalling/unmarshalling:

customType.Factory.parse(); // unmarshal

customType.newXMLStreamReader() // marshal

But when doing unmarshalling, the data binding framework simply use the
generic XmlObject.Factory.parse() instead of the pre-generated class, and I
don't know how it works?

Raymond, would you please clarify? Thanks

> 
> Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Can JAXB/XMLBeans work with axis binding now

Posted by Jim Marino <jm...@myromatours.com>.
On Oct 9, 2006, at 6:12 PM, Raymond Feng wrote:

> Hi,
>
> Please see my comments below.
>
> Thanks,
> Raymond
>
> ----- Original Message ----- From: "Li Shen" <li...@gmail.com>
> To: <tu...@ws.apache.org>
> Sent: Sunday, October 08, 2006 6:54 PM
> Subject: Can JAXB/XMLBeans work with axis binding now
>
>
>> Hi,
>>
>> I noticed that in the helloworldws sample, now only SDO gets used.  
>> If I want
>> to use JAXB/XMLBeans instead of SDO, what shall I do then?
>>
>
> It's simple, just declare a component reference wired to the  
> composite reference with the ws (axis2) binding. For the interface  
> of your component reference, annotate it with @DataType 
> (name="org.apache.xmlbeans.XmlObject") or @DataType 
> (name="javax.xml.bind.JAXBElement").
This reminded me to pick up the discussion of where we specify the  
data binding. I think this only should be specified when using Java  
as an IDL really. I know Jeremy is going to add that we should allow  
this to be specified in the implementation for people that cast from  
a strongly typed parameter to a loosely typed one (e.g. DataObject)  
so I'm going to pre-empt him ;-) I'm pretty sure people agree this is  
bad programming practice/design so the question is whether we  
accommodate them. While we may "support" this in terms of it works,  
we should never advertise it in practice. Anyway, this sounds like we  
should spin this discussion into a separate thread so Raymond, maybe  
you want to pick it back up in another email?

> For example,
>
> @Remotable
> @DataType(name="javax.xml.bind.JAXBElement")
> public interface JAXBInterface {
>   Address getAddress(Customer);
> }
>
> @Remotable
> @DataType(name="org.apache.xmlbeans.XmlObject")
> public interface XMLBeansInterface {
>   Address getAddress(Customer);
> }
>
> To be honest, I haven't had a chance to perform the integration  
> test for JAXB and XMLBeans. But I would be glad to help you if you  
> run into any issues.
>
Li, I think it would be great if we can get some of the JAXB and  
XMLBeans stuff working.

>> Basically, I know I may need to register the SCDL of JAXB/XMLBeans  
>> to my
>> Tuscany runtime, and replace some configurations such as
>> @DataType(name="commonj.sdo.DataObject") and <dbsdo/> in  
>> helloworldws with
>> JAXB/XMLBeans specific stuff. Is that correct? How will <dbjaxb/> and
>> <dbxmlbeans/>look like? The same as SDO? Also, looks like for now  
>> there is
>> still no SCDL available for JAXB/XMLBeans, do you guys have any  
>> plan to add
>> them?
>>
>
> The SCDL extension dbsdo is used to import the model for SDO which  
> requires a type system. For JAXB and XMLBeans, it may not be  
> required. If you see any requirements for such extensions, please  
> post this list.
>
I have a feeling it may be required for XBeans. Li, do you know  
offhand how custom types are loaded in XBeans (and the JAXB RI for  
that matter)?

Jim

>> Thanks,
>> Li
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


RE: Can JAXB/XMLBeans work with axis binding now

Posted by Li Shen <li...@gmail.com>.
Thanks Raymond. I will try to test the XMLBeans/JAXB stuff with WS binding. 

> -----Original Message-----
> From: Raymond Feng [mailto:enjoyjava@gmail.com]
> Sent: Tuesday, October 10, 2006 9:13 AM
> To: tuscany-dev@ws.apache.org
> Subject: Re: Can JAXB/XMLBeans work with axis binding now
> 
> Hi,
> 
> Please see my comments below.
> 
> Thanks,
> Raymond
> 
> ----- Original Message -----
> From: "Li Shen" <li...@gmail.com>
> To: <tu...@ws.apache.org>
> Sent: Sunday, October 08, 2006 6:54 PM
> Subject: Can JAXB/XMLBeans work with axis binding now
> 
> 
> > Hi,
> >
> > I noticed that in the helloworldws sample, now only SDO gets used. If I
> > want
> > to use JAXB/XMLBeans instead of SDO, what shall I do then?
> >
> 
> It's simple, just declare a component reference wired to the composite
> reference with the ws (axis2) binding. For the interface of your component
> reference, annotate it with
@DataType(name="org.apache.xmlbeans.XmlObject")
> or @DataType(name="javax.xml.bind.JAXBElement").
> 
> For example,
> 
> @Remotable
> @DataType(name="javax.xml.bind.JAXBElement")
> public interface JAXBInterface {
>    Address getAddress(Customer);
> }
> 
> @Remotable
> @DataType(name="org.apache.xmlbeans.XmlObject")
> public interface XMLBeansInterface {
>    Address getAddress(Customer);
> }
> 
> To be honest, I haven't had a chance to perform the integration test for
> JAXB and XMLBeans. But I would be glad to help you if you run into any
> issues.
> 
> > Basically, I know I may need to register the SCDL of JAXB/XMLBeans to my
> > Tuscany runtime, and replace some configurations such as
> > @DataType(name="commonj.sdo.DataObject") and <dbsdo/> in helloworldws
> with
> > JAXB/XMLBeans specific stuff. Is that correct? How will <dbjaxb/> and
> > <dbxmlbeans/>look like? The same as SDO? Also, looks like for now there
is
> > still no SCDL available for JAXB/XMLBeans, do you guys have any plan to
> > add
> > them?
> >
> 
> The SCDL extension dbsdo is used to import the model for SDO which
requires
> a type system. For JAXB and XMLBeans, it may not be required. If you see
any
> requirements for such extensions, please post this list.
> 
> > Thanks,
> > Li
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Can JAXB/XMLBeans work with axis binding now

Posted by Raymond Feng <en...@gmail.com>.
Hi,

Please see my comments below.

Thanks,
Raymond

----- Original Message ----- 
From: "Li Shen" <li...@gmail.com>
To: <tu...@ws.apache.org>
Sent: Sunday, October 08, 2006 6:54 PM
Subject: Can JAXB/XMLBeans work with axis binding now


> Hi,
>
> I noticed that in the helloworldws sample, now only SDO gets used. If I 
> want
> to use JAXB/XMLBeans instead of SDO, what shall I do then?
>

It's simple, just declare a component reference wired to the composite 
reference with the ws (axis2) binding. For the interface of your component 
reference, annotate it with @DataType(name="org.apache.xmlbeans.XmlObject") 
or @DataType(name="javax.xml.bind.JAXBElement").

For example,

@Remotable
@DataType(name="javax.xml.bind.JAXBElement")
public interface JAXBInterface {
   Address getAddress(Customer);
}

@Remotable
@DataType(name="org.apache.xmlbeans.XmlObject")
public interface XMLBeansInterface {
   Address getAddress(Customer);
}

To be honest, I haven't had a chance to perform the integration test for 
JAXB and XMLBeans. But I would be glad to help you if you run into any 
issues.

> Basically, I know I may need to register the SCDL of JAXB/XMLBeans to my
> Tuscany runtime, and replace some configurations such as
> @DataType(name="commonj.sdo.DataObject") and <dbsdo/> in helloworldws with
> JAXB/XMLBeans specific stuff. Is that correct? How will <dbjaxb/> and
> <dbxmlbeans/>look like? The same as SDO? Also, looks like for now there is
> still no SCDL available for JAXB/XMLBeans, do you guys have any plan to 
> add
> them?
>

The SCDL extension dbsdo is used to import the model for SDO which requires 
a type system. For JAXB and XMLBeans, it may not be required. If you see any 
requirements for such extensions, please post this list.

> Thanks,
> Li
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Can JAXB/XMLBeans work with axis binding now

Posted by Li Shen <li...@gmail.com>.
Sorry, I don't know that before. Thanks for your help, Jeremy!

Li

2006/10/9, Jeremy Boynes <jb...@apache.org>:
>
> Li, your email is being held in a moderation queue as you are not
> subscribed to the mailing list. I've modded one copy through.
> --
> Jeremy
>
> On Oct 8, 2006, at 6:54 PM, Li Shen wrote:
>
> > Hi,
> >
> > I noticed that in the helloworldws sample, now only SDO gets used.
> > If I want
> > to use JAXB/XMLBeans instead of SDO, what shall I do then?
> >
> > Basically, I know I may need to register the SCDL of JAXB/XMLBeans
> > to my
> > Tuscany runtime, and replace some configurations such as
> > @DataType(name="commonj.sdo.DataObject") and <dbsdo/> in
> > helloworldws with
> > JAXB/XMLBeans specific stuff. Is that correct? How will <dbjaxb/> and
> > <dbxmlbeans/>look like? The same as SDO? Also, looks like for now
> > there is
> > still no SCDL available for JAXB/XMLBeans, do you guys have any
> > plan to add
> > them?
> >
> > Thanks,
> > Li
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
>
>

RE: Can JAXB/XMLBeans work with axis binding now

Posted by Li Shen <sh...@bea.com>.
Sorry, I don't know that before. Thanks for your help, Jeremy!

Li
> -----Original Message-----
> From: Jeremy Boynes [mailto:jboynes@apache.org]
> Sent: Monday, October 09, 2006 12:55 PM
> To: Li Shen
> Cc: tuscany-dev@ws.apache.org
> Subject: Re: Can JAXB/XMLBeans work with axis binding now
> 
> Li, your email is being held in a moderation queue as you are not
> subscribed to the mailing list. I've modded one copy through.
> --
> Jeremy
> 
> On Oct 8, 2006, at 6:54 PM, Li Shen wrote:
> 
> > Hi,
> >
> > I noticed that in the helloworldws sample, now only SDO gets used.
> > If I want
> > to use JAXB/XMLBeans instead of SDO, what shall I do then?
> >
> > Basically, I know I may need to register the SCDL of JAXB/XMLBeans
> > to my
> > Tuscany runtime, and replace some configurations such as
> > @DataType(name="commonj.sdo.DataObject") and <dbsdo/> in
> > helloworldws with
> > JAXB/XMLBeans specific stuff. Is that correct? How will <dbjaxb/>
and
> > <dbxmlbeans/>look like? The same as SDO? Also, looks like for now
> > there is
> > still no SCDL available for JAXB/XMLBeans, do you guys have any
> > plan to add
> > them?
> >
> > Thanks,
> > Li
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Can JAXB/XMLBeans work with axis binding now

Posted by Jeremy Boynes <jb...@apache.org>.
Li, your email is being held in a moderation queue as you are not  
subscribed to the mailing list. I've modded one copy through.
--
Jeremy

On Oct 8, 2006, at 6:54 PM, Li Shen wrote:

> Hi,
>
> I noticed that in the helloworldws sample, now only SDO gets used.  
> If I want
> to use JAXB/XMLBeans instead of SDO, what shall I do then?
>
> Basically, I know I may need to register the SCDL of JAXB/XMLBeans  
> to my
> Tuscany runtime, and replace some configurations such as
> @DataType(name="commonj.sdo.DataObject") and <dbsdo/> in  
> helloworldws with
> JAXB/XMLBeans specific stuff. Is that correct? How will <dbjaxb/> and
> <dbxmlbeans/>look like? The same as SDO? Also, looks like for now  
> there is
> still no SCDL available for JAXB/XMLBeans, do you guys have any  
> plan to add
> them?
>
> Thanks,
> Li
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org