Chris,

I appreciate that it was a while since you posted this request but I was wondering 
did you ever get this implemented and if so did you have any problems when doing it.
We are currently looking at serializing objects and exchanging them between an applet 
and an ND5 project.

Any advice you could give us would be appreciated.

Cheers,
Pat.



"Scott, Chris" <[EMAIL PROTECTED]> wrote:
>
>Has anyone tried to use the object serialization features in JDK1.1
>with CSpCPHttpProxy to exchange objects between an applet and
>the ND server?
>
>Object serialization is a JDK 1.1 feature that provides an easy way
>for clients and servers to exchange java objects. These objects are
>normal java objects and can contain primitive data types and other
>objects.
>The only requirement is that they implement the Serializable interface
>(an interface with no methods). If object serialization can be used with
>CSpCPHttpProxy, then applets should be able to exchange objects
>with the ND server over http.
>
>I haven't tried this (yet), but it seems like it would be possible to
>send
>an object from an applet to the ND server as follows:
>
>1. Create a ByteArrayOutputStream.
>2. Attach an ObjectOutputStream to the ByteArrayOutputStream.
>3. Create and populate the object you want to send to the server.
>4. Serialize the object to the byte array using ObjectOutputStream's
>writeObject method.
>5. Convert the byte array to a string.
>6. Create a CSpNvp using the string.
>7. Call CSpCPHttpProxy's executeWebEvent method, passing the
>CSpNvp in the CSpNvpList.
>
>On the server side, the reverse process is:
>
>1. Get the value from the NVP (a string containing the serialized
>object).
>2. Convert the string to a byte array, and construct a
>ByteArrayInputStream object.
>3. Attach an ObjectInputStream to the ByteArrayInputStream.
>4. Deserialize the object from the byte array using ObjectInputStream's
>readObject method.
>
>For the server to send back a response to the applet, the process seems
>like
>it might be a bit simpler. The server could attach an ObjectOutputStream
>to the
>CSpider.getOutputStream, and use writeObject to send the object to the
>applet.
>Since executeWebEvent returns an InputStream, the applet could attach an
>ObjectInputStream to this InputStream, and read the returned object.
>
>This might sould like alot of overhead, but I'm hoping I can extend
>CSpCPHttpProxy
>to hide all this on the client side, and use a single page class on the
>server side
>to handle the web events from CSpCPHttpProxy.executeWebEvent and
>therefore hide
>the complexity on the server side.
>

_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to