source: TI12-security/trunk/python/ndg.security.test/ndg/security/test/Echo/README @ 2539

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.test/ndg/security/test/Echo/README@3105
Revision 2539, 4.6 KB checked in by mhenning, 13 years ago (diff)

ASH - test update

Line 
1
2BACKGROUND
3==========
4
5This is a simple example of the new additions I've been adding to
6ZSI. Among these modifications are:
7
81) Extended code generation facilities for server and client
92) Authorization callbacks
103) ServiceContainer enhancements for implementations to use
11
12
13Extended Code Generation for Server and Client
14----------------------------------------------
15
16These extensions are illustrated by the Echo.wsdl, EchoServer.py and
17EchoClient.py that implement an Echo service. The EchoServer.py file
18has two classes defined that implement the Echo functionality, the
19difference in the two is that one inherits from the generated
20EchoServer_interface class (generated by wsdl2dispatch), and one can
21be passed to the EchoServer_interface constructor with the keyword
22argument impl=<obj>.
23
24These two solutions follow the classic TIE and Derive patterns from
25previous systems like CORBA.
26
27The EchoClient.py implements a simple client for each service and
28invokes the method to do the work. The second call is programmed to
29result in an authorization error.
30
31Authorization Callbacks
32-----------------------
33
34This functionality lets you define a method on your implementation
35object that can be invoked to authorize calls to it from the
36underlying SOAP interface.
37
38ServiceContainer Enhancements
39-----------------------------
40
41I've added the ability to get a CallContext via a ServiceContainer
42module level function GetSOAPContext(). This returns a context object
43for the current request. I've make this thread-safe by keeping a
44global dictionary of contexts indexed by thread id. The requesthandler
45object cleanly creates and destroys these for each incoming request.
46
47The SOAPContext contains:
48
49- a reference to the connection object
50- a reference to the Service Container
51- the HTTP headers
52- the raw xml of the request
53- the Parsed SOAP object
54- the SOAP Action
55
56This should provide all the information a developer could need.
57
58BUILDING
59========
60
61You should (with a fresh checkout from cvs that's been installed) be able to run:
62
63>wsdl2py -e -f Echo.wsdl --simple-naming
64>wsdl2dispatch -e -f Echo.wsdl --simple-naming
65
66Then in separate terminal windows:
67
68Terminal 1:
69>python EchoServer.py
70
71Terminal 2:
72>python EchoClient.py
73
74Expected SERVER Output:
75
76C:\xfer\Echo-extended>EchoServer.py
77Authorizing TIE Echo
78['__doc__', '__init__', '__module__', 'connection', 'container', 'httpheaders',
79'parsedsoap', 'soapaction', 'xmldata']
80Container:  <socket._socketobject object at 0x00C03030>
81Parsed SOAP:  <ZSI.parse.ParsedSoap instance at 0x00C00878>
82Container:  <ZSI.ServiceContainer.ServiceContainer instance at 0x00BEB710>
83HTTP Headers:
84Host: localhost:9999
85Accept-Encoding: identity
86Content-length: 551
87Content-type: text/xml; charset=utf-8
88SOAPAction: "Echo"
89
90----
91XML Data:
92<?xml version="1.0" encoding="utf-8"?>
93<SOAP-ENV:Envelope
94  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
95  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
96  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
97  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
98  xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
99  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
100<SOAP-ENV:Body>
101<None  xmlns="">
102<in_str id="8fbb88" xsi:type="xsd:string">Test TIE String</in_str>
103</None >
104</SOAP-ENV:Body>
105</SOAP-ENV:Envelope>
106
107localhost - - [02/Feb/2005 21:35:00] "POST /EchoServer HTTP/1.1" 200 -
108NOT Authorizing INHERIT Echo
109['__doc__', '__init__', '__module__', 'connection', 'container', 'httpheaders',
110'parsedsoap', 'soapaction', 'xmldata']
111Container:  <socket._socketobject object at 0x00C03030>
112Parsed SOAP:  <ZSI.parse.ParsedSoap instance at 0x00C5EEB8>
113Container:  <ZSI.ServiceContainer.ServiceContainer instance at 0x00BEB710>
114HTTP Headers:
115Host: localhost:9999
116Accept-Encoding: identity
117Content-length: 555
118Content-type: text/xml; charset=utf-8
119SOAPAction: "Echo"
120
121----
122XML Data:
123<?xml version="1.0" encoding="utf-8"?>
124<SOAP-ENV:Envelope
125  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
126  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
127  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
128  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
129  xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
130  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
131<SOAP-ENV:Body>
132<None  xmlns="">
133<in_str id="8f4cb0" xsi:type="xsd:string">Test INHERIT String</in_str>
134</None >
135</SOAP-ENV:Body>
136</SOAP-ENV:Envelope>
137
138localhost - - [02/Feb/2005 21:35:00] "POST /EchoServIn HTTP/1.1" 401 -
139
140Expected CLIENT Output:
141
142C:\xfer\Echo-extended>EchoClient.py
143Test TIE StringTest TIE StringTest TIE String
144Failed to echo (Inherited):  Not authorized
Note: See TracBrowser for help on using the repository browser.