Changeset 836 for vanHelsing/trunk
- Timestamp:
- Mar 12, 2010, 2:28:51 PM (15 years ago)
- Location:
- vanHelsing/trunk/src
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/src/VanHelsingServer.py
r826 r836 2 2 from ZSI.schema import LocalElementDeclaration, ElementDeclaration, TypeDefinition, GTD, GED 3 3 from VanHelsing_server import VanHelsing 4 from VanHelsing_types import ns0 5 import VanHelsingWrapper 6 import sys 4 7 5 8 ResourceInfo= GTD("http://www.dass-it.de/VanHelsing/", "ResourceInfo")(None).pyclass() 6 print ResourceInfo 9 listResourcesType= GTD("http://www.dass-it.de/VanHelsing/", "listResourcesType")(None).pyclass() 10 #print dir(ResourceInfo) 7 11 8 12 class VanSOAPRequestHandler(SOAPRequestHandler): … … 23 27 def soap_listResources(self, ps, **kw): 24 28 request,response=VanHelsing.soap_listResources(self,ps) 25 resInf=ResourceInfo()26 response._resourceList=[ resInf ]27 29 28 print response._resourceList 30 resType=request.get_element_resourceType() 31 resDirector=request.get_element_director() 32 33 result=VanHelsingWrapper.getResources(resDirector,resType) 34 35 rList=[] 36 37 for rid,name in result: 38 39 resInf=response.new_resourceList() 40 resInf.set_element_director(resDirector) 41 resInf.set_element_resId(rid) 42 resInf.set_element_resType(resType) 43 resInf.set_element_resName(name) 44 rList.append(resInf) 45 46 response.set_element_resourceList(rList) 47 29 48 return request,response 30 49 31 50 if 1: 51 if len(sys.argv) < 2: 52 filename="test.conf" 53 else: 54 filename=sys.argv[1] 55 56 VanHelsingWrapper.loadDirectorConfig(filename) 57 32 58 AsServer(port=8080,services=[ RealVanHelsing() ], RequestHandlerClass=VanSOAPRequestHandler) 33 59 -
vanHelsing/trunk/src/VanHelsingWrapper.py
r835 r836 5 5 import directive 6 6 import ResourceInfo 7 8 import ZSI9 import ZSI.dispatch10 7 11 8 import sys … … 85 82 return dirdcfg.getRoot().getByName(name,resType)[0] 86 83 87 def listResources(listResourcesType):88 print listResourcesType89 return [ r1,r2 ]90 91 84 # main 92 85 if __name__ == "__main__": … … 100 93 print getResources("bacula-dir","Client") 101 94 102 ZSI.dispatch.AsServer(port=8080,docstyle=True) -
vanHelsing/trunk/src/bcfg.py
r835 r836 159 159 # 160 160 # nur zum Testen 161 from VanHelsing SOAPimport *161 from VanHelsingWrapper import * 162 162 163 163 if __name__ == "__main__":
Note:
See TracChangeset
for help on using the changeset viewer.