AccessGrid.org

Developer Example: Web Integration

This section describes some possibilities for integration of the Access Grid with the web. These include modifications to the Venue Server to handle calls from web browsers to using web-oriented languages to call the Access Grid services directly.

Venue Server Structure

VenueServer / SOAP Server (ZSI) / SSLServer / SocketServer

How requests are processed (roughly)

AGSOAPRequestHandler / SOAPRequestHandler (ZSI) / BaseHTTPRequestHandler

The request handlers define do_GET and do_POST methods that handle these two request types. do_POST is used by the SOAP server for handling method calls. do_GET is ignored, except for requests for the WSDL of a service, which is obtained by appending '?wsdl' to the URL of the service.

By modifying the behavior of the request handler, however, one can modify the behavior of the Venue Server with regard to HTTP GET requests.

Modifying the Venue Server to respond to web calls

Defining a custom request handler

CustomRequestHandler.py

Integrating the custom request handler into the Venue Server (a hack for now).

Edit AccessGrid/hosting/ZSI/ServiceContainer.py. Add the following import line at the top of the file:

from CustomRequestHandler import CustomRequestHandler

and modify the SecureServiceContainer constructor (__init__) to use the CustomRequestHandler:

def __init__(self, server_address,context, services=[],RequestHandlerClass=CustomRequestHandler):

Now the CustomRequestHandler will be called for each request.

Code Review

(review the CustomRequestHandler.py code)

Execution

Starting the VenueServer with these changes, and entering the Venue Server URL in a web browser returns an HTML representation of the Venue. Note that other rooms are represented by links which, if clicked, show the HTML view of that room. Also, data is represnted as links and can be viewed directly in the browser.

 

 

Security

do_GET really must check the security of the Venue before allowing HTTP GET requests through. In the trivial case, one could check if a certificate is required for accessing the Venue and, if so, disallowing the GET request. More correct would be to check if the certificate has been specifically authorized; in this case, the browser would have to present the appropriate certificate, which it should be able to do without trouble.

Calling AG services using PHP5 SOAP

Perhaps hacking the Venue Server is distasteful to you. In that case, consider the possibility of an adapter that talks to the VenueServer on one side and presents suitable HTML representations on the other side. A simple example doing this with PHP follows.

$venueclient = new soapclient('https://vv3.mcs.anl.gov:8000/Venues/default');
print $venueclient->GetState();

Building a Venue Browser using PHP5 SOAP

VenueBrowser.php

Conclusion

Ideally, the Venue Server would support plugins for integration of third-party code, similar to the mod_ support of Apache. In that case, a custom request handler would be integrated with the Venue Server via a plugin

Suggested Further Work

  • Integrated chat (Jabber) support
  • Integrated video (possible with Flash)
  • Integrated audio (possible with various browser plugins)

Supporting Code

CustomRequestHandler.py

ServiceContainer.py

VenuePrint.php

VenueBrowser.php

login or register to post comments