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 "Zhang, Lei (L.)" <lz...@ford.com> on 2000/10/18 00:43:05 UTC

Nested Object through SOAP

Hi, All,
Is it possible to pass nested object through SOAP and how to do the
serialize?  I have no problem passing a simple object.
I am trying to pass one nested object and got the following error-----

	 Internal error: exception thrown from the servlet service function
(uri=/xml-soap/rpcrouter.jsp): javax.servlet.ServletException: No Serializer
found to serialize a 'MY_SUB_OBJECT' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'., Stack:
javax.servlet.ServletException: No Serializer found to serialize a
'MY_SUB_OBJECT' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'. 
        at java.lang.Throwable.fillInStackTrace(Native Method) 
        at java.lang.Throwable.fillInStackTrace(Compiled Code) 
        at java.lang.Throwable.(Compiled Code) 
        at java.lang.Exception.(Compiled Code) 
        at javax.servlet.ServletException.(ServletException.java:122) 
        at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:384) 
        at _jsps._xml_0002dsoap._rpcrouter_jsp._jspService(Compiled Code) 
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:826) 
        at
com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.jav
a:476) 
 

My code is like ---

public class C{
	int i;
	String s;

	public void setI(int n){
		this.i = n;
	}

	public int getI( ){
		return this.i;
	}
	
	....

}


public class P{
	int i;
	C c;;

	public void setI(int n){
		this.i = n;
	}

	public int getI( ){
		return this.i;
	}
	

	public void setC(C cc){
		this.c = cc;
	}

	public C getC( ){
		return this.c;
	}
	....

}

I got the error when I tried to call my method from client side through
SOAP.

Any suggestion would be highly appreciated.

Thank you very much in advance.




Lei Zhang
GIRS Section
ITS Tools Development
Ford Systems Integration Center
phone:  313-621-7538  (temp)
fax:       313-845-3330
e-mail:  lzhang17@ford.com

"You're only here for a short visit. 
Don't hurry. Don't worry. 
And be sure to smell the flowers along the way."



Re: Nested Object through SOAP

Posted by Brian Hannan <bh...@airflash.com>.
According to XML Schema and SOAP, you can have nested objects.  In SOAP, an
object reduces to a Struct, which is just a complexType.  One Struct can contain
another Struct.  SOAP as defined by the 1.1 spec can do this.

As with any RPC-like mechanism, SOAP defines the basic atomic types which all
complex types should eventually reduce down to.  This is what simple types are
used for -- the building blocks of complex types.

Whether or not implementations of SOAP can do this is another story.  Currently
I'm building my own SOAP/XML Schema serializer/deserialzer which follows the SOAP
encoding rules, so I can plug it into SOAP impls and do everything allowed.
Chances are if your SOAP impl can't handle sub objects, you'll have to do the
same.

Hope this helps.

James McCauley wrote:

> "Zhang, Lei (L.)" wrote:
>
> > Hi, All,
> > Is it possible to pass nested object through SOAP and how to do the
> > serialize?  I have no problem passing a simple object.
> > I am trying to pass one nested object and got the following error-----
> >
> >          Internal error: exception thrown from the servlet service function
> > (uri=/xml-soap/rpcrouter.jsp): javax.servlet.ServletException: No Serializer
> > found to serialize a 'MY_SUB_OBJECT' using encoding style
> > 'http://schemas.xmlsoap.org/soap/encoding/'., Stack:
> > javax.servlet.ServletException: No Serializer found to serialize a
> > 'MY_SUB_OBJECT' using encoding style
> > 'http://schemas.xmlsoap.org/soap/encoding/'.
> >         at java.lang.Throwable.fillInStackTrace(Native Method)
> >
>
> You won't be able to pass these objects using SOAP encoding, as it says in the
> docs, it only handles a few simple types. This has subject has been rattling
> around here for a while , see 'xmi serialization' or 'object serialization'
> posts from earlier

--
Brian Hannan
Chief Admiral of Uncle Jam's Navy

