If the value being serialized is really null and you have the same 
version of Apache SOAP on the deployment server as the development, I 
would expect things to work.

It is true that null values can be deserialized.  This should be true 
for beans you've mapped and ones you have not (ur-type).  Given the 
errors you have, though, it does not seem that a null is really being 
serialized.  For example

        Can't yet deserialize non-null Objects; 

is an error that comes up only when you have xsi:type="xsd:ur-type" 
without xsi:null="true" or xsi:nil="true".

This makes me wonder whether you really have a null value you are 
returning, and whether you are using the same version of Apache SOAP 
in deployment (because handling of xsi:null and xsi:nil has been 
improved along the way).

On 2 Jun 2003 at 16:03, Jonathan Roberts wrote:

> Hi Scott,
>  
> I have 2 applications using a number of Value Objects.  One of these is a Web 
> Service.  In the Web Service implementation the Timestamp is in one of the Value 
> Objects however its value is nver set, and always null.  On my development server 
> this seems to work fine and seems to deal with it 
(maybe false comfort).  
>  
> This is the same scenario on the deployment Server, however here it seems to fail.  
> It's as if its denomination xsi:null="true", is sufficent to allow it through the 
> soap system, i.e. since it is always null, soap has never attempted to try and 
> deserialize it.
>  
> Hope this makes sense.
>  
> Jonathan
> 
> Scott Nichol <[EMAIL PROTECTED]> wrote:
> I don't see how it could ever work, unless some version of 
> java.sql.Timestamp has a default ctor. The following code in 
> BeanSerializer creates the bean:
> 
> private Object instantiateBean(Class javaType)
> throws IllegalArgumentException
> {
> try
> {
> return javaType.newInstance();
> }
> catch (Throwable t)
> {
> throw new IllegalArgumentException("Unable to instantiate '" +
> 
> StringUtils.getClassName(javaType) +
> "': " + t.getMessage());
> }
> }
> 
> The newInstance is only going to work if the class has a default ctor 
> (or in Sun's terminology, a "nullary constructor").
> 
> On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:
> 
> > HI Scott,
> > 
> > I thought I'd got around this by declaring the java.sql.Timestamp as a class in 
> > the xml file and loaded it with all the other classes. This seems to be fine on my 
> > machine but not on a deployment server. Could it be a class problem?
> > 
> > Cheers
> > 
> > Jonathan
> > 
> > Scott Nichol wrote:
> > java.sql.Timestamp does not have a default constructor, which Apache 
> > SOAP requires for instantiation. An alternative for you would be to 
> > return a java.util.Date, which Apache SOAP knows how to serialize and 
> > de-serialize.
> > 
> > On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> > 
> > > Hi.
> > > 
> > > I'm getting the following errors on the response from the soap server :
> > > 
> > > on the 
> > > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > > call
> > > where Response r;
> > > and Call c;
> > > ---------------------------------------------------------------------------
> > > 
> > > Error report : 
> > > 1. If information exists and is returned :
> > > 
> > > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > > 
> > > You chose fetchAccountUsingAccountNo 10015301
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 
> > > 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > > 
> > > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > > 
> > > ----------------------------------------------------------------------------------------------------
> > > 2. If no information:
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > > 
> > > Can't yet deserialize non-null Objects; 
> > > 
> > > targetException=java.lang.IllegalArgumentException: Can't yet deserialize 
> > > non-null Objects]
> > > 
> > > ------------------------------------------
> > > 
> > > Isssues : 
> > > 
> > > 1. I'm aware of problems with the timestamp and have set it up in the client 
> > > side thus have named it explicitly :
> > > 
> > > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > > //map the type
> > > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > > //telling the call object to use this mapping
> > > c.setSOAPMappingRegistry(smr);
> > > 
> > > 2. and the xml
> > > 
> > > > 
> > > xmlns:x="urn:xml-IVR-App" 
> > > 
> > > qname="x:java.sql.Timestamp"
> > > 
> > > javaType="java.sql.Timestamp"
> > > 
> > > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > />
> > > 
> > > 3. Wierder - this works on the development machine but not on the stand-alone 
> > > Test Server.
> > > 
> > > Any help would be appreciated.
> > > 
> > > Jonathan
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ---------------------------------
> > > Yahoo! Plus - For a better Internet experience
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.


Reply via email to