From: Michael <mp...@uw...> - 2004-12-02 18:37:55
|
Thanks for the reply. I was actually planning on using XML-RPC for transfer of 'naked' data only, not HTML. One thing that intrigues me is that Python and JavaScript are actually quite close in their syntax of data types: [] for lists and arrays and {} for dicts and 'objects', respectively. Replace 'None' by 'null' , lowercase True and False and you are there. Parsing the received data then is just a matter of calling 'eval'. 30 lines of code on either side, and you are able to exchange arbitrarily nested data. Ian Bicking wrote: > Michael wrote: > >> For a more complex web app, I'm considering options for remote >> scripting without page reload. >> I know there is XMLRPCServlet. Has anyone been using that with a >> JavaScript client? If so, what was your experience? > > > I haven't used the Javascript XMLHttpRequest myself, though I keep > planning to try it. I don't get the impression it is usually used as > XML-RPC, though I'm sure it could be. Often the result returned by > the server is itself HTML (e.g., an HTML fragment that should be > inserted into the page somewhere), which isn't valid XML-RPC. Unless > you entity-encoded it or something. > > Anyway, XMLRPCServlet is a fairly thin wrapper -- if you read the > source it should be easy to understand. You could use some of the > same mechanism in your servlet without involving xmlrpclib. > -- Michael Palmer Department of Chemistry University of Waterloo 2oo University Ave West Waterloo, ON N2L 3G1 Canada Phone 519 888 4567 ext 5100 Fax 519 746 0435 Office ESC 234 Lab C2-360 Web http://sciborg.uwaterloo.ca/~mpalmer/ |