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


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

# Locator
class ZipCodeResolverLocator:
    ZipCodeResolverSoap_address = "http://webservices.eraserver.net/zipcoderesolver/zipcoderesolver.asmx"
    def getZipCodeResolverSoapAddress(self):
        return ZipCodeResolverLocator.ZipCodeResolverSoap_address
    def getZipCodeResolverSoap(self, url=None, **kw):
        return ZipCodeResolverSoapSOAP(url or ZipCodeResolverLocator.ZipCodeResolverSoap_address, **kw)

# Methods
class ZipCodeResolverSoapSOAP:
    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: FullZipCode
    def FullZipCode(self, request):
        if isinstance(request, FullZipCodeSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://webservices.eraserver.net/FullZipCode", **kw)
        # no output wsaction
        response = self.binding.Receive(FullZipCodeSoapOut.typecode)
        if isinstance(response, FullZipCodeSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: ShortZipCode
    def ShortZipCode(self, request):
        if isinstance(request, ShortZipCodeSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://webservices.eraserver.net/ShortZipCode", **kw)
        # no output wsaction
        response = self.binding.Receive(ShortZipCodeSoapOut.typecode)
        if isinstance(response, ShortZipCodeSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: CorrectedAddressHtml
    def CorrectedAddressHtml(self, request):
        if isinstance(request, CorrectedAddressHtmlSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://webservices.eraserver.net/CorrectedAddressHtml", **kw)
        # no output wsaction
        response = self.binding.Receive(CorrectedAddressHtmlSoapOut.typecode)
        if isinstance(response, CorrectedAddressHtmlSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: CorrectedAddressXml
    def CorrectedAddressXml(self, request):
        if isinstance(request, CorrectedAddressXmlSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://webservices.eraserver.net/CorrectedAddressXml", **kw)
        # no output wsaction
        response = self.binding.Receive(CorrectedAddressXmlSoapOut.typecode)
        if isinstance(response, CorrectedAddressXmlSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: VersionInfo
    def VersionInfo(self, request):
        if isinstance(request, VersionInfoSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://webservices.eraserver.net/VersionInfo", **kw)
        # no output wsaction
        response = self.binding.Receive(VersionInfoSoapOut.typecode)
        if isinstance(response, VersionInfoSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

FullZipCodeSoapIn = ns2.FullZipCode_Dec().pyclass

FullZipCodeSoapOut = ns2.FullZipCodeResponse_Dec().pyclass

ShortZipCodeSoapIn = ns2.ShortZipCode_Dec().pyclass

ShortZipCodeSoapOut = ns2.ShortZipCodeResponse_Dec().pyclass

CorrectedAddressHtmlSoapIn = ns2.CorrectedAddressHtml_Dec().pyclass

CorrectedAddressHtmlSoapOut = ns2.CorrectedAddressHtmlResponse_Dec().pyclass

CorrectedAddressXmlSoapIn = ns2.CorrectedAddressXml_Dec().pyclass

CorrectedAddressXmlSoapOut = ns2.CorrectedAddressXmlResponse_Dec().pyclass

VersionInfoSoapIn = ns2.VersionInfo_Dec().pyclass

VersionInfoSoapOut = ns2.VersionInfoResponse_Dec().pyclass
