Using a python client with gRAVI service

From Globus

prerequisites

  • install pyGridWare
  • created and deployed a gRAVI service to a globus container


generate bindings

  • gRAVI HelloWorld Service [tar]

Deploy the gRAVI service and start the container

 % tar tvzf HelloWorld.tar.gz
 % cd HelloWorld
 % globus-deploy-gar cagrid_HelloWorld.gar
 $ globus-start-container-detached -nosec

Point the wsdl2web tool at your running service:

 % cd ~/hello_world_example
 % wsdl2web --rpy=HelloWorld.rpy --script=run.py http://192.168.15.20:8080/wsrf/services/cagrid/HelloWorld?wsdl
 % wsdl2web --rpy=HelloWorldResultResource.rpy --script=runHelloWorldResultResource.py http://192.168.15.20:8080/wsrf/services/cagrid/HelloWorldResultResource?wsdl

Generates these files/directories:

 $ ls
 generated  README  runHelloWorldResultResource.py  run.py  services  twisted


Download Python Code & Run Example

  • python client code [tar]

Download and untar

 % cd ~/hello_world_example
 % tar xvzf Hello_clients.tar.gz
 runClientNew.py
 runClientKill.py
 runClientStatus.py

Use the python client

 $ ./runClientNew.py -d0
 $ cat client.epr 
 <ns2:HelloWorldResultResourceReference xmlns:ns1="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:ns2="http://helloworld.cagrid.org/HelloWorld/Context/types"><ns1:EndpointReference xmlns:ns3="http://www.w3.org/2001/XMLSchema-instance" ns3:type="ns1:EndpointReferenceType"><ns1:Address>http://192.168.15.20:8080/wsrf/services/cagrid/HelloWorldResultResource</ns1:Address><ns1:ReferenceProperties xmlns:ns4="http://helloworld.cagrid.org/HelloWorld/Context"><ns4:HelloWorldResultResourceResultsKey xmlns:ns5="http://www.w3.org/2001/XMLSchema" ns3:type="ns5:string">c3ebffd0-4721-11de-b82f-e9e544526a06</ns4:HelloWorldResultResourceResultsKey></ns1:ReferenceProperties><ns1:ReferenceParameters></ns1:ReferenceParameters></ns1:EndpointReference></ns2:HelloWorldResultResourceReference>
 $ ./runClientStatus.py -d0
 Remote Directory:  /tmp/HelloWorld1243032121424
 Status:  Finished: 0
 CONTENTS:  Z3JlZWNlCg==
 $ ./runClientKill.py -d0
 Status  Finished: 0
 Destroyed
Personal tools
Execution Projects
Information projects
Distribution Projects
Documentation Projects
Deprecated