source: TI12-security/trunk/python/ndg.security.test/ndg/security/test/Echo/EchoServer_interface.py @ 1804

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.test/ndg/security/test/Echo/EchoServer_interface.py@3105
Revision 1804, 5.1 KB checked in by pjkersha, 13 years ago (diff)

Changes for WebSphere? tests.

Line 
1##################################################
2# EchoServer_interface.py
3#      Generated by ZSI.generate.wsdl2dispatch.DelAuthServiceModuleWriter
4#
5##################################################
6
7from EchoServer_messages import *
8from ZSI.ServiceContainer import ServiceSOAPBinding
9
10class EchoServer(ServiceSOAPBinding):
11    soapAction = {}
12    root = {}
13    _wsdl = """<?xml version=\"1.0\" ?>
14<definitions targetNamespace=\"urn:ZSI:examples\" xmlns=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:tns=\"urn:ZSI:examples\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
15  <types>
16  <xsd:schema elementFormDefault=\"qualified\" targetNamespace=\"urn:ZSI:examples\">
17      <xsd:element name=\"Echo\">
18        <xsd:complexType>
19          <xsd:sequence>
20            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"EchoIn\" type=\"xsd:string\"/>
21          </xsd:sequence>
22        </xsd:complexType>
23      </xsd:element>
24      <xsd:element name=\"EchoResponse\">
25        <xsd:complexType>
26          <xsd:sequence>
27            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"EchoResult\" type=\"xsd:string\"/>
28          </xsd:sequence>
29        </xsd:complexType>
30      </xsd:element>
31      <xsd:element name=\"EchoEncr\">
32        <xsd:complexType>
33          <xsd:sequence>
34            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"EchoIn\" type=\"xsd:string\"/>
35          </xsd:sequence>
36        </xsd:complexType>
37      </xsd:element>
38      <xsd:element name=\"EchoEncrResponse\">
39        <xsd:complexType>
40          <xsd:sequence>
41            <xsd:element maxOccurs=\"1\" minOccurs=\"0\" name=\"EchoResult\" type=\"xsd:string\"/>
42          </xsd:sequence>
43        </xsd:complexType>
44      </xsd:element>
45  </xsd:schema>
46  </types>
47
48  <message name=\"EchoRequest\">
49    <part element=\"tns:Echo\" name=\"parameters\"/>
50  </message>
51  <message name=\"EchoResponse\">
52    <part element=\"tns:EchoResponse\" name=\"parameters\"/>
53  </message>
54  <message name=\"EchoEncrRequest\">
55    <part element=\"tns:EchoEncr\" name=\"parameters\"/>
56  </message>
57  <message name=\"EchoEncrResponse\">
58    <part element=\"tns:EchoEncrResponse\" name=\"parameters\"/>
59  </message>
60
61  <portType name=\"EchoServer\">
62    <operation name=\"Echo\">
63      <input message=\"tns:EchoRequest\"/>
64      <output message=\"tns:EchoResponse\"/>
65    </operation>
66    <operation name=\"EchoEncr\">
67      <input message=\"tns:EchoEncrRequest\"/>
68      <output message=\"tns:EchoEncrResponse\"/>
69    </operation>
70  </portType>
71
72  <binding name=\"EchoServer\" type=\"tns:EchoServer\">
73    <soap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>
74    <operation name=\"Echo\">
75      <soap:operation soapAction=\"Echo\"/>
76        <input>
77          <soap:body use=\"literal\"/>
78        </input>
79        <output>
80          <soap:body use=\"literal\"/>
81        </output>
82    </operation>
83    <operation name=\"EchoEncr\">
84      <soap:operation soapAction=\"EchoEncr\"/>
85        <input>
86          <soap:body use=\"literal\"/>
87        </input>
88        <output>
89          <soap:body use=\"literal\"/>
90        </output>
91    </operation>
92  </binding>
93
94  <service name=\"EchoServer\">
95    <port binding=\"tns:EchoServer\" name=\"EchoServer\">
96      <soap:address location=\"http://localhost:7100\"/>
97    </port>
98  </service>
99
100</definitions>"""
101
102    def __init__(self, post='', **kw):
103        ServiceSOAPBinding.__init__(self, post)
104        if kw.has_key('impl'):
105            self.impl = kw['impl']
106        self.auth_method_name = None
107        if kw.has_key('auth_method_name'):
108            self.auth_method_name = kw['auth_method_name']
109    def authorize(self, auth_info, post, action):
110        if self.auth_method_name and hasattr(self.impl, self.auth_method_name):
111            return getattr(self.impl, self.auth_method_name)(auth_info, post, action)
112        else:
113            return 1
114
115    def soap_Echo(self, ps):
116        #import pdb;pdb.set_trace()
117        self.request = ps.Parse(EchoRequest.typecode)
118        parameters = self.request.EchoIn
119
120        # If we have an implementation object use it
121        if hasattr(self,'impl'):
122            parameters = self.impl.Echo(parameters)
123
124        result = EchoResponse()
125        # If we have an implementation object, copy the result
126        if hasattr(self,'impl'):
127            result.EchoResult = parameters
128        return result
129
130    soapAction['Echo'] = 'soap_Echo'
131    root[(EchoRequest.typecode.nspname,EchoRequest.typecode.pname)] = 'soap_Echo'
132
133    def soap_EchoEncr(self, ps):
134        self.request = ps.Parse(EchoEncrRequest.typecode)
135        parameters = self.request.EchoIn
136        #import pdb;pdb.set_trace()
137        # If we have an implementation object use it
138        if hasattr(self,'impl'):
139            parameters = self.impl.EchoEncr(parameters)
140
141        result = EchoEncrResponse()
142        # If we have an implementation object, copy the result
143        if hasattr(self,'impl'):
144            result.EchoResult = parameters
145        return result
146
147    soapAction['EchoEncr'] = 'soap_EchoEncr'
148    root[(EchoEncrRequest.typecode.nspname,EchoEncrRequest.typecode.pname)] = 'soap_EchoEncr'
149
Note: See TracBrowser for help on using the repository browser.