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 Deane Sloan <De...@equinox.co.nz> on 2001/05/02 03:14:42 UTC

RE: Returning Object

Hi Alex,

>>Are you absolutely sure, that creating your own serializer is the only way
>>to handel this? Where do you take this Information from?
Yes - the default Bean serializer (at this point) does not support such
instancing behaviour for Bean properties. 
As noted - the test class I have created, does do so in varying degrees. I
recently posted a version (to the dev group) that supports generic objects
as Bean properties - this has also been modified to support generic
parameters typing also. 

Of course you could try and get the BeanSerializer modified, but this would
have consequences on existing code, and impacts how easily a service can be
defined in WSDL (instancing enhancements still outstanding?).

A simple answer is to use a Vector where you need a generic type. The Vector
serializer is forced to serialize/deserialize it's contents using only the
concrete instancing information. You still need to register the serializer
for the actual instances, and all the problems with WSDL exist.

Best Regards,
Deane Sloan

-----Original Message-----
From: ahomburg@intermediate.de [mailto:ahomburg@intermediate.de]
Sent: Tuesday, 24 April 2001 23:52
To: soap-user@xml.apache.org
Subject: RE: Returning Object



Hi Deane,
it seems you have been woking on the same Problem I do. I'm wondering if
there is a way to make SOAP get the Type-Information during runtime? If
yes, how do I do this? If No, what do I need Polymorphic Accessors for (see
5.3 below)?

Are you absolutely sure, that creating your own serializer is the only way
to handel this? Where do you take this Information from?

I'd really appreciate your help

Alex


The W3C sais ( 5.3 Polymorphic Accessor )

"Many languages allow accessors that can polymorphically access values of
several types, each type being available at run time. A polymorphic
accessor instance MUST contain an "xsi:type" attribute that describes the
type of the actual value.

For example, a polymorphic accessor named "cost" with a value of type
"xsd:float" would be encoded as follows:

<cost xsi:type="xsd:float">29.95</cost>

as contrasted with a cost accessor whose value's type is invariant, as
follows:

<cost>29.95</cost>"


------------------------------


Unless you create your own serializer for type "java.lang.Object", you
won't
be able to serialize this type as parameter or return type.

If you do implement your own serializer, the SOAP service becomes hard
(impossible?) to describe in WSDL and therefore limits it's
interoperability
- as the interface cannot be fully resolved until runtime.

Given the impracticality of this endeavour, I'd recommend staying clear of
"java.lang.Object" based function signatures. You'll also need to avoid
using interface or abstract class types within your signatures (including
JavaBean properties).

Having said this, I have made a serializer that serves such requirements,
for serializing the actual instance classes (as opposed to the type defined
on the JavaBean property) found within a JavaBean hierarchy. If
*absolutely*
needed, I can make this available on request (no support etc). Still, all
possible class instances that could be serialized, will need to be
JavaBeans
and registered with the mapping registry.

Best Regards,

Deane Sloan


-----Original Message-----
From: ahomburg@

To: soap-user@xml.apache.org
Sent: 13/04/01 00:14
Subject: Returning Object

I've deployed a Service with the following method

   public Object get( Object key )
   {
        return this.htSessionData.get( key );
   }

However, SOAP fails to build the response envelope even at runtime it
contains a String.

Can anyone help me?


this is what Tomcat sais:

>>(Thu Apr 12 13:47:43 CEST 2001) Processing SOAP request...
2001-04-12 01:47:43 - Ctx( /soap ): Exception in: R( /soap +
/servlet/rpcrouter
+ null) - javax.servlet.ServletException: Error building response
envelope
        at org.apache.soap.server.http.RPCRouterServlet.doPost(Compiled
Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:4
04)


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org