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


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

# Locator
class SessionCreateRQServiceLocator:
    SessionCreatePortType_address = "https://webservices.sabre.com/websvc"
    def getSessionCreatePortTypeAddress(self):
        return SessionCreateRQServiceLocator.SessionCreatePortType_address
    def getSessionCreatePortType(self, url=None, **kw):
        return SessionCreateSoapBindingSOAP(url or SessionCreateRQServiceLocator.SessionCreatePortType_address, **kw)

# Methods
class SessionCreateSoapBindingSOAP:
    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: SessionCreateRQ
    def SessionCreateRQ(self, request):
        if isinstance(request, GetSessionCreateInput) is False:
            raise TypeError, "%s incorrect request type" % (request.__class__)
        kw = {}
        # no input wsaction
        self.binding.Send(None, None, request, soapaction="OTA", **kw)
        # no output wsaction
        response = self.binding.Receive(GetSessionCreateOutput.typecode)
        if isinstance(response, GetSessionCreateOutput.typecode.pyclass) is False:
            raise TypeError, "%s incorrect response type" % (response.__class__)
        return response

GetSessionCreateInput = ns4.SessionCreateRQ_Dec().pyclass

GetSessionCreateOutput = ns4.SessionCreateRS_Dec().pyclass
