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 Elham Chandler <ec...@interwoven.com> on 2000/12/21 19:28:41 UTC

nested classes

Hi,

I have the following scenerio that causes a runtime exception to occur:

public class foo implements serializable
{
  private String location;
  public static abstract class Context implements serializable
  {
  private int ctxid;
  ... <some other methods>
  }
... < more methods>
}

when foo is compiled, it generates a foo.class and a foo$Context.class.
Both foo.class and foo$Context.class are in foo.jar.

My "Service" file tries to return a "foo" object to the client application.
Therefore, in my client application, I went ahead and registered foo.class
with
the SOAPMappingRegistry and used the BeanSerializer for serializing the
object.

ie. SOAPMappingRegistry smr = new SOAPMappingRegistry();
    BeanSerializer beanSer = new BeanSerializer();
    smr.mapTypes(Contants.NR_URI_SOAP_ENC,
		new Qname("url:xml-soap-foo-demo", "foo"), foo.class,
		beanSer, beanSer);


However, when I run my application I get Internal Server Error 500
returned in my packet. The reason it complains is because :
	java.lang.IllegalArgumentException: No Serializer found to
	serialize a 'foo$Context' using encoding style
	'http://schemas.xmlsoap.org.soap/encoding/'.
	at org.apache.soap.util.xml.XMLJavaMappingRegistry.querySerializer ...

So apparently I need to provide a mapping for foo$Context.class but since
it is an abstract nested class, how would I do that registration with
the SOAPMappingRegistry ?

I don't know if I have conveyed the information sufficiently in my example.
I hope someone understands what I am trying to do! Thanks in advance.

Elham Chandler
Interwoven, Inc.


RE: nested classes

Posted by Elham Chandler <ec...@interwoven.com>.
I never heard back from anyone on this question and from reading up on
the SOAP specs, I haven't found any reference to serializing nested/inner
classes. Can someone confirm if this can be done or is legal with SOAP ?
I just want some acknowledgement...!

Thanks!

Elham Chandler
Interwoven, Inc.

> -----Original Message-----
> From: Elham Chandler [mailto:echandle@interwoven.com]
> Sent: Thursday, December 21, 2000 10:29 AM
> To: Soap-User@Xml. Apache. Org
> Subject: nested classes
>
>
>
> Hi,
>
> I have the following scenerio that causes a runtime exception to occur:
>
> public class foo implements serializable
> {
>   private String location;
>   public static abstract class Context implements serializable
>   {
>   private int ctxid;
>   ... <some other methods>
>   }
> ... < more methods>
> }
>
> when foo is compiled, it generates a foo.class and a foo$Context.class.
> Both foo.class and foo$Context.class are in foo.jar.
>
> My "Service" file tries to return a "foo" object to the client
> application.
> Therefore, in my client application, I went ahead and registered foo.class
> with
> the SOAPMappingRegistry and used the BeanSerializer for serializing the
> object.
>
> ie. SOAPMappingRegistry smr = new SOAPMappingRegistry();
>     BeanSerializer beanSer = new BeanSerializer();
>     smr.mapTypes(Contants.NR_URI_SOAP_ENC,
> 		new Qname("url:xml-soap-foo-demo", "foo"), foo.class,
> 		beanSer, beanSer);
>
>
> However, when I run my application I get Internal Server Error 500
> returned in my packet. The reason it complains is because :
> 	java.lang.IllegalArgumentException: No Serializer found to
> 	serialize a 'foo$Context' using encoding style
> 	'http://schemas.xmlsoap.org.soap/encoding/'.
> 	at
> org.apache.soap.util.xml.XMLJavaMappingRegistry.querySerializer ...
>
> So apparently I need to provide a mapping for foo$Context.class but since
> it is an abstract nested class, how would I do that registration with
> the SOAPMappingRegistry ?
>
> I don't know if I have conveyed the information sufficiently in
> my example.
> I hope someone understands what I am trying to do! Thanks in advance.
>
> Elham Chandler
> Interwoven, Inc.


purpose of DeploymentDescriptor.xml

Posted by Robert Dyas <rd...@adelphia.net>.
Hi,

What is the purpose of the file DeploymentDescriptor.xml that you will find
in the various SOAP samples?

I understand the contents, but it seems that this info is manually entered
via the SOAP admin client, and hence this file is never consulted on the
client or the server. Is this correct, or am I missing something? Is it
obsolete?

Robert Dyas


purpose of DeploymentDescriptor.xml

Posted by Robert Dyas <rd...@adelphia.net>.
Hi,

What is the purpose of the file DeploymentDescriptor.xml that you will find
in the various SOAP samples?

I understand the contents, but it seems that this info is manually entered
via the SOAP admin client, and hence this file is never consulted on the
client or the server. Is this correct, or am I missing something? Is it
obsolete?

Robert Dyas


RE: nested classes

Posted by Elham Chandler <ec...@interwoven.com>.
I never heard back from anyone on this question and from reading up on
the SOAP specs, I haven't found any reference to serializing nested/inner
classes. Can someone confirm if this can be done or is legal with SOAP ?
I just want some acknowledgement...!

Thanks!

Elham Chandler
Interwoven, Inc.

> -----Original Message-----
> From: Elham Chandler [mailto:echandle@interwoven.com]
> Sent: Thursday, December 21, 2000 10:29 AM
> To: Soap-User@Xml. Apache. Org
> Subject: nested classes
>
>
>
> Hi,
>
> I have the following scenerio that causes a runtime exception to occur:
>
> public class foo implements serializable
> {
>   private String location;
>   public static abstract class Context implements serializable
>   {
>   private int ctxid;
>   ... <some other methods>
>   }
> ... < more methods>
> }
>
> when foo is compiled, it generates a foo.class and a foo$Context.class.
> Both foo.class and foo$Context.class are in foo.jar.
>
> My "Service" file tries to return a "foo" object to the client
> application.
> Therefore, in my client application, I went ahead and registered foo.class
> with
> the SOAPMappingRegistry and used the BeanSerializer for serializing the
> object.
>
> ie. SOAPMappingRegistry smr = new SOAPMappingRegistry();
>     BeanSerializer beanSer = new BeanSerializer();
>     smr.mapTypes(Contants.NR_URI_SOAP_ENC,
> 		new Qname("url:xml-soap-foo-demo", "foo"), foo.class,
> 		beanSer, beanSer);
>
>
> However, when I run my application I get Internal Server Error 500
> returned in my packet. The reason it complains is because :
> 	java.lang.IllegalArgumentException: No Serializer found to
> 	serialize a 'foo$Context' using encoding style
> 	'http://schemas.xmlsoap.org.soap/encoding/'.
> 	at
> org.apache.soap.util.xml.XMLJavaMappingRegistry.querySerializer ...
>
> So apparently I need to provide a mapping for foo$Context.class but since
> it is an abstract nested class, how would I do that registration with
> the SOAPMappingRegistry ?
>
> I don't know if I have conveyed the information sufficiently in
> my example.
> I hope someone understands what I am trying to do! Thanks in advance.
>
> Elham Chandler
> Interwoven, Inc.