source: TI12-security/trunk/python/Tests/AttAuthority/server-config.tac @ 1696

Subversion URL:
Revision 1696, 954 bytes checked in by pjkersha, 14 years ago (diff)

Working test code for ZSI Web Service using Twisted:

  • for server, used wsdl2dispatch - but make sure to edit the return types

in AttAuthority_services_server server class stubs to return request, response
tuple as required by Twisted interface. Created .tac file which loads a
sub class of the wsdl2dispatch generated class.

  • tested with standard ZSI client using stubs generated from wsdl2py. Also

tested with Twisted client - stubs generated with wsdl2py including the -w

1# example.tac
2from AttAuthority_services_server import AttAuthorityService
3from ZSI.twisted.WSresource import WSResource
4from twisted.application import service, internet
5from twisted.web.server import Site
6from twisted.web.resource import Resource
7import socket
9class AttAuthorityImpl(AttAuthorityService, WSResource):
10     def __init__(self):
11         WSResource.__init__(self)
13     def soap_getAttCert(self, ps, **kw):
14         print 'soap_getAttCert'
15         #import pdb;pdb.set_trace()
16         request, response = AttAuthorityService.soap_getAttCert(self, ps)
17         response._attCert = 'ATTRIBUTE CERT'
18         return request, response
20portNum = 5700
21hostname = socket.gethostname()
23root = Resource()
24root.putChild('AttributeAuthority',  AttAuthorityImpl())
25siteFactory = Site(root)
26application = service.Application("WSRF-Container")
27port = internet.TCPServer(portNum, siteFactory)#, interface=hostname)
Note: See TracBrowser for help on using the repository browser.