ࡱ> ;:&( b/ 0DTimes New RomanH;|d 0 & 0hDCourier NewmanH;|d 0 & 0h1 ` .  @n?" dd@  @@`` <0     c $@7Yʚ;2Nʚ;g4DdDdd 0.ppp@ <4!d!dg? 0D4<<4ddddg? 0D4< 5Services in pyGlobus and the AG   A service to exportCfrom AG.services.soap.Server import Server, InsecureServer class MyService: def __init__(self, initial_value): print "In myservice constructor, initial_value = ", initial_value self.initial_value_ = initial_value def add(self, cinfo, x, y): print "Add: connection info is ", cinfo print "Adding %d to %d" % (x, y) return x + y def get_initial_value(self, cinfo): print "get_initial_value: connection info is ", cinfo print "Returning initial value ", self.initial_value_ return self.initial_value_ DZD+ ; m3_:cSome code to do itdef main(): server = Server(0) s = server.create_service_object() handler = MyService(123) s.register_function(handler.add, "add", 1) s.register_function(handler.get_initial_value, "get_initial_value", 1) server.run_in_thread() X  Invoking a methodfrom AG.services.soap import Client c = Client.Handle(sys.argv[1]) print c.get_proxy().add(3, 4) print c.get_proxy().get_initial_value() :NAbstractions: ServerA server contains the communications endpoint for a service (GSI socket, TCP socket).  Listens on a port For GSI, is the location of Globus-level authorization mechanism Authorization callback&6Abstractions: Service ObjectA service object provides the binding between service implementation code and a particular Server. Identified by a URL: http://host:port/service-ident A Server is a factory for creating Service Objects6x3x33 Service APIThe Service API is the set of named operations provided by a Service. Each operation takes zero or more typed arguments, and returns a value.  Method BindingEach service operation is bound to a Python callable (function or bound method) Lowlevel mechanism: sobj.register_function(callable,  name , info_flag) info_flag is true if per-connection information to be passed to implementation Fd8Pd8 G,P   Defining a handler class2from AG.services.xmlrpc.Server import Server, InsecureServer from AG.services.xmlrpc.ServiceBase import ServiceBase class MyService(ServiceBase): def __init__(self, initial_value): self.initial_value_ = initial_value def add(self, cinfo, x, y): """ The following annotation causes this method to be callable as an XMLRPC method on this service. xmlrpc_export_as: add pass_connection_info: true """ print "add cinfo ", cinfo print "Adding %d to %d" % (x, y) return x + y3Z3    iR?   What s happeningMethod annotations to define binding to service xmlrpc_export_as: Export this function as a service operation with the given name pass_connection_info: if true pass caller info into the method. 0  And at a higher level*?xml version="1.0" encoding="UTF-8"?> This is a simple service example +Z+2      J Cont.i This operation adds two numbers and returns the result One operand The other operand .iZZi@  Cont. Return the initial value passed in when the service was created. * * Using service descriptionsThe agsd tool takes as input a description and generates code agsd.py make-server-stub -o Service.py --impl ServiceImpl.py service-desc-file To create documentation agsd.py make-html -o Service.html service-desc-filel>U;>S97  ( ` ` ̙33` 333MMM` ff3333f` f` f` 3>?" dd@,|?" dd@   " @ ` n?" dd@   @@``PR    @ ` ` p>> f(    64h P  T Click to edit Master title style! !  0   RClick to edit Master text styles Second level Third level Fourth level Fifth level!     S  0Ĕ ``  >*  0L `   @*  0 `   @*H  0޽h ? ̙33 Default Design  $(  r  S Xp  r  S  `    H  0޽h ? ̙33  0 $(   r  S !   r  S @  H  0޽h ? ̙33  @$(  r  S 2  2 r  S   2 H  0޽h ? ̙33  $$(  $r $ S `2P  2 r $ S 2 2 H $ 0޽h ? ̙33  P$(  r  S 2P  2 r  S 2 2 H  0޽h ? ̙33  `$(  r  S 2P  2 r  S %2 2 H  0޽h ? ̙33  p$(  r  S  2P  2 r  S <  H  0޽h ? ̙33   $(   r  S xc2P  2 r  S \2 2 H  0޽h ? ̙33  ($(  (r ( S HQ2  2 r ( S T޺   H ( 0޽h ? ̙33  ,$(  ,r , S mP   r , S p2 2 H , 0޽h ? ̙33  0$(  0r 0 S l2P   r 0 S 2 2 H 0 0޽h ? ̙33  4$(  4r 4 S LP   r 4 S V  H 4 0޽h ? ̙33  8$(  8r 8 S 8P   r 8 S 8  H 8 0޽h ? ̙33  <$(  <r < S tP  y r < S <2 2 H < 0޽h ? ̙33rD.')+/n1Z3F5-279 ;<>@BOh+'0 `h   Services in pyGlobus and the AGolsonesolsones1soMicrosoft PowerPointand@p@ln@`#n!Gg  R& &&#TNPP2OMiy & TNPP &&TNPP    --- !---&G&qw@# LSwUSw0- &Gy& --iyH-- @Times New RomanLSwUSw0- .2 AW Services in !. .2 Ai pyGlobus +. .2 A\ and the AG**.--"System 0-&TNPP &՜.+,0    On-screen ShowMCS/FLe*C{2 Times New Roman Courier NewDefault Design Services in pyGlobus and the AGA service to exportSome code to do itInvoking a methodAbstractions: ServerAbstractions: Service Object Service APIMethod BindingDefining a handler classWhats happeningAnd at a higher levelCont.Cont.Using service descriptions  Fonts UsedDesign Template Slide Titles_Colsonolson  !#$%&'()+,-./013456789<Root EntrydO)Current User2SummaryInformation("PowerPoint Document(*CDocumentSummaryInformation8*