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


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

# Locator
class OpcXmlDaSrvLocator:
    OpcXmlDaSrvSoap_address = "http://tswinc.us/XMLDADemo/ts_sim/OpcDaGateway.asmx"
    def getOpcXmlDaSrvSoapAddress(self):
        return OpcXmlDaSrvLocator.OpcXmlDaSrvSoap_address
    def getOpcXmlDaSrvSoap(self, url=None, **kw):
        return OpcXmlDaSrvSoapSOAP(url or OpcXmlDaSrvLocator.OpcXmlDaSrvSoap_address, **kw)

# Methods
class OpcXmlDaSrvSoapSOAP:
    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: GetProperties
    def GetProperties(self, request):
        if isinstance(request, GetPropertiesSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://opcfoundation.org/webservices/XMLDA/1.0/GetProperties", **kw)
        # no output wsaction
        response = self.binding.Receive(GetPropertiesSoapOut.typecode)
        if isinstance(response, GetPropertiesSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: Subscribe
    def Subscribe(self, request):
        if isinstance(request, SubscribeSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://opcfoundation.org/webservices/XMLDA/1.0/Subscribe", **kw)
        # no output wsaction
        response = self.binding.Receive(SubscribeSoapOut.typecode)
        if isinstance(response, SubscribeSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: SubscriptionPolledRefresh
    def SubscriptionPolledRefresh(self, request):
        if isinstance(request, SubscriptionPolledRefreshSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://opcfoundation.org/webservices/XMLDA/1.0/SubscriptionPolledRefresh", **kw)
        # no output wsaction
        response = self.binding.Receive(SubscriptionPolledRefreshSoapOut.typecode)
        if isinstance(response, SubscriptionPolledRefreshSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: SubscriptionCancel
    def SubscriptionCancel(self, request):
        if isinstance(request, SubscriptionCancelSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://opcfoundation.org/webservices/XMLDA/1.0/SubscriptionCancel", **kw)
        # no output wsaction
        response = self.binding.Receive(SubscriptionCancelSoapOut.typecode)
        if isinstance(response, SubscriptionCancelSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: GetStatus
    def GetStatus(self, request):
        if isinstance(request, GetStatusSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://opcfoundation.org/webservices/XMLDA/1.0/GetStatus", **kw)
        # no output wsaction
        response = self.binding.Receive(GetStatusSoapOut.typecode)
        if isinstance(response, GetStatusSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: Browse
    def Browse(self, request):
        if isinstance(request, BrowseSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://opcfoundation.org/webservices/XMLDA/1.0/Browse", **kw)
        # no output wsaction
        response = self.binding.Receive(BrowseSoapOut.typecode)
        if isinstance(response, BrowseSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: Read
    def Read(self, request):
        if isinstance(request, ReadSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://opcfoundation.org/webservices/XMLDA/1.0/Read", **kw)
        # no output wsaction
        response = self.binding.Receive(ReadSoapOut.typecode)
        if isinstance(response, ReadSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

    # op: Write
    def Write(self, request):
        if isinstance(request, WriteSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="http://opcfoundation.org/webservices/XMLDA/1.0/Write", **kw)
        # no output wsaction
        response = self.binding.Receive(WriteSoapOut.typecode)
        if isinstance(response, WriteSoapOut.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

GetPropertiesSoapIn = ns4.GetProperties_Dec().pyclass

GetPropertiesSoapOut = ns4.GetPropertiesResponse_Dec().pyclass

SubscribeSoapIn = ns4.Subscribe_Dec().pyclass

SubscribeSoapOut = ns4.SubscribeResponse_Dec().pyclass

SubscriptionPolledRefreshSoapIn = ns4.SubscriptionPolledRefresh_Dec().pyclass

SubscriptionPolledRefreshSoapOut = ns4.SubscriptionPolledRefreshResponse_Dec().pyclass

SubscriptionCancelSoapIn = ns4.SubscriptionCancel_Dec().pyclass

SubscriptionCancelSoapOut = ns4.SubscriptionCancelResponse_Dec().pyclass

GetStatusSoapIn = ns4.GetStatus_Dec().pyclass

GetStatusSoapOut = ns4.GetStatusResponse_Dec().pyclass

BrowseSoapIn = ns4.Browse_Dec().pyclass

BrowseSoapOut = ns4.BrowseResponse_Dec().pyclass

ReadSoapIn = ns4.Read_Dec().pyclass

ReadSoapOut = ns4.ReadResponse_Dec().pyclass

WriteSoapIn = ns4.Write_Dec().pyclass

WriteSoapOut = ns4.WriteResponse_Dec().pyclass
