00001
00002
00003
00004
00005
00006 import sys
00007 from ZSI.ServiceContainer import AsServer
00008 from EchoWSAddr200403Server_server import EchoWSAddr200403Server as EchoServer
00009 from ZSI.schema import GTD
00010
00011 """
00012 EchoServer example service
00013
00014 WSDL: ../../samples/Echo/Echo.wsdl
00015
00016 """
00017
00018 EndpointReferenceType = GTD('http://schemas.xmlsoap.org/ws/2004/03/addressing','EndpointReferenceType')
00019
00020
00021 class WSAService(EchoServer):
00022 def wsa_Echo(self, ps, address):
00023 request,response = EchoServer.wsa_Echo(self, ps, address)
00024 response.EchoResult = request.EchoIn
00025
00026 if isinstance(response.EchoResult, EndpointReferenceType):
00027 addr1 = response.EchoResult
00028 for a in address.Any:
00029 if a not in addr1.ReferenceProperties.Any:
00030 raise RuntimeError, 'EPRs dont match'
00031
00032 return request,response
00033
00034
00035 if __name__ == "__main__" :
00036 port = int(sys.argv[1])
00037 AsServer(port, (WSAService('test'),))