You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Glen Daniels <gd...@allaire.com> on 2001/02/16 21:25:09 UTC
Fix for null deserialization problem
As Francisco Avila-Desarrollo pointed out, our implementation of
VectorSerializer represents nulls as "ur-type", since there's nothing else
it can really do with them.
As it stands we don't have any way to deserialize an "ur-type" (which should
eventually switch to anyType, btw), so I just made the following change I
wanted to run by you all before committing it.
1) I implemented a totally simple UrTypeDeserializer, which will only
deserialize nulls into a Bean[Object, null].
2) I changed:
mapTypes(Constants.NS_URI_SOAP_ENC, objectQName,
Object.class, null, null);
to:
mapTypes(Constants.NS_URI_SOAP_ENC, objectQName,
Object.class, null, objDeser);
in SOAPMappingRegistry. I can't see any obvious way this could break
things, but wanted to run it past you to make sure. Wouter, this shouldn't
affect the MIME-y stuff, right?
--Glen
Re: Fix for null deserialization problem
Posted by Francisco Jose Avila - Desarrollo <fa...@gridsystems.com>.
El lun, 19 feb 2001, escribiste:
> Yup - as I haven't heard any dissent, I'm going to commit this fix later today
> (when I get back home to a machine where I have the source).
Good!! This is working fine. I have sent to the list a pair of
serializer (for HashMap and Timestamp), it is possible include both in the
SOAP's CVS repository?
--
Baco, por siempre loado,
os libre del cirrotico mal
y del advenimiento gonococico.
Re: How to pass objects like Vector in SOAP?
Posted by Scott Nichol <sn...@computer.org>.
> the project i am working in, we have services which returns Vector
objects.
> if i use RMI, java RMI is taking care of serialization/deserialization.
> now i am using SOAP 2.0 on Tomcat 3.2.1 server.
>
> How to Serialize/Deserialize these Vector objects.
SOAP 2.1 includes a serializer for Vector. For SOAP 2.0, you will have to
write your own. If you pursue that route, looking at the 2.1 source for the
serializer may help.
Scott Nichol
How to pass objects like Vector in SOAP?
Posted by Sreenivasa Rao Nalluri <na...@mahindrabt.com>.
hello all
the project i am working in, we have services which returns Vector objects.
if i use RMI, java RMI is taking care of serialization/deserialization.
now i am using SOAP 2.0 on Tomcat 3.2.1 server.
How to Serialize/Deserialize these Vector objects.
can any one help me in this?
thank u all
sreeni
--
Sreenivasa Rao Nalluri
Software Engineer
R & D, Component Extraction
MBT Ltd., Sharda Centre
S.No. 91, CTS No. 11/B/1
Erandwane, PUNE - 411 004
India.
Ph : + 91 - 020 - 5424301
Extention : 2061 or 2063
Mail me at:
nalluris@mahindrabt.com
sreenivasarao_nalluri@yahoo.com
sreenivasarao_n@hotmail.com
Re: Fix for null deserialization problem
Posted by Glen Daniels <gd...@allaire.com>.
Yup - as I haven't heard any dissent, I'm going to commit this fix later today
(when I get back home to a machine where I have the source).
--G
----- Original Message -----
From: "Francisco Jose Avila - Desarrollo" <fa...@gridsystems.com>
To: <so...@xml.apache.org>
Sent: Monday, February 19, 2001 10:28 AM
Subject: Re: Fix for null deserialization problem
El vie, 16 feb 2001, escribiste:
> I should have also mentioned that "objDeser" in SOAPMapping registry is in
> fact an instance of UrTypeDeserializer...
Well, I changedin the file "SOAPMappingRegistry.java" the line:
mapTypes(Constants.NS_URI_SOAP_ENC, objectQName, Object.class, null, null);
by the line:
UrTypeDeserializer objDeser = new UrTypeDeserializer();
mapTypes(Constants.NS_URI_SOAP_ENC, objectQName, Object.class, null,
objDeser);
The source code of the class "UrTypeDeserializer" is:
-------------------
package org.apache.soap.encoding.soapenc;
import java.io.*;
import org.w3c.dom.*;
import org.apache.soap.util.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
/**
* Used to deserialize <code>ur-type</code> as <code>null</code>
* using the <code>SOAP-ENC</code> encoding style.
*
* @author Glen Daniels <gd...@allaire.com>
* @author Francisco Jose Avila Bermejo <mo...@yahoo.com>
*/
public class UrTypeDeserializer implements Deserializer {
public Bean unmarshall(String inScopeEncStyle, QName elementType, Node src,
XMLJavaMappingRegistry xjmr, SOAPContext ctx)
throws IllegalArgumentException {
return new Bean(Object.class, null);
}
}
-------------------
Both files are send to you as attachments.
Thanks a lot, it works fine :-)
--
Baco, por siempre loado,
os libre del cirrotico mal
y del advenimiento gonococico.
Re: Fix for null deserialization problem
Posted by Francisco Jose Avila - Desarrollo <fa...@gridsystems.com>.
El vie, 16 feb 2001, escribiste:
> I should have also mentioned that "objDeser" in SOAPMapping registry is in
> fact an instance of UrTypeDeserializer...
Well, I changedin the file "SOAPMappingRegistry.java" the line:
mapTypes(Constants.NS_URI_SOAP_ENC, objectQName, Object.class, null, null);
by the line:
UrTypeDeserializer objDeser = new UrTypeDeserializer();
mapTypes(Constants.NS_URI_SOAP_ENC, objectQName, Object.class, null, objDeser);
The source code of the class "UrTypeDeserializer" is:
-------------------
package org.apache.soap.encoding.soapenc;
import java.io.*;
import org.w3c.dom.*;
import org.apache.soap.util.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
/**
* Used to deserialize <code>ur-type</code> as <code>null</code>
* using the <code>SOAP-ENC</code> encoding style.
*
* @author Glen Daniels <gd...@allaire.com>
* @author Francisco Jose Avila Bermejo <mo...@yahoo.com>
*/
public class UrTypeDeserializer implements Deserializer {
public Bean unmarshall(String inScopeEncStyle, QName elementType, Node src,
XMLJavaMappingRegistry xjmr, SOAPContext ctx)
throws IllegalArgumentException {
return new Bean(Object.class, null);
}
}
-------------------
Both files are send to you as attachments.
Thanks a lot, it works fine :-)
--
Baco, por siempre loado,
os libre del cirrotico mal
y del advenimiento gonococico.
Re: Fix for null deserialization problem
Posted by Glen Daniels <gd...@allaire.com>.
I should have also mentioned that "objDeser" in SOAPMapping registry is in
fact an instance of UrTypeDeserializer...
----- Original Message -----
From: "Glen Daniels" <gd...@allaire.com>
To: <so...@xml.apache.org>
Sent: Friday, February 16, 2001 3:25 PM
Subject: Fix for null deserialization problem
> As Francisco Avila-Desarrollo pointed out, our implementation of
> VectorSerializer represents nulls as "ur-type", since there's nothing else
> it can really do with them.
>
> As it stands we don't have any way to deserialize an "ur-type" (which
should
> eventually switch to anyType, btw), so I just made the following change I
> wanted to run by you all before committing it.
>
> 1) I implemented a totally simple UrTypeDeserializer, which will only
> deserialize nulls into a Bean[Object, null].
>
> 2) I changed:
>
> mapTypes(Constants.NS_URI_SOAP_ENC, objectQName,
> Object.class, null, null);
>
> to:
>
> mapTypes(Constants.NS_URI_SOAP_ENC, objectQName,
> Object.class, null, objDeser);
>
> in SOAPMappingRegistry. I can't see any obvious way this could break
> things, but wanted to run it past you to make sure. Wouter, this
shouldn't
> affect the MIME-y stuff, right?
>
> --Glen
>
>
>