You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Gustavo De Simone <gu...@montevideo.com.uy> on 2004/07/05 17:19:53 UTC

bean question

Hi,
When you need to use complex objects (bean objects) is necesarily to declare a <beanMapping ...> in the WSDD ?

I supposed that it was, but I am a little bit confused by the fact that when I deploy a Service using the next wsdd :

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 
    <service name="HolaMundo" provider="java:RPC">
     <parameter name="scope" value="session"/>
     <parameter name="className" value="servicios.HolaMundoImpl"/>
     <parameter name="allowedMethods" value="*"/>
     <namespace>someurl</namespace>
    </service>
</deployment>

the wsdl is generates all my complex types without the necessity of declaring <beanMappings..>. It appears to generate WSDL schema definitions for all the Bean objects that are in the package "servicios".

Is necesary to declare the beanMappings anyway ?.

Re: bean question

Posted by Steve Wells <St...@mohomine.com>.
I am having similar problems & questions myself - 

in my case I have two classes and a container class that contains an array 
of one of the other classes which, correspondingly, contains an array of 
the third class.  I got errors complaining that there was no serializer 
defined for the object so I added BeanInfo objects for each of the 
classes.  This eliminated the repetive errors I got about no serializers 
but led to other errors.  I created the beanMapping objects as you've 
contemplated and that seemed to help things more but now I get the 
following exception (below) regarding the higher level class being 
returned.

Questions:  does the beanMapping shown in docs as is should be entered 
into server-config.wsdd exactly, for every one?  the fields in question 
are qname & xmlns = are these ALWAYS "ns:local" and "someNamespace" for 
every bean ???
<beanMapping qname="ns:local" xmlns:ns="someNamespace"

One I started with all of these in place then the service which I have 
which references & returns these fields would no longer load.  I get no 
exceptions displayed on server side logging but when I try to re-generate 
the WSDL I get an error stating that the qname space is invalid.


     [java] AxisFault
     [java]  faultCode: 
{http://schemas.xmlsoap.org/soap/envelope/}Server.userEx
ception
     [java]  faultSubcode:
     [java]  faultString: org.xml.sax.SAXException: Deserializing 
parameter &apo
s;classifyDocumentReturn&apos;:  could not find deserializer for type
     [java]  faultActor:
     [java]  faultNode:
     [java]  faultDetail:
     [java]     {http://xml.apache.org/axis/}stackTrace: 
org.xml.sax.SAXExceptio
n: Deserializing parameter 'classifyDocumentReturn':  could not find 
deserialize
r for type
     [java]     at 
org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.ja
va:302)
     [java]     at 
org.apache.axis.encoding.DeserializationContextImpl.startElem
ent(DeserializationContextImpl.java:963)
     [java]     at 
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRec
order.java:198)
     [java]     at 
org.apache.axis.message.MessageElement.publishToHandler(Messa
geElement.java:722)
     [java]     at 
org.apache.axis.message.RPCElement.deserialize(RPCElement.jav
a:233)
     [java]     at 
org.apache.axis.message.RPCElement.getParams(RPCElement.java:
347)
     [java]     at org.apache.axis.client.Call.invoke(Call.java:2272)
     [java]     at org.apache.axis.client.Call.invoke(Call.java:2171)
     [java]     at org.apache.axis.client.Call.invoke(Call.java:1691)

-- Steve


"Gustavo De Simone" <gu...@montevideo.com.uy> wrote on 07/05/2004 
12:19:53 PM:

> Hi,
> When you need to use complex objects (bean objects) is necesarily to
> declare a <beanMapping ...> in the WSDD ?
> 
> I supposed that it was, but I am a little bit confused by the fact 
> that when I deploy a Service using the next wsdd :
> 
> <deployment xmlns="http://xml.apache.org/axis/wsdd/"
>     xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> 
>     <service name="HolaMundo" provider="java:RPC">
>      <parameter name="scope" value="session"/>
>      <parameter name="className" value="servicios.HolaMundoImpl"/>
>      <parameter name="allowedMethods" value="*"/>
>      <namespace>someurl</namespace>
>     </service>
> </deployment>
> 
> the wsdl is generates all my complex types without the necessity of 
> declaring <beanMappings..>. It appears to generate WSDL schema 
> definitions for all the Bean objects that are in the package 
"servicios".
> 
> Is necesary to declare the beanMappings anyway ?.