Changeset 1696
- Timestamp:
- 14/11/06 13:02:01 (14 years ago)
- Location:
- TI12-security/trunk/python/Tests
- Files:
-
- 12 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/Tests/Echo/EchoClient.py
r1664 r1696 1 #!/ bin/env python1 #!/usr/bin/env python 2 2 # 3 3 # Exampe echo client, to show extended code generation in ZSI … … 30 30 if isEchoRequest(sw): 31 31 if self.sigHandler: 32 pass#self.sigHandler.sign(sw)32 self.sigHandler.sign(sw) 33 33 else: 34 34 if self.encrHandler: … … 68 68 69 69 # Instantiate a client proxy object, then call it 70 echoSrv = EchoServerSOAP("http://192.100.78.234:9081/EchoServiceWeb/services/EchoServer", 70 #wsURL = "http://192.100.78.234:9081/EchoServiceWeb/services/EchoServer" 71 wsURL = "http://localhost:7100" 72 echoSrv = EchoServerSOAP(wsURL, 71 73 sig_handler=wsseHandler, 72 74 tracefile=sys.stdout) -
TI12-security/trunk/python/Tests/Echo/EchoServer.py
r1634 r1696 1 #!/ bin/env python1 #!/usr/bin/env python 2 2 # 3 3 # How to build an echo server using the extended code generation … … 21 21 psBodyChildName = lambda ps: \ 22 22 ps.dom.childNodes[1].childNodes[1].childNodes[0].localName 23 24 priKeyPwd = None 25 certFilePath = '../webSphereTestcert.pem' 26 priKeyFilePath = '../webSphereTestkey.pem' 27 23 28 24 29 # Create a Server implementation … … 53 58 54 59 self.signatureHandler = wsSecurity.SignatureHandler(\ 55 certFilePath= '../Junk-cert.pem',56 priKeyFilePath= '../Junk-key.pem',57 priKeyPwd= open('../tmp2').read().strip())60 certFilePath=certFilePath, 61 priKeyFilePath=priKeyFilePath, 62 priKeyPwd=priKeyPwd) 58 63 59 64 self.encryptionHandler = wsSecurity.EncryptionHandler(\ 60 certFilePath= '../Junk-cert.pem',61 priKeyFilePath= '../Junk-key.pem',62 priKeyPwd= open('../tmp2').read().strip())65 certFilePath=certFilePath, 66 priKeyFilePath=priKeyFilePath, 67 priKeyPwd=priKeyPwd) 63 68 64 69 -
TI12-security/trunk/python/Tests/Echo/EchoServer_client.py
r1664 r1696 15 15 # Locator 16 16 class EchoServerLocator: 17 EchoServer_address = "http://localhost: 9081/EchoServiceWeb/services/EchoServer"17 EchoServer_address = "http://localhost:7100" 18 18 def getEchoServerAddress(self): 19 19 return EchoServerLocator.EchoServer_address … … 30 30 # no ws-addressing 31 31 32 # op: <ZSI.wstools.WSDLTools.Message instance at 0xb 6e8fe6c>32 # op: <ZSI.wstools.WSDLTools.Message instance at 0xb77f40ec> 33 33 def Echo(self, EchoIn): 34 34 … … 44 44 return EchoResult 45 45 46 # op: <ZSI.wstools.WSDLTools.Message instance at 0xb 6e9466c>46 # op: <ZSI.wstools.WSDLTools.Message instance at 0xb77f48cc> 47 47 def EchoEncr(self, EchoIn): 48 48 -
TI12-security/trunk/python/Tests/Echo/EchoServer_interface.py
r1664 r1696 14 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 15 <types> 16 <xsd:schema elementFormDefault=\"qualified\" targetNamespace=\"urn:ZSI:examples\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">16 <xsd:schema elementFormDefault=\"qualified\" targetNamespace=\"urn:ZSI:examples\"> 17 17 <xsd:element name=\"Echo\"> 18 18 <xsd:complexType> … … 45 45 </xsd:schema> 46 46 </types> 47 <message name=\"EchoEncrRequest\"> 48 <part element=\"tns:EchoEncr\" name=\"parameters\"/> 47 48 <message name=\"EchoRequest\"> 49 <part element=\"tns:Echo\" name=\"parameters\"/> 49 50 </message> 50 51 <message name=\"EchoResponse\"> 51 52 <part element=\"tns:EchoResponse\" name=\"parameters\"/> 52 53 </message> 53 <message name=\"Echo Request\">54 <part element=\"tns:Echo \" name=\"parameters\"/>54 <message name=\"EchoEncrRequest\"> 55 <part element=\"tns:EchoEncr\" name=\"parameters\"/> 55 56 </message> 56 57 <message name=\"EchoEncrResponse\"> 57 58 <part element=\"tns:EchoEncrResponse\" name=\"parameters\"/> 58 59 </message> 60 59 61 <portType name=\"EchoServer\"> 60 62 <operation name=\"Echo\"> … … 67 69 </operation> 68 70 </portType> 71 69 72 <binding name=\"EchoServer\" type=\"tns:EchoServer\"> 70 73 <soap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\"/> 71 74 <operation name=\"Echo\"> 72 75 <soap:operation soapAction=\"Echo\"/> 73 74 <soap:body use=\"literal\"/>75 76 77 <soap:body use=\"literal\"/> 78 76 <input> 77 <soap:body use=\"literal\"/> 78 </input> 79 <output> 80 <soap:body use=\"literal\"/> 81 </output> 79 82 </operation> 80 83 <operation name=\"EchoEncr\"> 81 84 <soap:operation soapAction=\"EchoEncr\"/> 82 83 <soap:body use=\"literal\"/>84 85 86 <soap:body use=\"literal\"/> 87 85 <input> 86 <soap:body use=\"literal\"/> 87 </input> 88 <output> 89 <soap:body use=\"literal\"/> 90 </output> 88 91 </operation> 89 92 </binding> 93 90 94 <service name=\"EchoServer\"> 91 95 <port binding=\"tns:EchoServer\" name=\"EchoServer\"> 92 <soap:address location=\"http://localhost: 9080/EchoServiceWeb/services/EchoServer\"/>96 <soap:address location=\"http://localhost:7100\"/> 93 97 </port> 94 98 </service> 99 95 100 </definitions>""" 96 101 97 def __init__(self, post=' /EchoServiceWeb/services/EchoServer', **kw):102 def __init__(self, post='', **kw): 98 103 ServiceSOAPBinding.__init__(self, post) 99 104 if kw.has_key('impl'): -
TI12-security/trunk/python/Tests/Echo/EchoServer_services_types.py
r1634 r1696 7 7 import ZSI 8 8 import ZSI.TCcompound 9 from ZSI.TC import ElementDeclaration,TypeDefinition 10 from ZSI.TC import _get_type_definition as GTD, _get_global_element_declaration as GED 9 from ZSI.schema import LocalElementDeclaration, ElementDeclaration, TypeDefinition, GTD, GED 11 10 12 11 ############################## … … 19 18 20 19 class Echo(ZSI.TCcompound.ComplexType, ElementDeclaration): 20 literal = "Echo" 21 21 schema = "urn:ZSI:examples" 22 literal = "Echo"23 22 def __init__(self, **kw): 24 23 ns = urn_ZSI_examples.Echo.schema … … 27 26 kw["aname"] = "Echo" 28 27 self.attribute_typecode_dict = {} 29 ZSI.TCcompound.ComplexType.__init__(self, None, TClist, inorder=0,**kw)28 ZSI.TCcompound.ComplexType.__init__(self,None,TClist,inorder=0,**kw) 30 29 class Holder: 31 30 typecode = self … … 38 37 39 38 class EchoResponse(ZSI.TCcompound.ComplexType, ElementDeclaration): 39 literal = "EchoResponse" 40 40 schema = "urn:ZSI:examples" 41 literal = "EchoResponse"42 41 def __init__(self, **kw): 43 42 ns = urn_ZSI_examples.EchoResponse.schema … … 46 45 kw["aname"] = "EchoResponse" 47 46 self.attribute_typecode_dict = {} 48 ZSI.TCcompound.ComplexType.__init__(self, None, TClist, inorder=0,**kw)47 ZSI.TCcompound.ComplexType.__init__(self,None,TClist,inorder=0,**kw) 49 48 class Holder: 50 49 typecode = self … … 57 56 58 57 class EchoEncr(ZSI.TCcompound.ComplexType, ElementDeclaration): 58 literal = "EchoEncr" 59 59 schema = "urn:ZSI:examples" 60 literal = "EchoEncr"61 60 def __init__(self, **kw): 62 61 ns = urn_ZSI_examples.EchoEncr.schema … … 65 64 kw["aname"] = "EchoEncr" 66 65 self.attribute_typecode_dict = {} 67 ZSI.TCcompound.ComplexType.__init__(self, None, TClist, inorder=0,**kw)66 ZSI.TCcompound.ComplexType.__init__(self,None,TClist,inorder=0,**kw) 68 67 class Holder: 69 68 typecode = self … … 76 75 77 76 class EchoEncrResponse(ZSI.TCcompound.ComplexType, ElementDeclaration): 77 literal = "EchoEncrResponse" 78 78 schema = "urn:ZSI:examples" 79 literal = "EchoEncrResponse"80 79 def __init__(self, **kw): 81 80 ns = urn_ZSI_examples.EchoEncrResponse.schema … … 84 83 kw["aname"] = "EchoEncrResponse" 85 84 self.attribute_typecode_dict = {} 86 ZSI.TCcompound.ComplexType.__init__(self, None, TClist, inorder=0,**kw)85 ZSI.TCcompound.ComplexType.__init__(self,None,TClist,inorder=0,**kw) 87 86 class Holder: 88 87 typecode = self -
TI12-security/trunk/python/Tests/Echo/wsSecurity.py
r1664 r1696 136 136 # Signed Info - Canonicalization method 137 137 signedInfoC14nKw = {} 138 138 signedInfoC14nKw['unsuppressedPrefixes'] = ['xsi', 'xsd', 'SOAP-ENV', 'ds', 'wsse'] 139 139 c14nMethodElem = signedInfoElem.createAppendElement(DSIG.BASE, 140 140 'CanonicalizationMethod') … … 195 195 # Find references 196 196 c14nKw = {} 197 197 c14nKw['unsuppressedPrefixes'] = ['xmlns', 'xsi', 'xsd', 'SOAP-ENV', 'wsu', 'wsse', 'ns1'] 198 198 for idNode in idNodes: 199 199
Note: See TracChangeset
for help on using the changeset viewer.