Well - I added my bean as a beanMapping in the server-config.wsdd file
like the following:
<beanMapping qname="ns1:User" xmlns:ns1="urn:wedge"
languageSpecificType="java:com.li.wedge.soap.hibernate.User"/>

At webapp startup Im getting the following exception:
java.lang.NoSuchMethodException:
org.apache.axis.encoding.ser.BeanSerializerFactory.create(java.lang.Class,
javax.xml.namespace.QName)
    at java.lang.Class.getMethod(Class.java:978)
    at 
org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(BaseSerializerFactory.java:234)
    at 
org.apache.axis.deployment.wsdd.WSDDService.deployTypeMapping(WSDDService.java:529)
    at org.apache.axis.deployment.wsdd.WSDDService.initTMR(WSDDService.java:245)
    at org.apache.axis.deployment.wsdd.WSDDService.<init>(WSDDService.java:225)
    at org.apache.axis.deployment.wsdd.WSDDDeployment.<init>(WSDDDeployment.java:204)
....

This is a simple bean with the needed getters/setters.  Any ideas? 
Unfortunately the mailing list archive search on marc.theaimsgroup.com
wont do a search on long strings (like NoSuchMethodException).

Thanks,

- Brent

On Mon, 2 Aug 2004 15:35:14 -0400, Brent Johnson <[EMAIL PROTECTED]> wrote:
> Ahh.. so just return the bean that I want.. and I'm guessing I should
> use call.setReturnClass(MyBean.class) instead of setReturnType?
> 
> Also.. I'm changing my beans to not use collections and use arrays
> instead.  Can I use arrays of beans in my bean though?  Example:
> 
> public class MyBean() {
>     private Attribute[] attributes;
> 
>     public MyBean() {
>     }
> 
>     public Attribute[] getAttributes() { return(this.attributes); }
>     public void setAttributes(Attribute[] param) { this.attributes = param; }
> }
> 
> And the Attribute class is just a bean that has a String name, and String value.
> 
> When I try this I get the following error:
> "org.xml.sax.SAXException: SimpleDeserializer encountered a child
> element, which is NOT expected, in something it was trying to
> deserialize."
> 
> I'm using Hibernate (http://www.hibernate.org) to link two tables in a
> one-to-many relationship, and it requires that this be either a
> collection, or an array of my custom bean.  If I have to I can modify
> my parent bean to contain a String[] array instead.. holding all the
> primary keys in the child database.. but this will require a little
> more "finesse" to get working correctly.
> 
> Thanks for the help,
> 
> - Brent
> 
> 
> 
> ----- Original Message -----
> From: Callahan, Paul <[EMAIL PROTECTED]>
> Date: Mon, 2 Aug 2004 14:07:11 -0400
> Subject: RE: Newbie: Sending/Receiving Beans with BeanSerializer
> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> 
> Just make the return type of your method the class of the bean you
> want to return...  Axis will serialize it on return, unless you are
> using collections or complex types.
> 
> -pc
> 
> -----Original Message-----
> From: Brent Johnson [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 02, 2004 1:10 PM
> To: [EMAIL PROTECTED]
> Subject: Newbie: Sending/Receiving Beans with BeanSerializer
> 
> I want to be able to pass a bean (lets say "Item") to my WebService
> and have a bean returned (in this case another "Item" with different
> values).
> 
> I've read through the Axis documentation and it looks like its pretty
> trivial to pass a bean into the service as input using the
> BeanSerializer.  This is of course assuming you aren't using any
> Collections.  I'd *like* to use Collections (i.e. a Set) in my bean..
> but from searching the mailing list archive there doesnt seem to be a
> simple way to do this.  I can use arrays instead of collections for
> now though.
> 
> How does one go about passing a bean back to the client?  The example
> in the user documentation takes a bean and just returns a String to
> the caller.  How about returning a serialized bean?
> 
> Thanks
>

Reply via email to