source: vanHelsing/trunk/src/VanHelsingServer.py@ 830

Last change on this file since 830 was 826, checked in by slederer, on Feb 19, 2010 at 5:24:59 PM

weitere Tests mit ZSI

File size: 1.1 KB
Line 
1from ZSI.ServiceContainer import ServiceContainer, SOAPRequestHandler
2from ZSI.schema import LocalElementDeclaration, ElementDeclaration, TypeDefinition, GTD, GED
3from VanHelsing_server import VanHelsing
4
5ResourceInfo= GTD("http://www.dass-it.de/VanHelsing/", "ResourceInfo")(None).pyclass()
6print ResourceInfo
7
8class VanSOAPRequestHandler(SOAPRequestHandler):
9 def do_GET(self):
10 wsdl=open("VanHelsing.wsdl").read()
11 self.send_xml(wsdl)
12
13def AsServer(port=80, services=(), RequestHandlerClass=SOAPRequestHandler):
14 address = ("127.0.0.1",port)
15 sc = ServiceContainer(address, RequestHandlerClass=RequestHandlerClass)
16 for service in services:
17 path = service.getPost()
18 sc.setNode(service,path)
19 sc.serve_forever()
20
21
22class RealVanHelsing(VanHelsing):
23 def soap_listResources(self, ps, **kw):
24 request,response=VanHelsing.soap_listResources(self,ps)
25 resInf=ResourceInfo()
26 response._resourceList=[ resInf ]
27
28 print response._resourceList
29 return request,response
30
31if 1:
32 AsServer(port=8080,services=[ RealVanHelsing() ], RequestHandlerClass=VanSOAPRequestHandler)
33
Note: See TracBrowser for help on using the repository browser.