##################################################
# file: SessionService_client.py
# 
# client stubs generated by "ZSI.generate.wsdl2python.WriteServiceModule"
#     wsdl2py -bd //fayfiler/seecoapps/gis/projects/enerdeq/wsdl/Session3.wsdl
# 
##################################################

from SessionService_types import *
import urlparse, types
from ZSI.TCcompound import ComplexType, Struct
from ZSI import client
from ZSI.schema import GED, GTD
import ZSI
from ZSI.generate.pyclass import pyclass_type
from ZSI.generate.pyclass import pyclass_type
from ZSI.generate.pyclass import pyclass_type

# Locator
class SessionServiceLocator:
    SessionServiceSoap_address = "https://webservices1-2.ihsenergy.com/WebServices/Session"
    def getSessionServiceSoapAddress(self):
        return SessionServiceLocator.SessionServiceSoap_address
    def getSessionServiceSoap(self, url=None, **kw):
        return SessionServiceSoapSOAP(url or SessionServiceLocator.SessionServiceSoap_address, **kw)

# Methods
class SessionServiceSoapSOAP:
    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: Login
    def Login(self, request, soapheaders=(), **kw):
        if isinstance(request, LoginSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        # no input wsaction
        # TODO: Check soapheaders
        self.binding.Send(None, None, request, soapaction="http://www.ihsenergy.com/Enerdeq/Schemas/Session/Login", soapheaders=soapheaders, **kw)
        # no output wsaction
        response = self.binding.Receive(LoginSoapOut.typecode)
        return response

    # op: Logout
    def Logout(self, request, soapheaders=(), **kw):
        if isinstance(request, LogoutSoapIn) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        # no input wsaction
        # TODO: Check soapheaders
        self.binding.Send(None, None, request, soapaction="http://www.ihsenergy.com/Enerdeq/Schemas/Session/Logout", soapheaders=soapheaders, **kw)
        # no output wsaction
        response = self.binding.Receive(LogoutSoapOut.typecode)
        return response

LoginSoapIn = GED("http://www.ihsenergy.com/Enerdeq/Schemas/Session", "LoginRequest").pyclass

LoginSoapOut = GED("http://www.ihsenergy.com/Enerdeq/Schemas/Session", "LoginResponse").pyclass

LogoutSoapIn = GED("http://www.ihsenergy.com/Enerdeq/Schemas/Session", "LogoutRequest").pyclass

LogoutSoapOut = GED("http://www.ihsenergy.com/Enerdeq/Schemas/Session", "LogoutResponse").pyclass
