Rev | Line | |
---|
[824] | 1 | from ZSI.ServiceContainer import ServiceContainer, SOAPRequestHandler
|
---|
[826] | 2 | from ZSI.schema import LocalElementDeclaration, ElementDeclaration, TypeDefinition, GTD, GED
|
---|
[824] | 3 | from VanHelsing_server import VanHelsing
|
---|
| 4 |
|
---|
[826] | 5 | ResourceInfo= GTD("http://www.dass-it.de/VanHelsing/", "ResourceInfo")(None).pyclass()
|
---|
| 6 | print ResourceInfo
|
---|
| 7 |
|
---|
[824] | 8 | class VanSOAPRequestHandler(SOAPRequestHandler):
|
---|
| 9 | def do_GET(self):
|
---|
| 10 | wsdl=open("VanHelsing.wsdl").read()
|
---|
| 11 | self.send_xml(wsdl)
|
---|
| 12 |
|
---|
| 13 | def 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 |
|
---|
[826] | 21 |
|
---|
| 22 | class 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 |
|
---|
[824] | 31 | if 1:
|
---|
[826] | 32 | AsServer(port=8080,services=[ RealVanHelsing() ], RequestHandlerClass=VanSOAPRequestHandler)
|
---|
[824] | 33 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.