################################################## 
# EchoServer_services.py 
# generated by ZSI.generate.wsdl2python
##################################################


from EchoServer_services_types import *
import urlparse, types
from ZSI.TCcompound import ComplexType, Struct
from ZSI import client
import ZSI

# Locator
class EchoServerLocator:
    EchoServer_address = "http://localhost:7000"
    def getEchoServerAddress(self):
        return EchoServerLocator.EchoServer_address
    def getEchoServer(self, url=None, **kw):
        return EchoServerSOAP(url or EchoServerLocator.EchoServer_address, **kw)

# Methods
class EchoServerSOAP:
    def __init__(self, url, **kw):
        kw.setdefault("readerclass", None)
        kw.setdefault("writerclass", None)
        # no resource properties
        self.binding = client.Binding(url=url, **kw)
        # no ws-addressing

    # op: Echo
    def Echo(self, request):
        if isinstance(request, EchoRequest) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="Echo", **kw)
        # no output wsaction
        response = self.binding.Receive(EchoResponse.typecode)
        if isinstance(response, EchoResponse.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

EchoRequest = ns0.Echo_Dec().pyclass

EchoResponse = ns0.EchoResponse_Dec().pyclass
