You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by David Blevins <da...@visi.com> on 2008/08/21 03:36:42 UTC

Re: Use JAXB generated class as JAX-WS request parameter

On Aug 18, 2008, at 6:45 AM, rde8026 wrote:

> I'm running into an issue when trying to use a JAXB generated class  
> as input
> into my @WebMethod.  Basically I have an XSD that is generated via  
> JAXB and
> I want to use that generated class as the input parameter into my  
> JAX-WS web
> service.  I know JAX-WS uses JAXB to generate the necessary objects  
> for the
> request and response parameters.  My question is basically does  
> anyone know
> if this is possible or do I need to generate some POJO to assign as  
> the
> request object and let JAX-WS do it's thing then map that bean to the
> existing JAXB class I have generated?

Not too sure.  Cc'ing the CXF list as hopefully Dan and company will  
have a better idea.

Let's hope they're a little quicker at responding than I was -- sorry  
for the delay on such a simple response.

-David


Re: Use JAXB generated class as JAX-WS request parameter

Posted by Daniel Kulp <dk...@apache.org>.
JAX-WS uses the JAXB beans as parameters in it's normal case.   Thus, they 
should "just work". 

The only real issue I can think of is if the beans you have are anonymous 
types of a global element and the service is "wrapped" mode (the default).   
In that case, the wrapper type that CXF creates is technically against spec 
and probably not tested well as it cannot point to the "type".   It has to 
point to the element via a "ref".   I really don't know if that works or not.

So, if you can, make sure your global elements that you are using in your 
schema are referencing global types, not using anonymous types.  

Dan



On Wednesday 20 August 2008 9:36:42 pm David Blevins wrote:
> On Aug 18, 2008, at 6:45 AM, rde8026 wrote:
> > I'm running into an issue when trying to use a JAXB generated class
> > as input
> > into my @WebMethod.  Basically I have an XSD that is generated via
> > JAXB and
> > I want to use that generated class as the input parameter into my
> > JAX-WS web
> > service.  I know JAX-WS uses JAXB to generate the necessary objects
> > for the
> > request and response parameters.  My question is basically does
> > anyone know
> > if this is possible or do I need to generate some POJO to assign as
> > the
> > request object and let JAX-WS do it's thing then map that bean to the
> > existing JAXB class I have generated?
>
> Not too sure.  Cc'ing the CXF list as hopefully Dan and company will
> have a better idea.
>
> Let's hope they're a little quicker at responding than I was -- sorry
> for the delay on such a simple response.
>
> -David



-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Use JAXB generated class as JAX-WS request parameter

Posted by Daniel Kulp <dk...@apache.org>.
JAX-WS uses the JAXB beans as parameters in it's normal case.   Thus, they 
should "just work". 

The only real issue I can think of is if the beans you have are anonymous 
types of a global element and the service is "wrapped" mode (the default).   
In that case, the wrapper type that CXF creates is technically against spec 
and probably not tested well as it cannot point to the "type".   It has to 
point to the element via a "ref".   I really don't know if that works or not.

So, if you can, make sure your global elements that you are using in your 
schema are referencing global types, not using anonymous types.  

Dan



On Wednesday 20 August 2008 9:36:42 pm David Blevins wrote:
> On Aug 18, 2008, at 6:45 AM, rde8026 wrote:
> > I'm running into an issue when trying to use a JAXB generated class
> > as input
> > into my @WebMethod.  Basically I have an XSD that is generated via
> > JAXB and
> > I want to use that generated class as the input parameter into my
> > JAX-WS web
> > service.  I know JAX-WS uses JAXB to generate the necessary objects
> > for the
> > request and response parameters.  My question is basically does
> > anyone know
> > if this is possible or do I need to generate some POJO to assign as
> > the
> > request object and let JAX-WS do it's thing then map that bean to the
> > existing JAXB class I have generated?
>
> Not too sure.  Cc'ing the CXF list as hopefully Dan and company will
> have a better idea.
>
> Let's hope they're a little quicker at responding than I was -- sorry
> for the delay on such a simple response.
>
> -David



-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: Use JAXB generated class as JAX-WS request parameter

Posted by rde8026 <rd...@gmail.com>.
No worries; actually its my fault for not updating the question since I was
able to fix this myself.  It ended up being a namespace issues with JAXB. 
Since my XSD didn't have a targetNamespace it seems that was causing some
issue in passing the object back to the MDB.

Anyway; thanks for getting back to me!




David Blevins wrote:
> 
> 
> On Aug 18, 2008, at 6:45 AM, rde8026 wrote:
> 
>> I'm running into an issue when trying to use a JAXB generated class  
>> as input
>> into my @WebMethod.  Basically I have an XSD that is generated via  
>> JAXB and
>> I want to use that generated class as the input parameter into my  
>> JAX-WS web
>> service.  I know JAX-WS uses JAXB to generate the necessary objects  
>> for the
>> request and response parameters.  My question is basically does  
>> anyone know
>> if this is possible or do I need to generate some POJO to assign as  
>> the
>> request object and let JAX-WS do it's thing then map that bean to the
>> existing JAXB class I have generated?
> 
> Not too sure.  Cc'ing the CXF list as hopefully Dan and company will  
> have a better idea.
> 
> Let's hope they're a little quicker at responding than I was -- sorry  
> for the delay on such a simple response.
> 
> -David
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Use-JAXB-generated-class-as-JAX-WS-request-parameter-tp19032084p19081266.html
Sent from the OpenEJB User mailing list archive at Nabble.com.