What is a good RPC model for building a AJAX web app using PHP & JS?

Posted by user366152 on Stack Overflow See other posts from Stack Overflow or by user366152
Published on 2010-06-14T09:06:35Z Indexed on 2010/06/14 9:12 UTC
Read the original article Hit count: 139

Filed under:
|
|

I'm new to writing AJAX applications. I plan on using jQuery on the client side while PHP on the server side. I want to use something like XML-RPC to simplify my effort in calling server-side code. Ideally, I wouldn't care whether the transport layer uses XML or JSON or a format more optimized for the wire.

If I was writing a console app I'd use some tool to generate function stubs which I would then implement on the RPC server while the client would natively call into those stubs. This provides a clean separation. Is there something similar available in the AJAX world?

While on this topic, how would I proceed with session management? I would want it to be as transparent as possible. For example, if I try to hit an RPC end-point which needs a valid session, it should reject the request if the client doesn't pass a valid session cookie.

This would really ease my application development. I'd then have to simply handle the frontend using native JS functions. While on the backend, I can simply implement the RPC functions.

BTW I dont wish to use Google Web Toolkit. My app wont be extremely heavy on AJAX.

© Stack Overflow or respective owner

Related posts about php

Related posts about AJAX