################################################## 
# 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 = ns3.GetProperties_Dec().pyclass

GetPropertiesSoapOut = ns3.GetPropertiesResponse_Dec().pyclass

SubscribeSoapIn = ns3.Subscribe_Dec().pyclass

SubscribeSoapOut = ns3.SubscribeResponse_Dec().pyclass

SubscriptionPolledRefreshSoapIn = ns3.SubscriptionPolledRefresh_Dec().pyclass

SubscriptionPolledRefreshSoapOut = ns3.SubscriptionPolledRefreshResponse_Dec().pyclass

SubscriptionCancelSoapIn = ns3.SubscriptionCancel_Dec().pyclass

SubscriptionCancelSoapOut = ns3.SubscriptionCancelResponse_Dec().pyclass

GetStatusSoapIn = ns3.GetStatus_Dec().pyclass

GetStatusSoapOut = ns3.GetStatusResponse_Dec().pyclass

BrowseSoapIn = ns3.Browse_Dec().pyclass

BrowseSoapOut = ns3.BrowseResponse_Dec().pyclass

ReadSoapIn = ns3.Read_Dec().pyclass

ReadSoapOut = ns3.ReadResponse_Dec().pyclass

WriteSoapIn = ns3.Write_Dec().pyclass

WriteSoapOut = ns3.WriteResponse_Dec().pyclass
