help on pickle tool

2006-10-05 Thread virg
Hi,
 i have client-server application which is written in python using
XMLRPC protocol. The existing client is a command line. Now client
application we are converting it as Web UI using java. I have seen some
problems in writing a java client. At the server for each request from
client, the server sends a response in hashtable and is serialized
using "pickle". The python function we call at the server is

pickle.dumps(r, 2)  -- where r is a hash table which needs to be
serialized

At the client (existing client  which in python) we use this call to
get the original data.

r = pickle.loads(result)

Since i am writing this client as Web UI client using java, i am not
able to deserialize this data
using java function "ObjectInputStream" and "ObjectInputStream" which
are most common functions for deserialization and i getting error as
invalid header.

Is it possible to deserialize the data by java  which serialized by
Python or is there any compatibility issue. Is there any equivalent
pickle tool on java which supports this operation. so that i can use
across languages.

Because of this problem i am not able to proceed further. Any body has
any pointers for this problem. Any help is highly appreciated

Thanks in advance

regards
Virg

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: help on pickle tool

2006-10-06 Thread virg
Hi,
 The data is simple dictionary with one or more keys. If i use YAML at
the client (webui) do i have to change serialisation method to YAML at
server also. Without changing serialisation method at server, can i use
any of the deserialisation methods at the client. We cannot change the
serialisation methods at the server since it is not under our control.

Thanks & reagards
virg


hanumizzle wrote:

> On 5 Oct 2006 21:52:56 -0700, virg <[EMAIL PROTECTED]> wrote:
> > Hi,
> >  i have client-server application which is written in python using
> > XMLRPC protocol. The existing client is a command line. Now client
> > application we are converting it as Web UI using java. I have seen some
> > problems in writing a java client. At the server for each request from
> > client, the server sends a response in hashtable and is serialized
> > using "pickle". The python function we call at the server is...
>
> What kind of data are we talking about? Is it strictly dictionary /
> list stuff or is it more complex (functions & other objects)? I can
> see 2 possible options: Jython or YAML. (I have been answering a lot
> of questions re: serialization today and mentioned YAML in all of them
> :))

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: help on pickle tool

2006-10-06 Thread virg
At the server, based on client request it does some computations , it
sends the result as dictionary (serialized) to the client.

hanumizzle wrote:
> On 6 Oct 2006 01:41:48 -0700, virg <[EMAIL PROTECTED]> wrote:
> > Hi,
> >  The data is simple dictionary with one or more keys. If i use YAML at
> > the client (webui) do i have to change serialisation method to YAML at
> > server also. Without changing serialisation method at server, can i use
> > any of the deserialisation methods at the client. We cannot change the
> > serialisation methods at the server since it is not under our control.
>
> Oh, poopy.
> 
> What do you have at the server end?
> 
> -- Theerasak

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: help on pickle tool

2006-10-06 Thread virg
Yes your are right. I will send a dictionary object from the server to
the client.
I already have client which is written in python. But we are migrating
the python client which is a command line tool  to Web UI client
(java).  If it is possible to call python function from java, i need to
read more about jython, i am new to this.


hanumizzle wrote:
> On 6 Oct 2006 02:03:07 -0700, virg <[EMAIL PROTECTED]> wrote:
> > At the server, based on client request it does some computations , it
> > sends the result as dictionary (serialized) to the client.
>
> If I interpret your message correctly, you are receiving a Python
> dictionary object from the server. Yes? In this case, I guess it might
> be necessary to use Jython. I'm drawing a blank otherwise.
>
> (This may be naive, but can you write the client in Python as well?)
> 
> -- Theerasak

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: help on pickle tool

2006-10-06 Thread virg
Hi,

Yes, using python client we are able deserialize data using

r = pickle.loads(result).

where result is a response from the server and r is a dictionary after
deserialization.
For serialisation at the server written in python using
pickle.dumps(result, 2)

Now we are developing web based Client using java. So we are writing
client in java. If server and client are in python we dont see any
problems since we are using same serialisation tool "pickle". Now we
have seen problems because we are writing client in java. we did not
find equivalent function on java for this tool pickle. If i use
standard java desrialisation functions i am getting error as invalid
header becasue of incompatibility between python and java. Please help
me if you have any clue

regards,
- Virg

hanumizzle wrote:
> On 6 Oct 2006 02:29:59 -0700, virg <[EMAIL PROTECTED]> wrote:
> > Yes your are right. I will send a dictionary object from the server to
> > the client.
> > I already have client which is written in python. But we are migrating
> > the python client which is a command line tool  to Web UI client
> > (java).
>
> Please explain 'Web UI'. Can Python perform an equivalent function?
> 
> -- Theerasak

-- 
http://mail.python.org/mailman/listinfo/python-list