You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by "Wetsig, Brian" <bw...@pesolutions.com> on 2000/11/08 21:58:55 UTC

Vector Deserializer

Has anyone been able to deserialize a java.util.Vector?

I'm getting this error:
VectorSerializer used for deserialization
My descriptor looks like this:
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap:Vector" qname="x:vt"
             javaType="java.util.Vector"
 
java2XMLClassName="org.apache.soap.encoding.soapenc.VectorSerializer"
 
xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>

...and I'm sending it like this:
    SOAPMappingRegistry smr = new SOAPMappingRegistry();
    BeanSerializer beanSer = new BeanSerializer();
    VectorSerializer vectSer = new VectorSerializer();
    ....
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                 new QName("urn:xml-soap:Vector", "vt"),
                 Vector.class, vectSer, beanSer);
    ....
    params.addElement(new Parameter("vt", Vector.class,
                                    vt, null));


-Brian



Re: Vector Deserializer

Posted by Glen Daniels <gd...@allaire.com>.
Brian:

The Vector mapping is pre-done for you in the SOAPMappingRegistry, so you
don't need to explicitly call it out yourself.  We should definitely make
this more clear in the documentation!  You should be able to just use a
Vector object as a parameter and it'll just work.

As it stands, a Vector parameter will automatically be serialized as an
"xml-soap:Vector", which is so that it can be deserialized back into a
Vector.  Formerly, the VectorSerializer serialized into a SOAP array, but
then the deserializer for the array produced an Object[], which often wasn't
what you wanted.

The real solution for this, as has been discussed on the list, is to enable
the code with an automatic translation Vector<->Object[], so that you can
request either from a serialized SOAP array and have the right thing happen.
I'm not sure if this will make it into 2.0, or if it'll just wait for 3.0.

--Glen

----- Original Message -----
From: Wetsig, Brian <bw...@pesolutions.com>
To: <so...@xml.apache.org>
Sent: Wednesday, November 08, 2000 3:58 PM
Subject: Vector Deserializer


> Has anyone been able to deserialize a java.util.Vector?
>
> I'm getting this error:
> VectorSerializer used for deserialization
> My descriptor looks like this:
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap:Vector" qname="x:vt"
>              javaType="java.util.Vector"
>
> java2XMLClassName="org.apache.soap.encoding.soapenc.VectorSerializer"
>
> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
>
> ...and I'm sending it like this:
>     SOAPMappingRegistry smr = new SOAPMappingRegistry();
>     BeanSerializer beanSer = new BeanSerializer();
>     VectorSerializer vectSer = new VectorSerializer();
>     ....
>     smr.mapTypes(Constants.NS_URI_SOAP_ENC,
>                  new QName("urn:xml-soap:Vector", "vt"),
>                  Vector.class, vectSer, beanSer);
>     ....
>     params.addElement(new Parameter("vt", Vector.class,
>                                     vt, null));
>
>
> -Brian
>
>


Re: Vector Deserializer

Posted by Glen Daniels <gd...@allaire.com>.
Brian:

The Vector mapping is pre-done for you in the SOAPMappingRegistry, so you
don't need to explicitly call it out yourself.  We should definitely make
this more clear in the documentation!  You should be able to just use a
Vector object as a parameter and it'll just work.

As it stands, a Vector parameter will automatically be serialized as an
"xml-soap:Vector", which is so that it can be deserialized back into a
Vector.  Formerly, the VectorSerializer serialized into a SOAP array, but
then the deserializer for the array produced an Object[], which often wasn't
what you wanted.

The real solution for this, as has been discussed on the list, is to enable
the code with an automatic translation Vector<->Object[], so that you can
request either from a serialized SOAP array and have the right thing happen.
I'm not sure if this will make it into 2.0, or if it'll just wait for 3.0.

--Glen

----- Original Message -----
From: Wetsig, Brian <bw...@pesolutions.com>
To: <so...@xml.apache.org>
Sent: Wednesday, November 08, 2000 3:58 PM
Subject: Vector Deserializer


> Has anyone been able to deserialize a java.util.Vector?
>
> I'm getting this error:
> VectorSerializer used for deserialization
> My descriptor looks like this:
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap:Vector" qname="x:vt"
>              javaType="java.util.Vector"
>
> java2XMLClassName="org.apache.soap.encoding.soapenc.VectorSerializer"
>
> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
>
> ...and I'm sending it like this:
>     SOAPMappingRegistry smr = new SOAPMappingRegistry();
>     BeanSerializer beanSer = new BeanSerializer();
>     VectorSerializer vectSer = new VectorSerializer();
>     ....
>     smr.mapTypes(Constants.NS_URI_SOAP_ENC,
>                  new QName("urn:xml-soap:Vector", "vt"),
>                  Vector.class, vectSer, beanSer);
>     ....
>     params.addElement(new Parameter("vt", Vector.class,
>                                     vt, null));
>
>
> -Brian
>
>