"One nation under a groove, gettin' down just for the FUNK of it."


Re: Nested Object through SOAP

Posted by Brian Hannan <bh...@airflash.com>.
According to XML Schema and SOAP, you can have nested objects.  In SOAP, an
object reduces to a Struct, which is just a complexType.  One Struct can contain
another Struct.  SOAP as defined by the 1.1 spec can do this.

As with any RPC-like mechanism, SOAP defines the basic atomic types which all
complex types should eventually reduce down to.  This is what simple types are
used for -- the building blocks of complex types.

Whether or not implementations of SOAP can do this is another story.  Currently
I'm building my own SOAP/XML Schema serializer/deserialzer which follows the SOAP
encoding rules, so I can plug it into SOAP impls and do everything allowed.
Chances are if your SOAP impl can't handle sub objects, you'll have to do the
same.

Hope this helps.

James McCauley wrote:

> "Zhang, Lei (L.)" wrote:
>
> > Hi, All,
> > Is it possible to pass nested object through SOAP and how to do the
> > serialize?  I have no problem passing a simple object.
> > I am trying to pass one nested object and got the following error-----
> >
> >          Internal error: exception thrown from the servlet service function
> > (uri=/xml-soap/rpcrouter.jsp): javax.servlet.ServletException: No Serializer
> > found to serialize a 'MY_SUB_OBJECT' using encoding style
> > 'http://schemas.xmlsoap.org/soap/encoding/'., Stack:
> > javax.servlet.ServletException: No Serializer found to serialize a
> > 'MY_SUB_OBJECT' using encoding style
> > 'http://schemas.xmlsoap.org/soap/encoding/'.
> >         at java.lang.Throwable.fillInStackTrace(Native Method)
> >
>
> You won't be able to pass these objects using SOAP encoding, as it says in the
> docs, it only handles a few simple types. This has subject has been rattling
> around here for a while , see 'xmi serialization' or 'object serialization'
> posts from earlier

--
Brian Hannan
Chief Admiral of Uncle Jam's Navy

"One nation under a groove, gettin' down just for the FUNK of it."


Re: Nested Object through SOAP

Posted by Nathan Wray <nw...@mich.com>.
Actually since they're both bean types you can pass them, I'm doing similar nested
objects.  You need to register both the inner class and outer class with the bean
serializer, look at the address book sample for details.


James McCauley wrote:

> "Zhang, Lei (L.)" wrote:
>
> > Hi, All,
> > Is it possible to pass nested object through SOAP and how to do the
> > serialize?  I have no problem passing a simple object.
> > I am trying to pass one nested object and got the following error-----
> >
> >          Internal error: exception thrown from the servlet service function
> > (uri=/xml-soap/rpcrouter.jsp): javax.servlet.ServletException: No Serializer
> > found to serialize a 'MY_SUB_OBJECT' using encoding style
> > 'http://schemas.xmlsoap.org/soap/encoding/'., Stack:
> > javax.servlet.ServletException: No Serializer found to serialize a
> > 'MY_SUB_OBJECT' using encoding style
> > 'http://schemas.xmlsoap.org/soap/encoding/'.
> >         at java.lang.Throwable.fillInStackTrace(Native Method)
> >
>
> You won't be able to pass these objects using SOAP encoding, as it says in the
> docs, it only handles a few simple types. This has subject has been rattling
> around here for a while , see 'xmi serialization' or 'object serialization'
> posts from earlier

--
Nathan Wray
nwray@mich.com
--
|
|  "Currently, developers struggle to
|  make their distributed applications
|  work across the Internet when
|  firewalls get in the way.
|   [...]
|  Since SOAP [Simple Object Access Protocol]
|  relies on HTTP as the transport
|  mechanism, and most firewalls allow
|  HTTP to pass through, you'll have no
|  problem invoking SOAP endpoints
|  from either side of a firewall."
|
|    -- Microsoft, on how SOAP uses HTTP
|    tunneling to circumvent network security
|
|  http://msdn.microsoft.com/library/periodic/period00/soap.htm
|



