tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cedric Hurst <cedric.hu...@gmail.com>
Subject Re: Returning complex data types in @WebResult
Date Sun, 27 Jan 2008 05:53:41 GMT

Thanks for the suggestion, Dain.

I tried adding the @XmlType annotation:

http://trac2.assembla.com/d5Z24gWSer3lvHabIlDkbG/browser/ComplexDataTypeWSExampleEJB/ejbModule/com/gmail/at/cedrichurst/complexDataTypeWSExampleEJB/domain/Customer.java?rev=24

...but referencing the object in the @WebReturn resulted in a classloading
error for geronimo's wsgen tool (the jar for "javax.xml.bind" is included
but the jar for "javax.xml.bind.annotation" is not).  I'm pretty sure that
is a Geronimo-specific issue because I ran into a similar problem generating
WSDL files which return @Entity classes.  So, I'll take that issue to the
Geronimo mailing list or open a JIRA.

In the meantime, there still seems to be an issue returning any kind of
java.util.List in a @WebService.  To test this out, I replaced the return
type of List<Customer> with List<String>

http://trac2.assembla.com/d5Z24gWSer3lvHabIlDkbG/browser/ComplexDataTypeWSExampleEJB/ejbModule/com/gmail/at/cedrichurst/complexDataTypeWSExampleEJB/ejb/CustomerSearchBean.java?rev=23

And I'm still getting the "java.util.List is not known to this context"
error.

However, I have noticed that if I return a String[]:

http://trac2.assembla.com/d5Z24gWSer3lvHabIlDkbG/browser/ComplexDataTypeWSExampleEJB/ejbModule/com/gmail/at/cedrichurst/complexDataTypeWSExampleEJB/ejb/CustomerSearchBean.java?rev=24

...it seems to work just fine.  So that will probably do for now.


Dain Sundstrom wrote:
> 
> FWIU, JaxWS requires that all complex type be annotated with JaxB  
> annotations (this is why the root most exception is a JAXBException).   
> These annotations tell JaxWS how to convert between XML and the Java  
> Object.
> 
> I think (and I'm not JaxWS expert) you only need to add @XmlType or  
> @XmlRootElement to your Customer class, but you may want to check the  
> Axis2 docs.
> 
> -dain
> 
> 

-- 
View this message in context: http://www.nabble.com/Returning-complex-data-types-in-%40WebResult-tp15114306p15116223.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message