cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattmadhavan <mattmadha...@yahoo.com>
Subject RE: Help in annotating Java beans as paramater to a web service!
Date Tue, 04 Sep 2007 19:40:24 GMT

Hi Chris,
The first link you sent does n't seem to work. Can you re-send it?

My question is regardless of the underlying mapping, is there anyway to
JAX-WS annotate a JavaBean as opposed to a simple param? All the examples I
have seen so far only take simple params. Any example using a Java Bean as a
param having both optional and required a attributes will be appreciated.


Thanks
Matt



Christopher Moesel wrote:
> 
> Hi Matt,
> 
> If you're using the default data binding (JAXB 2.0), then you may want
> to check out JAXB's documentation on annotating classes.
> 
> For starter's, you can see Kohsuke's blog entry on using JAXB:
> http://weblogs.java.net/blog/kohsuke/archive/2005/02/using_jaxb_20_t.htm
> l
> 
> Then for all the gritty details on the possible annotations, check out
> the JAXB section of the JEE tutorial:
> http://java.sun.com/javaee/5/docs/tutorial/doc/JAXB5.html
> 
> -Chris
> 
> -----Original Message-----
> From: mattmadhavan [mailto:mattmadhavan@yahoo.com] 
> Sent: Tuesday, September 04, 2007 3:07 PM
> To: cxf-user@incubator.apache.org
> Subject: Help in annotating Java beans as paramater to a web service!
> 
> 
> Hello,
> Please bear with me, I am new to CXF. 
> 
> I am doing a Java first development and I have one webservice method
> called
> addProductInfo, which takes a paramter, ProductInfo. 
> 
> 
> @WebService(name = "ProductInfo",
>         targetNamespace = "http://vibes.contentmanagement")
> public interface IAddProductInfo extends Serializable {
> 	@WebMethod(operationName="addProductInfo",
> action="urn:addProductInfo")	
> 	@WebResult(name="return")
> 	public Integer
> addProductInfo(@WebParam(name="productInfo")BaseProduct
> product);
> }
> 
> My BaseProduct class is as follows:
> 
> public class BaseProduct extends BaseEntity {
> 
>     private String name = "";
>     private String description;
>     private float price;
>     private String keyword = "";
>     private String shortCode;
> }
> 
> All the fields are required except, keyword and short code! How do I
> annotate the webmethod and the individual fields on the BaseProduct
> class?
> 
> Can someone point me to right documentations.
> 
> Thanks
> Matt
> 
> 
> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Help-in-annotating-Java-beans-as-paramater-to-a-we
> b-service%21-tf4379704.html#a12484583
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-in-annotating-Java-beans-as-paramater-to-a-web-service%21-tf4379704.html#a12485143
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message