Re: Nested Object through SOAP

Posted by Nathan Wray <nw...@mich.com>.
Actually since they're both bean types you can pass them, I'm doing similar nested
objects.  You need to register both the inner class and outer class with the bean
serializer, look at the address book sample for details.


James McCauley wrote:

> "Zhang, Lei (L.)" wrote:
>
> > Hi, All,
> > Is it possible to pass nested object through SOAP and how to do the
> > serialize?  I have no problem passing a simple object.
> > I am trying to pass one nested object and got the following error-----
> >
> >          Internal error: exception thrown from the servlet service function
> > (uri=/xml-soap/rpcrouter.jsp): javax.servlet.ServletException: No Serializer
> > found to serialize a 'MY_SUB_OBJECT' using encoding style
> > 'http://schemas.xmlsoap.org/soap/encoding/'., Stack:
> > javax.servlet.ServletException: No Serializer found to serialize a
> > 'MY_SUB_OBJECT' using encoding style
> > 'http://schemas.xmlsoap.org/soap/encoding/'.
> >         at java.lang.Throwable.fillInStackTrace(Native Method)
> >
>
> You won't be able to pass these objects using SOAP encoding, as it says in the
> docs, it only handles a few simple types. This has subject has been rattling
> around here for a while , see 'xmi serialization' or 'object serialization'
> posts from earlier

--
Nathan Wray
nwray@mich.com
--
|
|  "Currently, developers struggle to
|  make their distributed applications
|  work across the Internet when
|  firewalls get in the way.
|   [...]
|  Since SOAP [Simple Object Access Protocol]
|  relies on HTTP as the transport
|  mechanism, and most firewalls allow
|  HTTP to pass through, you'll have no
|  problem invoking SOAP endpoints
|  from either side of a firewall."
|
|    -- Microsoft, on how SOAP uses HTTP
|    tunneling to circumvent network security
|
|  http://msdn.microsoft.com/library/periodic/period00/soap.htm
|



Re: Nested Object through SOAP

Posted by James McCauley <ja...@ebookers.com>.
"Zhang, Lei (L.)" wrote:

> Hi, All,
> Is it possible to pass nested object through SOAP and how to do the
> serialize?  I have no problem passing a simple object.
> I am trying to pass one nested object and got the following error-----
>
>          Internal error: exception thrown from the servlet service function
> (uri=/xml-soap/rpcrouter.jsp): javax.servlet.ServletException: No Serializer
> found to serialize a 'MY_SUB_OBJECT' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'., Stack:
> javax.servlet.ServletException: No Serializer found to serialize a
> 'MY_SUB_OBJECT' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'.
>         at java.lang.Throwable.fillInStackTrace(Native Method)
>

You won't be able to pass these objects using SOAP encoding, as it says in the
docs, it only handles a few simple types. This has subject has been rattling
around here for a while , see 'xmi serialization' or 'object serialization'
posts from earlier


Re: Nested Object through SOAP

Posted by James McCauley <ja...@ebookers.com>.
"Zhang, Lei (L.)" wrote:

> Hi, All,
> Is it possible to pass nested object through SOAP and how to do the
> serialize?  I have no problem passing a simple object.
> I am trying to pass one nested object and got the following error-----
>
>          Internal error: exception thrown from the servlet service function
> (uri=/xml-soap/rpcrouter.jsp): javax.servlet.ServletException: No Serializer
> found to serialize a 'MY_SUB_OBJECT' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'., Stack:
> javax.servlet.ServletException: No Serializer found to serialize a
> 'MY_SUB_OBJECT' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'.
>         at java.lang.Throwable.fillInStackTrace(Native Method)
>

You won't be able to pass these objects using SOAP encoding, as it says in the
docs, it only handles a few simple types. This has subject has been rattling
around here for a while , see 'xmi serialization' or 'object serialization'
posts from earlier