[SoapRMI] Re: [SoapRMI] generic object

Aleksander Slominski aslom_at_cs.indiana.edu
Sat, 02 Nov 2002 02:28:57 -0500


"nodep_at_libero.it" wrote:

> > "nodep_at_libero.it" wrote:
> >
> > > Hi, I'm an italian student (University of Padova - Italy)
> > > and I would like to know if soapRMI (XSOAP) can to transport
> > > generic object (as parameter).
> >
> > hi,
> >
> > what do you mean by generic object? if want to transport
> > arbitrary XML fragment  for an example of how to use it
> > please see ogsa.GridServiceImpl in XSOAP samples directory.
> > method converStringToXmlTree() can be used to convert
> > any XML fragment to XML node tree that can be sent
> > and received easily.
> >
> > let me know if there is anything different that you need.

>
> I mean that I need to pass, as parameter, an object
> but his ".class" reside only on the client side
> and I would the server bring the copy of
> the object (received as parameter) and do
> something with it.
>
> Something like:
>
> (Client-side)
> ....
> Service serverRef = (Service) Naming.lookup(name);
> myobject mo=new myobject();
> Object answer=serverRef.dosomething(mo);
> ....
>
> (Server-side)
> public interface Service extends Remote
> {
>         public Object dosomething(myobject o) throws RemoteException;
> }

hi Stefano,

this can be accomplished if you make server side service to use XmlNode
in method signature. in such case service will receive actual XML into node tree
represented by XmlNode and your Service should have following signature

public interface Service extends Remote
{
        public XmlNode dosomething(XmlNode o) throws RemoteException;
}

(you can find description of XmlNode at this location (it is part of XPP2):
http://www.extreme.indiana.edu/xgws/xsoap/xpp/download/PullParser2/doc/api/

> A question linked with this problem is: is there in XSOAP a
> ClassLoader
> like java.rmi.server.RMIClassLoader?

as XSOAP supports any SOAP clients so we can not
assume that java class can be loaded dynamically so
we did not do anything to emulate RMIClassLoader.

hope it helps.

alek
--
---         Memorable Quote from Firefly (105. Out Of Gas)
-Ship like this, be with you until you die -That's because it's a deathtrap