You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by "Javier A. Soltero" <ja...@covalent.net> on 2001/06/20 22:02:48 UTC

Problem Serializing Vectors

I have a method which I am accessing through soap which returns a
Vector. However, when I try to access this method, the TCPTunnel
indicates that an soap fault occurs because it says it can't find a
serializer for 'java.util.collection'. Meanwhile, the code makes no
mention of Collection as a return type. The deployment descriptor does
not include a mapping for vectors because I am under the impression that
these are default mappings. The contents of the collection are bean
objects for which there is a serializer registered.

Any help would be greatly appreciated.

This is the code for the method:

 public static Vector listUsers() throws ObjectAccessException {

        Logger.init();
        Logger.debug(ctx, "Called listUsers()");
        Vector userBeans = new Vector();

        Vector boS = (Vector)UserBO.list();
        Iterator userBoIt = boS.iterator();
        Logger.debug(ctx, "Got list & iterator");
        while(userBoIt.hasNext()) {
            UserBO aUserBO = (UserBO) userBoIt.next();
            UserBean aUserBean = new UserBean(aUserBO);
            Logger.debug(ctx, "Got userBean... adding to vector");
            userBeans.add(aUserBean);
        }
        return userBeans;
}

This is the deployment descriptor for the class:

<?xml version="1.0"?>
<isd:service
    xmlns:isd="http://xml.apache.org/xml-soap/deployment"
    id="urn:net.covalent.c3.server.UserManager">
    <isd:provider type="java"
              scope="Request"
              static="false"
              methods="addUser listUsers viewDetails deleteUser">
    <isd:java class="net.covalent.c3.server.soap.managers.UserManager"/>

    </isd:provider>
    <isd:mappings
defaultRegistryClass="net.covalent.c3.server.soap.CMPSoapMappingReg">
    </isd:mappings>
</isd:service>


Thanks,

-javier


Re: Problem Serializing Vectors

Posted by "Javier A. Soltero" <ja...@covalent.net>.
Ok, in the interest of all those loyal readers out there, I will answer my
own question. It turns out that one of the members of the beans which were
included in the vector I wanted to pass around was a Collection. I had to
revisit every class in that inheritance hierarchy to make sure they
declared all members as Vectors and *not* Collections and the problem went
away.

The lesson here is that just by looking at the tcpTunnerGui tool isnt
enough sometimes to truly figure out what is happening inside the soap
service. Wow... and to think it only took me half a day to figure that one
out ... wheeewww

-javier

"Javier A. Soltero" wrote:

> I have a method which I am accessing through soap which returns a
> Vector. However, when I try to access this method, the TCPTunnel
> indicates that an soap fault occurs because it says it can't find a
> serializer for 'java.util.collection'. Meanwhile, the code makes no
> mention of Collection as a return type. The deployment descriptor does
> not include a mapping for vectors because I am under the impression that
> these are default mappings. The contents of the collection are bean
> objects for which there is a serializer registered.
>
> Any help would be greatly appreciated.
>
> This is the code for the method:
>
>  public static Vector listUsers() throws ObjectAccessException {
>
>         Logger.init();
>         Logger.debug(ctx, "Called listUsers()");
>         Vector userBeans = new Vector();
>
>         Vector boS = (Vector)UserBO.list();
>         Iterator userBoIt = boS.iterator();
>         Logger.debug(ctx, "Got list & iterator");
>         while(userBoIt.hasNext()) {
>             UserBO aUserBO = (UserBO) userBoIt.next();
>             UserBean aUserBean = new UserBean(aUserBO);
>             Logger.debug(ctx, "Got userBean... adding to vector");
>             userBeans.add(aUserBean);
>         }
>         return userBeans;
> }
>
> This is the deployment descriptor for the class:
>
> <?xml version="1.0"?>
> <isd:service
>     xmlns:isd="http://xml.apache.org/xml-soap/deployment"
>     id="urn:net.covalent.c3.server.UserManager">
>     <isd:provider type="java"
>               scope="Request"
>               static="false"
>               methods="addUser listUsers viewDetails deleteUser">
>     <isd:java class="net.covalent.c3.server.soap.managers.UserManager"/>
>
>     </isd:provider>
>     <isd:mappings
> defaultRegistryClass="net.covalent.c3.server.soap.CMPSoapMappingReg">
>     </isd:mappings>
> </isd:service>
>
> Thanks,
>
> -javier


Re: Problem Serializing Vectors

Posted by "Javier A. Soltero" <ja...@covalent.net>.
Ok, in the interest of all those loyal readers out there, I will answer my
own question. It turns out that one of the members of the beans which were
included in the vector I wanted to pass around was a Collection. I had to
revisit every class in that inheritance hierarchy to make sure they
declared all members as Vectors and *not* Collections and the problem went
away.

The lesson here is that just by looking at the tcpTunnerGui tool isnt
enough sometimes to truly figure out what is happening inside the soap
service. Wow... and to think it only took me half a day to figure that one
out ... wheeewww

-javier

"Javier A. Soltero" wrote:

> I have a method which I am accessing through soap which returns a
> Vector. However, when I try to access this method, the TCPTunnel
> indicates that an soap fault occurs because it says it can't find a
> serializer for 'java.util.collection'. Meanwhile, the code makes no
> mention of Collection as a return type. The deployment descriptor does
> not include a mapping for vectors because I am under the impression that
> these are default mappings. The contents of the collection are bean
> objects for which there is a serializer registered.
>
> Any help would be greatly appreciated.
>
> This is the code for the method:
>
>  public static Vector listUsers() throws ObjectAccessException {
>
>         Logger.init();
>         Logger.debug(ctx, "Called listUsers()");
>         Vector userBeans = new Vector();
>
>         Vector boS = (Vector)UserBO.list();
>         Iterator userBoIt = boS.iterator();
>         Logger.debug(ctx, "Got list & iterator");
>         while(userBoIt.hasNext()) {
>             UserBO aUserBO = (UserBO) userBoIt.next();
>             UserBean aUserBean = new UserBean(aUserBO);
>             Logger.debug(ctx, "Got userBean... adding to vector");
>             userBeans.add(aUserBean);
>         }
>         return userBeans;
> }
>
> This is the deployment descriptor for the class:
>
> <?xml version="1.0"?>
> <isd:service
>     xmlns:isd="http://xml.apache.org/xml-soap/deployment"
>     id="urn:net.covalent.c3.server.UserManager">
>     <isd:provider type="java"
>               scope="Request"
>               static="false"
>               methods="addUser listUsers viewDetails deleteUser">
>     <isd:java class="net.covalent.c3.server.soap.managers.UserManager"/>
>
>     </isd:provider>
>     <isd:mappings
> defaultRegistryClass="net.covalent.c3.server.soap.CMPSoapMappingReg">
>     </isd:mappings>
> </isd:service>
>
> Thanks,
>
> -javier