Imports System.Web
Imports System.Xml
Imports CharterDotCom.CommonEntities.Library
Imports CharterDotCom.CommonEntities.Library.EntityMemberServices
Imports System.Net.Security
Imports System.Security.Cryptography.X509Certificates
Imports CharterDotCom.CommonEntities.Library.EntityEBSServices


Public Class ProviderManager
    Inherits IMemberServicesProvider

    Private _credentials As ICredentials
    Private _ws As WSMemberServices.WSInterfaces
    Private _ossWs As OSSApiClient

    '#################################################################################################################
    'SEPT 01 2009 SHEILA SHAHPARI
    'Modified WSMemberServices object to use lazy instantiation instead of getting invoked in the constructor.
    'This was applied in order to allow for the addition of OSS Web Service API to this class and only instantiate
    'each web service if the exposed method consuming it is called.
    '#################################################################################################################
    Private ReadOnly Property MemberServicesWS() As WSMemberServices.WSInterfaces
        Get
            If _ws Is Nothing Then
                Dim netCredential As NetworkCredential
                Dim uri As Uri
                Dim context As HttpContext = HttpContext.Current

                _ws = New WSMemberServices.WSInterfaces
                uri = New Uri(context.Application(Constant.MEMBERSERVICESPROVIDER_WEBSERVICE_URL))

                _ws.Url = uri.AbsoluteUri
                If CBool(context.Application(Constant.MEMBERSERVICESPROVIDER_WEBSERVICE_AUTHENTICATIONREQUIRED)) Then
                    netCredential = New NetworkCredential(context.Application(Constant.MEMBERSERVICESPROVIDER_WEBSERVICE_USER).ToString, context.Application(Constant.MEMBERSERVICESPROVIDER_WEBSERVICE_PASSWORD).ToString)
                    _ws.Credentials = netCredential.GetCredential(uri, "Basic")
                End If
            End If
            Return _ws
        End Get

    End Property

    Private ReadOnly Property OSSApiWS() As OSSApiClient
        Get

            If _ossWs Is Nothing Then
                Dim netCredential As NetworkCredential
                Dim uri As Uri
                Dim context As HttpContext = HttpContext.Current


                uri = New Uri(context.Application(Constant.MEMBERSERVICESPROVIDER_OSSWEBSERVICE_URL))
                _ossWs = New OSSApiClient(uri.AbsoluteUri)

                If CBool(context.Application(Constant.MEMBERSERVICESPROVIDER_OSSWEBSERVICE_AUTHENTICATIONREQUIRED)) Then
                    netCredential = New NetworkCredential(context.Application(Constant.MEMBERSERVICESPROVIDER_OSSWEBSERVICE_USER).ToString, context.Application(Constant.MEMBERSERVICESPROVIDER_OSSWEBSERVICE_PASSWORD).ToString)

                    _ossWs.Credentials = netCredential.GetCredential(uri, "Basic")
                End If
            End If
            Return _ossWs
        End Get

    End Property

    Public Sub New()
        'Configure settings for Member services
        Dim context As HttpContext = HttpContext.Current
        Try
            '######################################################################################################
            'Feb 27, 2007 ROD COPELAND
            'THIS CHANGE WAS ADDED BECAUSE THE MEMBERSERIVCE WEBSERVICE IS USING AN INTERNAL 
            'IP ON HTTPS AND THEY HAVE A PUBLIC CERTIFICATE THAT HAS A DIFFERENT NAME WHICH CAUSES 
            'AN INVALID CERT ERROR. WHY THE CERT IS INVALID ON THE MEMBERSERVICES SERVER IS A LIMITATION ON THEIR SIDE, SO IM TOLD.
            'TO GET AROUND THIS, THIS CODE WAS ADDED TO MAKE THE WS REQUEST 
            'REGARDLESS IF THE CERT IS VALID OR NOT.  AT THIS POINT, THIS SHOULD BE FINE SINCE  
            'THE WEBSERVICE IS INTERNAL.
            '######################################################################################################
            ''Select Case Environment.MachineName.ToLower
            ''    Case "kstlmcc2p03", "kstlmcc2p04"
            ''        '#######
            ''        'PROD
            ''        '#######
            ''    Case "kstlmweb68", "kstlmweb69"
            ''        '#######
            ''        'UAT
            ''        '#######
            ''    Case Else
            'KSTLMWEB65, LOCAL DEVELOPMENT BOXES, OR ANY OTHER UNKNOWN, IGNORE THE CERTIFICATE
            ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateCertificate)
            'End Select


        Catch ex As Exception
            Throw New Exception(Constant.EXCEPTION_CONFIGURATION)
        End Try

    End Sub



    '######################################################################################################
    'Feb 27, 2007 ROD COPELAND
    'THIS CHANGE WAS ADDED BECAUSE THE MEMBERSERIVCE WEBSERVICE IS USING AN INTERNAL 
    'IP ON HTTPS AND THEY HAVE A PUBLIC CERTIFICATE THAT HAS A DIFFERENT NAME WHICH CAUSES 
    'AN INVALID CERT ERROR. TO GET AROUND THIS, THIS CODE WAS ADDED TO MAKE THE WS REQUEST 
    'REGARDLESS IF THE CERT IS VALID OR NOT.  AT THIS POINT, THIS SHOULD BE FINE SINCE ALL 
    'THE WEBSERVICES ARE INTERNAL (ASSIDE G2B).
    '######################################################################################################
    Private Function ValidateCertificate(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
        'Return True to force the certificate to be accepted.
        Return True
    End Function



    Private Function GetTheCommonResponse(ByVal objTempResponse As WSMemberServices.WSResult) As TheCommonResponse
        Dim objResponse As New TheCommonResponse
        Try
            '###################################
            'translate back to the other object
            '###################################
            If Not (objTempResponse Is Nothing) Then
                If Not (objTempResponse.status Is Nothing) Then
                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If
            End If

            Return objResponse
        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function




    Public Overrides Function Authenticate(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '##############################################
        Dim objRequest As AuthenticateRequest
        Dim objTempResponse As New WSMemberServices.AuthenticateInfo
        Dim objResponse As New AuthenticateResponse
        '##############################################

        '#####################
        'temp local variable
        '#####################


        Try
            objRequest = CType(obj, AuthenticateRequest)


            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.authenticate( _
                objRequest.Login, _
                objRequest.Password, _
                objRequest.csrLogin, _
                objRequest.csrPassword)


            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '########################################################################################

            If Not (objTempResponse Is Nothing) Then
                If Not (objTempResponse.status Is Nothing) Then
                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If

                If Not (objTempResponse.accountId Is Nothing) Then
                    objResponse.AccountID = objTempResponse.accountId
                End If
            End If



            Return objResponse


        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function




    Public Overrides Function AuthenticateMsEx(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '##############################################
        Dim objRequest As AuthenticateMsExRequest
        Dim objTempResponse As New WSMemberServices.AccountDetailInfo
        Dim objResponse As New AuthenticateMsExResponse
        '##############################################

        '#####################
        'temp local variable
        '#####################


        Try
            objRequest = CType(obj, AuthenticateMsExRequest)


            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.authenticateMsEx( _
                objRequest.Login, _
                objRequest.Password, _
                objRequest.csrLogin, _
                objRequest.csrPassword)


            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '########################################################################################

            If Not (objTempResponse Is Nothing) Then

                If Not (objTempResponse.accountNumber Is Nothing) Then
                    objResponse.accountNumber = objTempResponse.accountNumber
                End If

                objResponse.accountStatus = objTempResponse.accountStatus
                objResponse.accountType = objTempResponse.accountType
                objResponse.address1 = objTempResponse.address1
                objResponse.address2 = objTempResponse.address2
                objResponse.billingType = objTempResponse.billingType
                objResponse.city = objTempResponse.city
                objResponse.company = objTempResponse.company
                objResponse.contactEmail = objTempResponse.contactEmail
                objResponse.firstName = objTempResponse.firstName
                objResponse.hasEmail = objTempResponse.hasEmail
                objResponse.hasSecurity = objTempResponse.hasSecurity
                objResponse.hasWebspace = objTempResponse.hasWebspace
                objResponse.lastName = objTempResponse.lastName

                If Not (objTempResponse.packageArray Is Nothing) Then
                    ReDim objResponse.packageArray(objTempResponse.packageArray.GetUpperBound(0))
                    For i As Integer = 0 To objTempResponse.packageArray.GetUpperBound(0)
                        If Not (objTempResponse.packageArray(i) Is Nothing) Then
                            objResponse.packageArray(i) = New PackageDetailInfo

                            If Not (objTempResponse.packageArray(i).description Is Nothing) Then
                                objResponse.packageArray(i).description = objTempResponse.packageArray(i).description
                            End If

                            objResponse.packageArray(i).emailsAllowed = objTempResponse.packageArray(i).emailsAllowed

                            objResponse.packageArray(i).pendingStatus = objTempResponse.packageArray(i).pendingStatus

                            If Not (objTempResponse.packageArray(i).provisioningId Is Nothing) Then
                                objResponse.packageArray(i).provisioningId = objTempResponse.packageArray(i).provisioningId
                            End If

                            objResponse.packageArray(i).securityKeysAllowed = objTempResponse.packageArray(i).securityKeysAllowed

                            If Not (objTempResponse.packageArray(i).type Is Nothing) Then
                                objResponse.packageArray(i).type = objTempResponse.packageArray(i).type
                            End If


                        End If
                    Next
                End If

                objResponse.phoneNumber = objTempResponse.phoneNumber
                objResponse.secretCode = objTempResponse.secretCode
                objResponse.secretHint = objTempResponse.secretHint
                objResponse.StateInitials = objTempResponse.state
                objResponse.totalActivePackage = objTempResponse.totalActivePackage
                objResponse.totalPendingPackage = objTempResponse.totalPendingPackage
                objResponse.zipCode = objTempResponse.zipCode



                If Not (objTempResponse.status Is Nothing) Then
                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If

            End If



            Return objResponse


        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function


    Public Overrides Function CreateMemberService(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New CreateMemberServiceRequest
        Dim objRequest As New WSMemberServices.MemberService

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, CreateMemberServiceRequest)

                If Not (objTempRequest.accountNumber Is Nothing) Then
                    objRequest.accountNumber = objTempRequest.accountNumber
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrlogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrpassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.newUserName Is Nothing) Then
                    objRequest.newUserName = objTempRequest.newUserName
                End If
                If Not (objTempRequest.password Is Nothing) Then
                    objRequest.password = objTempRequest.password
                End If
                If Not (objTempRequest.preferedEmailId Is Nothing) Then
                    objRequest.preferedEmailId = objTempRequest.preferedEmailId
                End If
                If Not (objTempRequest.securityAnswer Is Nothing) Then
                    objRequest.securityAnswer = objTempRequest.securityAnswer
                End If
                If Not (objTempRequest.securityQuestion Is Nothing) Then
                    objRequest.securityQuestion = objTempRequest.securityQuestion
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If
                If Not (objTempRequest.phone Is Nothing) Then
                    objRequest.phone = objTempRequest.phone
                End If
                If Not (objTempRequest.zipCode Is Nothing) Then
                    objRequest.zipCode = objTempRequest.zipCode
                End If

            End If



            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            'objTempResponse = Me.MemberServicesWS.createMemberService(objRequest)
            'objTempResponse = Me.MemberServicesWS.registration(objRequest)



            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            Dim blnResult As String = HttpContext.Current.Application("USE_REGISTRATION_WS")
            If Not (blnResult Is Nothing) Then
                If blnResult.Trim() <> "" Then
                    If blnResult.Trim().Trim() = "T" Then
                        objTempResponse = Me.MemberServicesWS.registration(objRequest)
                    Else
                        objTempResponse = Me.MemberServicesWS.createMemberService(objRequest)
                    End If
                Else
                    objTempResponse = Me.MemberServicesWS.createMemberService(objRequest)
                End If
            Else
                objTempResponse = Me.MemberServicesWS.createMemberService(objRequest)
            End If







            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)


        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function



    Public Overrides Function CreateWebspace(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New CreateWebspaceRequest
        Dim objRequest As New WSMemberServices.CreateWebspaceInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, CreateWebspaceRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.login Is Nothing) Then
                    objRequest.login = objTempRequest.login
                End If
                If Not (objTempRequest.password Is Nothing) Then
                    objRequest.password = objTempRequest.password
                End If
                If Not (objTempRequest.provisionId Is Nothing) Then
                    objRequest.provisionId = objTempRequest.provisionId
                End If
                If Not (objTempRequest.webspaceLogin Is Nothing) Then
                    objRequest.webspaceLogin = objTempRequest.webspaceLogin
                End If
                If Not (objTempRequest.webspacePassword Is Nothing) Then
                    objRequest.webspacePassword = objTempRequest.webspacePassword
                End If
            End If


            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.createWebspace(objRequest)



            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################

            Return GetTheCommonResponse(objTempResponse)


        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function
    Public Overrides Function RemoveWebspace(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New RemoveWebspaceRequest
        Dim objRequest As New WSMemberServices.UpdateWebspaceInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, RemoveWebspaceRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.CSRlogin Is Nothing) Then
                    objRequest.login = objTempRequest.CSRlogin
                End If
                If Not (objTempRequest.CSRpassword Is Nothing) Then
                    objRequest.password = objTempRequest.CSRpassword
                End If
                If Not (objTempRequest.provisionId Is Nothing) Then
                    objRequest.provisionId = objTempRequest.provisionId
                End If
                If Not (objTempRequest.webspaceLogin Is Nothing) Then
                    objRequest.webspaceLogin = objTempRequest.webspaceLogin
                End If
                If Not (objTempRequest.webspacePassword Is Nothing) Then
                    objRequest.webspacePassword = objTempRequest.webspacePassword
                End If
            End If


            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.removeWebspace(objRequest)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)


        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function



    Public Overrides Function ChangeMSLogin(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New ChangeMSLoginRequest
        Dim objRequest As New WSMemberServices.MemberService

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, ChangeMSLoginRequest)

                If Not (objTempRequest.accountNumber Is Nothing) Then
                    objRequest.accountNumber = objTempRequest.accountNumber
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrlogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrpassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.newUserName Is Nothing) Then
                    objRequest.newUserName = objTempRequest.newUserName
                End If
                If Not (objTempRequest.password Is Nothing) Then
                    objRequest.password = objTempRequest.password
                End If
                If Not (objTempRequest.preferedEmailId Is Nothing) Then
                    objRequest.preferedEmailId = objTempRequest.preferedEmailId
                End If
                If Not (objTempRequest.securityAnswer Is Nothing) Then
                    objRequest.securityAnswer = objTempRequest.securityAnswer
                End If
                If Not (objTempRequest.securityQuestion Is Nothing) Then
                    objRequest.securityQuestion = objTempRequest.securityQuestion
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If
            End If

            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.changeMSLogin(objRequest)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function ChangeMSPassword(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New ChangeMSPasswordRequest
        Dim objRequest As New WSMemberServices.MemberService

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, ChangeMSPasswordRequest)

                If Not (objTempRequest.accountNumber Is Nothing) Then
                    objRequest.accountNumber = objTempRequest.accountNumber
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrlogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrpassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.newUserName Is Nothing) Then
                    objRequest.newUserName = objTempRequest.newUserName
                End If
                If Not (objTempRequest.password Is Nothing) Then
                    objRequest.password = objTempRequest.password
                End If
                If Not (objTempRequest.preferedEmailId Is Nothing) Then
                    objRequest.preferedEmailId = objTempRequest.preferedEmailId
                End If
                If Not (objTempRequest.securityAnswer Is Nothing) Then
                    objRequest.securityAnswer = objTempRequest.securityAnswer
                End If
                If Not (objTempRequest.securityQuestion Is Nothing) Then
                    objRequest.securityQuestion = objTempRequest.securityQuestion
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If

            End If

            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.changeMSPassword(objRequest)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function changeMSSecurityQA(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New ChangeMSSecurityQARequest
        Dim objRequest As New WSMemberServices.MemberService

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, ChangeMSSecurityQARequest)

                If Not (objTempRequest.accountNumber Is Nothing) Then
                    objRequest.accountNumber = objTempRequest.accountNumber
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrlogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrpassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.newUserName Is Nothing) Then
                    objRequest.newUserName = objTempRequest.newUserName
                End If
                If Not (objTempRequest.password Is Nothing) Then
                    objRequest.password = objTempRequest.password
                End If
                If Not (objTempRequest.preferedEmailId Is Nothing) Then
                    objRequest.preferedEmailId = objTempRequest.preferedEmailId
                End If
                If Not (objTempRequest.securityAnswer Is Nothing) Then
                    objRequest.securityAnswer = objTempRequest.securityAnswer
                End If
                If Not (objTempRequest.securityQuestion Is Nothing) Then
                    objRequest.securityQuestion = objTempRequest.securityQuestion
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If

            End If

            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.changeMSSecurityQA(objRequest)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)


        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function ChangeMSContactEmail(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New ChangeMAContactEmailRequest
        Dim objRequest As New WSMemberServices.MemberService

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, ChangeMAContactEmailRequest)

                If Not (objTempRequest.accountNumber Is Nothing) Then
                    objRequest.accountNumber = objTempRequest.accountNumber
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrlogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrpassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.newUserName Is Nothing) Then
                    objRequest.newUserName = objTempRequest.newUserName
                End If
                If Not (objTempRequest.password Is Nothing) Then
                    objRequest.password = objTempRequest.password
                End If
                If Not (objTempRequest.preferedEmailId Is Nothing) Then
                    objRequest.preferedEmailId = objTempRequest.preferedEmailId
                End If
                If Not (objTempRequest.securityAnswer Is Nothing) Then
                    objRequest.securityAnswer = objTempRequest.securityAnswer
                End If
                If Not (objTempRequest.securityQuestion Is Nothing) Then
                    objRequest.securityQuestion = objTempRequest.securityQuestion
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If

            End If




            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.changeMSContactEmail(objRequest)



            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function RemoveEmailAccount(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New RemoveEmailAccountRequest
        Dim objRequest As New WSMemberServices.MemberService

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try

            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, RemoveEmailAccountRequest)

                If Not (objTempRequest.accountNumber Is Nothing) Then
                    objRequest.accountNumber = objTempRequest.accountNumber
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrlogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrpassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.newUserName Is Nothing) Then
                    objRequest.newUserName = objTempRequest.newUserName
                End If
                If Not (objTempRequest.password Is Nothing) Then
                    objRequest.password = objTempRequest.password
                End If
                If Not (objTempRequest.preferedEmailId Is Nothing) Then
                    objRequest.preferedEmailId = objTempRequest.preferedEmailId
                End If
                If Not (objTempRequest.securityAnswer Is Nothing) Then
                    objRequest.securityAnswer = objTempRequest.securityAnswer
                End If
                If Not (objTempRequest.securityQuestion Is Nothing) Then
                    objRequest.securityQuestion = objTempRequest.securityQuestion
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If

            End If


            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.removeEmailAccount(objRequest.preferedEmailId, objRequest.csrlogin, objRequest.csrpassword)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)


        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function ChangeEmailPassword(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New ChangeEmailPasswordRequest
        Dim objRequest As New WSMemberServices.CreateEmailInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, ChangeEmailPasswordRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.emailAddress Is Nothing) Then
                    objRequest.emailAddress = objTempRequest.emailAddress
                End If
                If Not (objTempRequest.emailDomain Is Nothing) Then
                    objRequest.emailDomain = objTempRequest.emailDomain
                End If
                If Not (objTempRequest.emailHOHStatus Is Nothing) Then
                    objRequest.emailHOHStatus = objTempRequest.emailHOHStatus
                End If
                If Not (objTempRequest.emailLogin Is Nothing) Then
                    objRequest.emailLogin = objTempRequest.emailLogin
                End If
                If Not (objTempRequest.emailPassword Is Nothing) Then
                    objRequest.emailPassword = objTempRequest.emailPassword
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrLogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.newEmailLogin Is Nothing) Then
                    objRequest.newEmailLogin = objTempRequest.newEmailLogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrPassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.provisionId Is Nothing) Then
                    objRequest.provisionId = objTempRequest.provisionId
                End If

            End If


            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.changeEmailPassword(objRequest)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)


        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function ChangeEmailLogin(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New ChangeEmailLoginRequest
        Dim objRequest As New WSMemberServices.CreateEmailInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, ChangeEmailLoginRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.emailAddress Is Nothing) Then
                    objRequest.emailAddress = objTempRequest.emailAddress
                End If
                If Not (objTempRequest.emailDomain Is Nothing) Then
                    objRequest.emailDomain = objTempRequest.emailDomain
                End If
                If Not (objTempRequest.emailHOHStatus Is Nothing) Then
                    objRequest.emailHOHStatus = objTempRequest.emailHOHStatus
                End If
                If Not (objTempRequest.emailLogin Is Nothing) Then
                    objRequest.emailLogin = objTempRequest.emailLogin
                End If
                If Not (objTempRequest.emailPassword Is Nothing) Then
                    objRequest.emailPassword = objTempRequest.emailPassword
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrLogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.newEmailLogin Is Nothing) Then
                    objRequest.newEmailLogin = objTempRequest.newEmailLogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrPassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.provisionId Is Nothing) Then
                    objRequest.provisionId = objTempRequest.provisionId
                End If

            End If




            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.changeEmailLogin(objRequest)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function CreateEmailAccount(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New CreateEmailAccountRequest
        Dim objRequest As New WSMemberServices.CreateEmailInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, CreateEmailAccountRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.emailAddress Is Nothing) Then
                    objRequest.emailAddress = objTempRequest.emailAddress
                End If
                If Not (objTempRequest.emailDomain Is Nothing) Then
                    objRequest.emailDomain = objTempRequest.emailDomain
                End If
                If Not (objTempRequest.emailHOHStatus Is Nothing) Then
                    objRequest.emailHOHStatus = objTempRequest.emailHOHStatus
                End If
                If Not (objTempRequest.emailLogin Is Nothing) Then
                    objRequest.emailLogin = objTempRequest.emailLogin
                End If
                If Not (objTempRequest.emailPassword Is Nothing) Then
                    objRequest.emailPassword = objTempRequest.emailPassword
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrLogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.newEmailLogin Is Nothing) Then
                    objRequest.newEmailLogin = objTempRequest.newEmailLogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrPassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.provisionId Is Nothing) Then
                    objRequest.provisionId = objTempRequest.provisionId
                End If

            End If



            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.createEmail(objRequest)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)


        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function



    Public Overrides Function GetMSBillingSystemLink(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objRequest As New GetMSBillingSystemLinkRequest

        ''#######################################
        ''TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        ''#######################################
        Dim objTempResponse As New WSMemberServices.EpayLinkInfo
        Dim objResponse As New GetMSBillingSystemLinkResponse

        Try

            If Not (obj Is Nothing) Then
                objRequest = CType(obj, GetMSBillingSystemLinkRequest)
            End If




            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.getEpayLink(objRequest.accountId, objRequest.login, objRequest.password, objRequest.successPage)



            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################

            If Not (objTempResponse Is Nothing) Then
                If Not (objTempResponse.status Is Nothing) Then
                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If


                'If Not (objTempResponse.errorText Is Nothing) Then
                '    objResponse.WSErrorText = objTempResponse.errorText
                'End If
                If Not (objTempResponse.billingSys Is Nothing) Then
                    objResponse.billingSys = objTempResponse.billingSys
                End If
                If Not (objTempResponse.URL Is Nothing) Then
                    objResponse.URL = objTempResponse.URL
                End If
                If Not (objTempResponse.d Is Nothing) Then
                    objResponse.d = objTempResponse.d
                End If
                If Not (objTempResponse.s Is Nothing) Then
                    objResponse.s = objTempResponse.s
                End If
                If Not (objTempResponse.k Is Nothing) Then
                    objResponse.k = objTempResponse.k
                End If
            End If



            Return objResponse
            'Return Nothing

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function








    Public Overrides Function GetMSWebspaceSummary(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New GetMSWebspaceSummaryRequest
        Dim objRequest As New WSMemberServices.AccountInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.AccountInfo
        Dim objResponse As New GetMSWebspaceSummaryResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, GetMSWebspaceSummaryRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrLogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrPassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.emailArray Is Nothing) Then
                    objRequest.emailArray = objTempRequest.emailArray
                End If
                'If Not (objTempRequest.errorText Is Nothing) Then
                '    objRequest.errorText = objTempRequest.errorText
                'End If
                If Not (objTempRequest.modemArray Is Nothing) Then
                    objRequest.modemArray = objTempRequest.modemArray
                End If


                If Not (objTempRequest.packageArray Is Nothing) Then
                    ReDim objResponse.packageArray(objTempRequest.packageArray.GetUpperBound(0))
                    For i As Integer = 0 To objTempRequest.packageArray.GetUpperBound(0)
                        If Not (objTempRequest.packageArray(i) Is Nothing) Then

                            objRequest.packageArray(i) = New WSMemberServices.PackageInfo
                            If Not (objTempRequest.packageArray(i).description Is Nothing) Then
                                objRequest.packageArray(i).description = objTempRequest.packageArray(i).description
                            End If

                            If Not (objTempRequest.packageArray(i).emails Is Nothing) Then
                                ReDim objRequest.packageArray(i).emails(objTempRequest.packageArray(i).emails.GetUpperBound(0))
                                For i2 As Integer = 0 To objTempRequest.packageArray(i).emails.GetUpperBound(0)
                                    If Not (objTempRequest.packageArray(i).emails(i2) Is Nothing) Then
                                        objRequest.packageArray(i).emails(i2) = New WSMemberServices.EmailInfo

                                        If Not (objTempRequest.packageArray(i).emails(i2).domain Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).domain = objTempRequest.packageArray(i).emails(i2).domain
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).HOHStatus Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).HOHStatus = objTempRequest.packageArray(i).emails(i2).HOHStatus
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).provisioningId Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).provisioningId = objTempRequest.packageArray(i).emails(i2).provisioningId
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).status Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).status = objTempRequest.packageArray(i).emails(i2).status
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).userName Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).userName = objTempRequest.packageArray(i).emails(i2).userName
                                        End If
                                    End If
                                Next
                            End If

                            If Not (objTempRequest.packageArray(i).provisioningId Is Nothing) Then
                                objRequest.packageArray(i).provisioningId = objTempRequest.packageArray(i).provisioningId
                            End If
                            If Not (objTempRequest.packageArray(i).status Is Nothing) Then
                                objRequest.packageArray(i).status = objTempRequest.packageArray(i).status
                            End If
                            If Not (objTempRequest.packageArray(i).type Is Nothing) Then
                                objRequest.packageArray(i).type = objTempRequest.packageArray(i).type
                            End If
                        End If
                    Next
                End If

                'If Not (objTempRequest.status Is Nothing) Then
                '    objRequest.status = objTempRequest.status
                'End If
                If Not (objTempRequest.type Is Nothing) Then
                    objRequest.type = objTempRequest.type
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If
            End If


            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.getAccountInfo(objRequest)



            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################

            If Not (objTempResponse Is Nothing) Then
                If Not (objTempResponse.accountId Is Nothing) Then
                    objResponse.accountId = objTempResponse.accountId
                End If
                If Not (objTempResponse.csrLogin Is Nothing) Then
                    objResponse.csrlogin = objTempResponse.csrLogin
                End If
                If Not (objTempResponse.csrPassword Is Nothing) Then
                    objResponse.csrpassword = objTempResponse.csrPassword
                End If
                If Not (objTempResponse.emailArray Is Nothing) Then
                    objResponse.emailArray = objTempResponse.emailArray
                End If
                'If Not (objTempResponse.errorText Is Nothing) Then
                '    objResponse.errorText = objTempResponse.errorText
                'End If
                If Not (objTempResponse.modemArray Is Nothing) Then
                    objResponse.modemArray = objTempResponse.modemArray
                End If


                If Not (objTempResponse.packageArray Is Nothing) Then
                    ReDim objResponse.packageArray(objTempResponse.packageArray.GetUpperBound(0))
                    For i As Integer = 0 To objTempResponse.packageArray.GetUpperBound(0)

                        If Not (objTempResponse.packageArray(i) Is Nothing) Then
                            objResponse.packageArray(i) = New PackageInfo

                            If Not (objTempResponse.packageArray(i).description Is Nothing) Then
                                objResponse.packageArray(i).description = objTempResponse.packageArray(i).description
                            End If

                            If Not (objTempResponse.packageArray(i).emails Is Nothing) Then
                                ReDim objResponse.packageArray(i).emails(objTempResponse.packageArray(i).emails.GetUpperBound(0))
                                For i2 As Integer = 0 To objTempResponse.packageArray(i).emails.GetUpperBound(0)
                                    If Not (objTempResponse.packageArray(i).emails(i2) Is Nothing) Then
                                        objResponse.packageArray(i).emails(i2) = New EmailInfo
                                        If Not (objTempResponse.packageArray(i).emails(i2).domain Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).domain = objTempResponse.packageArray(i).emails(i2).domain
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).HOHStatus Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).HOHStatus = objTempResponse.packageArray(i).emails(i2).HOHStatus
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).provisioningId Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).provisioningId = objTempResponse.packageArray(i).emails(i2).provisioningId
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).status Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).status = objTempResponse.packageArray(i).emails(i2).status
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).userName Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).userName = objTempResponse.packageArray(i).emails(i2).userName
                                        End If
                                    End If
                                Next
                            End If

                            If Not (objTempResponse.packageArray(i).provisioningId Is Nothing) Then
                                objResponse.packageArray(i).provisioningId = objTempResponse.packageArray(i).provisioningId
                            End If
                            If Not (objTempResponse.packageArray(i).status Is Nothing) Then
                                objResponse.packageArray(i).status = objTempResponse.packageArray(i).status
                            End If
                            If Not (objTempResponse.packageArray(i).type Is Nothing) Then
                                objResponse.packageArray(i).type = objTempResponse.packageArray(i).type
                            End If
                            If Not (objTempResponse.packageArray(i).webspace Is Nothing) Then
                                objResponse.packageArray(i).webspace = objTempResponse.packageArray(i).webspace
                            End If
                        End If
                    Next
                End If

                If Not (objTempResponse.preferedEmailId Is Nothing) Then
                    objResponse.preferedEmailId = objTempResponse.preferedEmailId
                End If
                If Not (objTempResponse.securityAnswer Is Nothing) Then
                    objResponse.securityAnswer = objTempResponse.securityAnswer
                End If
                'If Not (objTempResponse.securityKeyArray Is Nothing) Then
                '    objResponse.securityKeyArray = objTempResponse.securityKeyArray
                'End If
                If Not (objTempResponse.securityQuestion Is Nothing) Then
                    objResponse.securityQuestion = objTempResponse.securityQuestion
                End If


                If Not (objTempResponse.status Is Nothing) Then
                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If

                If Not (objTempResponse.type Is Nothing) Then
                    objResponse.type = objTempResponse.type
                End If
                If Not (objTempResponse.userName Is Nothing) Then
                    objResponse.userName = objTempResponse.userName
                End If
            End If


            Return objResponse

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function ChangeMSEmailToPrimary(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New ChangeMSEmailToPrimaryRequest
        Dim objRequest As New WSMemberServices.CreateEmailInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, ChangeMSEmailToPrimaryRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.emailAddress Is Nothing) Then
                    objRequest.emailAddress = objTempRequest.emailAddress
                End If
                If Not (objTempRequest.emailDomain Is Nothing) Then
                    objRequest.emailDomain = objTempRequest.emailDomain
                End If
                If Not (objTempRequest.emailHOHStatus Is Nothing) Then
                    objRequest.emailHOHStatus = objTempRequest.emailHOHStatus
                End If
                If Not (objTempRequest.emailLogin Is Nothing) Then
                    objRequest.emailLogin = objTempRequest.emailLogin
                End If
                If Not (objTempRequest.emailPassword Is Nothing) Then
                    objRequest.emailPassword = objTempRequest.emailPassword
                End If
                If Not (objTempRequest.csrlogin Is Nothing) Then
                    objRequest.csrLogin = objTempRequest.csrlogin
                End If
                If Not (objTempRequest.newEmailLogin Is Nothing) Then
                    objRequest.newEmailLogin = objTempRequest.newEmailLogin
                End If
                If Not (objTempRequest.csrpassword Is Nothing) Then
                    objRequest.csrPassword = objTempRequest.csrpassword
                End If
                If Not (objTempRequest.provisionId Is Nothing) Then
                    objRequest.provisionId = objTempRequest.provisionId
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If
            End If




            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.changeEmailFamilyHOH(objRequest)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function GetEmailAddressListForLogin(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New GetEmailAddressListForLoginRequest
        Dim objRequest As New WSMemberServices.EmailFamilyInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.EmailFamilyInfo
        Dim objResponse As New GetEmailAddressListForLoginResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, GetEmailAddressListForLoginRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.csrLogin Is Nothing) Then
                    objRequest.csrLogin = objTempRequest.csrLogin
                End If
                If Not (objTempRequest.csrPassword Is Nothing) Then
                    objRequest.csrPassword = objTempRequest.csrPassword
                End If
                'If Not (objTempRequest.errorText Is Nothing) Then
                '    objRequest.errorText = objTempRequest.errorText
                'End If

                If Not (objTempRequest.families Is Nothing) Then
                    ReDim objResponse.families(objTempRequest.families.GetUpperBound(0))
                    For i As Integer = 0 To objTempRequest.families.GetUpperBound(0)
                        objRequest.families(i) = New WSMemberServices.PackageInfo
                        If Not (objTempRequest.families(i).description Is Nothing) Then
                            objRequest.families(i).description = objTempRequest.families(i).description
                        End If

                        If Not (objTempRequest.families(i).emails Is Nothing) Then
                            ReDim objRequest.families(i).emails(objTempRequest.families(i).emails.GetUpperBound(0))
                            For i2 As Integer = 0 To objTempRequest.families(i).emails.GetUpperBound(0)
                                If Not (objTempRequest.families(i).emails(i2) Is Nothing) Then
                                    objRequest.families(i).emails(i2) = New WSMemberServices.EmailInfo

                                    If Not (objTempRequest.families(i).emails(i2).domain Is Nothing) Then
                                        objRequest.families(i).emails(i2).domain = objTempRequest.families(i).emails(i2).domain
                                    End If
                                    If Not (objTempRequest.families(i).emails(i2).HOHStatus Is Nothing) Then
                                        objRequest.families(i).emails(i2).HOHStatus = objTempRequest.families(i).emails(i2).HOHStatus
                                    End If
                                    If Not (objTempRequest.families(i).emails(i2).provisioningId Is Nothing) Then
                                        objRequest.families(i).emails(i2).provisioningId = objTempRequest.families(i).emails(i2).provisioningId
                                    End If
                                    If Not (objTempRequest.families(i).emails(i2).status Is Nothing) Then
                                        objRequest.families(i).emails(i2).status = objTempRequest.families(i).emails(i2).status
                                    End If
                                    If Not (objTempRequest.families(i).emails(i2).userName Is Nothing) Then
                                        objRequest.families(i).emails(i2).userName = objTempRequest.families(i).emails(i2).userName
                                    End If

                                End If

                            Next
                        End If

                        If Not (objTempRequest.families(i).provisioningId Is Nothing) Then
                            objRequest.families(i).provisioningId = objTempRequest.families(i).provisioningId
                        End If
                        If Not (objTempRequest.families(i).status Is Nothing) Then
                            objRequest.families(i).status = objTempRequest.families(i).status
                        End If
                        If Not (objTempRequest.families(i).type Is Nothing) Then
                            objRequest.families(i).type = objTempRequest.families(i).type
                        End If
                    Next
                End If

                'If Not (objTempRequest.status Is Nothing) Then
                '    objRequest.status = objTempRequest.status
                'End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If
            End If



            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.getEmailFamilyInfo(objRequest)



            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################

            If Not (objTempResponse Is Nothing) Then

                If Not (objTempResponse.accountId Is Nothing) Then
                    objResponse.accountId = objTempResponse.accountId
                End If
                If Not (objTempResponse.csrLogin Is Nothing) Then
                    objResponse.csrLogin = objTempResponse.csrLogin
                End If
                If Not (objTempResponse.csrPassword Is Nothing) Then
                    objResponse.csrPassword = objTempResponse.csrPassword
                End If
                'If Not (objTempResponse.errorText Is Nothing) Then
                '    objResponse.errorText = objTempResponse.errorText
                'End If


                If Not (objTempResponse.families Is Nothing) Then
                    ReDim objResponse.families(objTempResponse.families.GetUpperBound(0))
                    For i As Integer = 0 To objTempResponse.families.GetUpperBound(0)

                        If Not (objTempResponse.families(i) Is Nothing) Then
                            objResponse.families(i) = New PackageInfo

                            If Not (objTempResponse.families(i).description Is Nothing) Then
                                objResponse.families(i).description = objTempResponse.families(i).description
                            End If

                            If Not (objTempResponse.families(i).emails Is Nothing) Then
                                ReDim objResponse.families(i).emails(objTempResponse.families(i).emails.GetUpperBound(0))
                                For i2 As Integer = 0 To objTempResponse.families(i).emails.GetUpperBound(0)
                                    If Not (objTempResponse.families(i).emails(i2) Is Nothing) Then
                                        objResponse.families(i).emails(i2) = New EmailInfo
                                        If Not (objTempResponse.families(i).emails(i2).domain Is Nothing) Then
                                            objResponse.families(i).emails(i2).domain = objTempResponse.families(i).emails(i2).domain
                                        End If
                                        If Not (objTempResponse.families(i).emails(i2).HOHStatus Is Nothing) Then
                                            objResponse.families(i).emails(i2).HOHStatus = objTempResponse.families(i).emails(i2).HOHStatus
                                        End If
                                        If Not (objTempResponse.families(i).emails(i2).provisioningId Is Nothing) Then
                                            objResponse.families(i).emails(i2).provisioningId = objTempResponse.families(i).emails(i2).provisioningId
                                        End If
                                        If Not (objTempResponse.families(i).emails(i2).status Is Nothing) Then
                                            objResponse.families(i).emails(i2).status = objTempResponse.families(i).emails(i2).status
                                        End If
                                        If Not (objTempResponse.families(i).emails(i2).userName Is Nothing) Then
                                            objResponse.families(i).emails(i2).userName = objTempResponse.families(i).emails(i2).userName
                                        End If
                                    End If
                                Next
                            End If


                            If (objTempResponse.families(i).emailsAllowed > 0) Then
                                objResponse.families(i).MaxEmailsAllowed = objTempResponse.families(i).emailsAllowed
                            End If

                            If Not (objTempResponse.families(i).provisioningId Is Nothing) Then
                                objResponse.families(i).provisioningId = objTempResponse.families(i).provisioningId
                            End If
                            If Not (objTempResponse.families(i).status Is Nothing) Then
                                objResponse.families(i).status = objTempResponse.families(i).status
                            End If
                            If Not (objTempResponse.families(i).type Is Nothing) Then
                                objResponse.families(i).type = objTempResponse.families(i).type
                            End If

                        End If



                    Next
                End If


                If Not (objTempResponse.status Is Nothing) Then
                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If


                If Not (objTempResponse.userName Is Nothing) Then
                    objResponse.userName = objTempResponse.userName
                End If
            End If


            Return objResponse


        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function GetMSSecurityQAForAccount(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New GetMSSecurityQAForAccountRequest
        Dim objRequest As New WSMemberServices.AccountInfo

        '########################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '########################################
        Dim objTempResponse As New WSMemberServices.AccountInfo
        Dim objResponse As New GetMSSecurityQAForAccountResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, GetMSSecurityQAForAccountRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.csrLogin Is Nothing) Then
                    objRequest.csrLogin = objTempRequest.csrLogin
                End If
                If Not (objTempRequest.csrPassword Is Nothing) Then
                    objRequest.csrPassword = objTempRequest.csrPassword
                End If
                'If Not (objTempRequest.errorText Is Nothing) Then
                '    objRequest.errorText = objTempRequest.errorText
                'End If
                If Not (objTempRequest.modemArray Is Nothing) Then
                    objRequest.modemArray = objTempRequest.modemArray
                End If


                If Not (objTempRequest.packageArray Is Nothing) Then
                    ReDim objResponse.packageArray(objTempRequest.packageArray.GetUpperBound(0))
                    For i As Integer = 0 To objTempRequest.packageArray.GetUpperBound(0)
                        If Not (objTempRequest.packageArray(i) Is Nothing) Then
                            objRequest.packageArray(i) = New WSMemberServices.PackageInfo

                            If Not (objTempRequest.packageArray(i).description Is Nothing) Then
                                objRequest.packageArray(i).description = objTempRequest.packageArray(i).description
                            End If

                            If Not (objTempRequest.packageArray(i).emails Is Nothing) Then
                                ReDim objRequest.packageArray(i).emails(objTempRequest.packageArray(i).emails.GetUpperBound(0))
                                For i2 As Integer = 0 To objTempRequest.packageArray(i).emails.GetUpperBound(0)
                                    If Not (objTempRequest.packageArray(i).emails(i2) Is Nothing) Then
                                        objRequest.packageArray(i).emails(i2) = New WSMemberServices.EmailInfo
                                        If Not (objTempRequest.packageArray(i).emails(i2).domain Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).domain = objTempRequest.packageArray(i).emails(i2).domain
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).HOHStatus Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).HOHStatus = objTempRequest.packageArray(i).emails(i2).HOHStatus
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).provisioningId Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).provisioningId = objTempRequest.packageArray(i).emails(i2).provisioningId
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).status Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).status = objTempRequest.packageArray(i).emails(i2).status
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).userName Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).userName = objTempRequest.packageArray(i).emails(i2).userName
                                        End If

                                    End If
                                Next
                            End If

                            If Not (objTempRequest.packageArray(i).provisioningId Is Nothing) Then
                                objRequest.packageArray(i).provisioningId = objTempRequest.packageArray(i).provisioningId
                            End If
                            If Not (objTempRequest.packageArray(i).status Is Nothing) Then
                                objRequest.packageArray(i).status = objTempRequest.packageArray(i).status
                            End If
                            If Not (objTempRequest.packageArray(i).type Is Nothing) Then
                                objRequest.packageArray(i).type = objTempRequest.packageArray(i).type
                            End If
                        End If
                    Next
                End If

                If Not (objTempRequest.securityAnswer Is Nothing) Then
                    objRequest.securityAnswer = objTempRequest.securityAnswer
                End If
                If Not (objTempRequest.securityQuestion Is Nothing) Then
                    objRequest.securityQuestion = objTempRequest.securityQuestion
                End If
                'If Not (objTempRequest.status Is Nothing) Then
                '    objRequest.status = objTempRequest.status
                'End If
                If Not (objTempRequest.type Is Nothing) Then
                    objRequest.type = objTempRequest.type
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If
            End If

            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.getAccountInfo(objRequest)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################

            If Not (objTempResponse Is Nothing) Then
                If Not (objTempResponse.accountId Is Nothing) Then
                    objResponse.accountId = objTempResponse.accountId
                End If
                If Not (objTempResponse.csrLogin Is Nothing) Then
                    objResponse.csrLogin = objTempResponse.csrLogin
                End If
                If Not (objTempResponse.csrPassword Is Nothing) Then
                    objResponse.csrPassword = objTempResponse.csrPassword
                End If
                'If Not (objTempResponse.errorText Is Nothing) Then
                '    objResponse.errorText = objTempResponse.errorText
                'End If
                If Not (objTempResponse.modemArray Is Nothing) Then
                    objResponse.modemArray = objTempResponse.modemArray
                End If


                If Not (objTempResponse.packageArray Is Nothing) Then
                    ReDim objResponse.packageArray(objTempResponse.packageArray.GetUpperBound(0))
                    For i As Integer = 0 To objTempResponse.packageArray.GetUpperBound(0)

                        If Not (objTempResponse.packageArray(i) Is Nothing) Then
                            objResponse.packageArray(i) = New PackageInfo
                            If Not (objTempResponse.packageArray(i).description Is Nothing) Then
                                objResponse.packageArray(i).description = objTempResponse.packageArray(i).description
                            End If

                            If Not (objTempResponse.packageArray(i).emails Is Nothing) Then
                                ReDim objResponse.packageArray(i).emails(objTempResponse.packageArray(i).emails.GetUpperBound(0))
                                For i2 As Integer = 0 To objTempResponse.packageArray(i).emails.GetUpperBound(0)
                                    If Not (objTempResponse.packageArray(i).emails(i2) Is Nothing) Then
                                        objResponse.packageArray(i).emails(i2) = New EmailInfo
                                        If Not (objTempResponse.packageArray(i).emails(i2).domain Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).domain = objTempResponse.packageArray(i).emails(i2).domain
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).HOHStatus Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).HOHStatus = objTempResponse.packageArray(i).emails(i2).HOHStatus
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).provisioningId Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).provisioningId = objTempResponse.packageArray(i).emails(i2).provisioningId
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).status Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).status = objTempResponse.packageArray(i).emails(i2).status
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).userName Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).userName = objTempResponse.packageArray(i).emails(i2).userName
                                        End If
                                    End If
                                Next
                            End If

                            If Not (objTempResponse.packageArray(i).provisioningId Is Nothing) Then
                                objResponse.packageArray(i).provisioningId = objTempResponse.packageArray(i).provisioningId
                            End If
                            If Not (objTempResponse.packageArray(i).status Is Nothing) Then
                                objResponse.packageArray(i).status = objTempResponse.packageArray(i).status
                            End If
                            If Not (objTempResponse.packageArray(i).type Is Nothing) Then
                                objResponse.packageArray(i).type = objTempResponse.packageArray(i).type
                            End If

                        End If

                    Next
                End If
                If Not (objTempResponse.preferedEmailId Is Nothing) Then
                    objResponse.preferedEmailId = objTempResponse.preferedEmailId
                End If
                If Not (objTempResponse.securityAnswer Is Nothing) Then
                    objResponse.securityAnswer = objTempResponse.securityAnswer
                End If
                'If Not (objTempResponse.securityKeyArray Is Nothing) Then
                '    objResponse.securityKeyArray = objTempResponse.securityKeyArray
                'End If
                If Not (objTempResponse.securityQuestion Is Nothing) Then
                    objResponse.securityQuestion = objTempResponse.securityQuestion
                End If



                If Not (objTempResponse.status Is Nothing) Then

                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If

                If Not (objTempResponse.type Is Nothing) Then
                    objResponse.type = objTempResponse.type
                End If
                If Not (objTempResponse.userName Is Nothing) Then
                    objResponse.userName = objTempResponse.userName
                End If

            End If


            Return objResponse

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function GetMSSecurityQA(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New GetMSSecurityQARequest
        'Dim objRequest As New WSMemberServices.SecurityQuestionInfo

        '########################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '########################################
        Dim objTempResponse As New WSMemberServices.SecurityQuestionInfo
        Dim objResponse As New GetMSSecurityQAResponse

        Try

            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, GetMSSecurityQARequest)

                'If Not (objTempRequest.csrLogin Is Nothing) Then
                '    objRequest.csrLogin = objTempRequest.csrLogin
                'End If
                'If Not (objTempRequest.csrPassword Is Nothing) Then
                '    objRequest.csrPassword = objTempRequest.csrPassword
                'End If
                'If Not (objTempRequest.errorText Is Nothing) Then
                '    objRequest.errorText = objTempRequest.errorText
                'End If
                'If Not (objTempRequest.securityQuestionArray Is Nothing) Then
                '    objRequest.securityQuestionArray = objTempRequest.securityQuestionArray
                'End If
                'If Not (objTempRequest.status Is Nothing) Then
                '    objRequest.status = objTempRequest.status
                'End If

            End If




            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.getSecurityQuestions(objTempRequest.csrLogin, objTempRequest.csrPassword)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################

            If Not (objTempResponse Is Nothing) Then
                'If Not (objTempResponse.csrLogin Is Nothing) Then
                '    objResponse.csrLogin = objTempResponse.csrLogin
                'End If
                'If Not (objTempResponse.csrPassword Is Nothing) Then
                '    objResponse.csrPassword = objTempResponse.csrPassword
                'End If
                'If Not (objTempResponse.errorText Is Nothing) Then
                '    objResponse.errorText = objTempResponse.errorText
                'End If
                If Not (objTempResponse.securityQuestionArray Is Nothing) Then
                    objResponse.securityQuestionArray = objTempResponse.securityQuestionArray
                End If



                If Not (objTempResponse.status Is Nothing) Then
                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If


            End If


            Return objResponse

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function


    'Public Overrides Function forgotMSPassword(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
    '    '#######################################
    '    'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
    '    '#######################################
    '    Dim objTempRequest As New forgotMSPasswordRequest
    '    'Dim objRequest As New WSMemberServices.forgotPassword

    '    '#######################################
    '    'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
    '    '#######################################
    '    Dim objTempResponse As New WSMemberServices.WSResult
    '    Dim objResponse As New TheCommonResponse

    '    Try
    '        If Not (obj Is Nothing) Then
    '            objTempRequest = CType(obj, forgotMSPasswordRequest)
    '        End If


    '        '########################
    '        'EXECUTE THE WEB SERVICE
    '        '########################
    '        objTempResponse = Me.MemberServicesWS.forgotPassword(objTempRequest.MSContactEmail, objTempRequest.AccountID, objTempRequest.CSRLogin, objTempRequest.CSRPassword)




    '        '#########################################################################################
    '        'translate back to a common object in the gateway, visible from Provider and the BL both.
    '        '#########################################################################################
    '        Return GetTheCommonResponse(objTempResponse)

    '    Catch ex As Exception
    '        objResponse.Exception = True
    '        objResponse.ExceptionMessage = ex.Message
    '        objResponse.ExceptionStackTrace = ex.StackTrace
    '        Return objResponse
    '    Finally

    '    End Try
    'End Function


    Public Overrides Function GetMSContactEmailAddress(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New GetMSContactEmailAddressRequest
        Dim objRequest As New WSMemberServices.AccountInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.AccountInfo
        Dim objResponse As New GetMSContactEmailAddressResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, GetMSContactEmailAddressRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.csrLogin Is Nothing) Then
                    objRequest.csrLogin = objTempRequest.csrLogin
                End If
                If Not (objTempRequest.csrPassword Is Nothing) Then
                    objRequest.csrPassword = objTempRequest.csrPassword
                End If
                If Not (objTempRequest.emailArray Is Nothing) Then
                    objRequest.emailArray = objTempRequest.emailArray
                End If
                'If Not (objTempRequest.errorText Is Nothing) Then
                '    objRequest.errorText = objTempRequest.errorText
                'End If
                If Not (objTempRequest.modemArray Is Nothing) Then
                    objRequest.modemArray = objTempRequest.modemArray
                End If


                If Not (objTempRequest.packageArray Is Nothing) Then
                    ReDim objResponse.packageArray(objTempRequest.packageArray.GetUpperBound(0))
                    For i As Integer = 0 To objTempRequest.packageArray.GetUpperBound(0)
                        If Not (objTempRequest.packageArray(i) Is Nothing) Then

                            objRequest.packageArray(i) = New WSMemberServices.PackageInfo
                            If Not (objTempRequest.packageArray(i).description Is Nothing) Then
                                objRequest.packageArray(i).description = objTempRequest.packageArray(i).description
                            End If

                            If Not (objTempRequest.packageArray(i).emails Is Nothing) Then
                                ReDim objRequest.packageArray(i).emails(objTempRequest.packageArray(i).emails.GetUpperBound(0))
                                For i2 As Integer = 0 To objTempRequest.packageArray(i).emails.GetUpperBound(0)
                                    If Not (objTempRequest.packageArray(i).emails(i2) Is Nothing) Then
                                        objRequest.packageArray(i).emails(i2) = New WSMemberServices.EmailInfo

                                        If Not (objTempRequest.packageArray(i).emails(i2).domain Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).domain = objTempRequest.packageArray(i).emails(i2).domain
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).HOHStatus Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).HOHStatus = objTempRequest.packageArray(i).emails(i2).HOHStatus
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).provisioningId Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).provisioningId = objTempRequest.packageArray(i).emails(i2).provisioningId
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).status Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).status = objTempRequest.packageArray(i).emails(i2).status
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).userName Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).userName = objTempRequest.packageArray(i).emails(i2).userName
                                        End If
                                    End If
                                Next
                            End If

                            If Not (objTempRequest.packageArray(i).provisioningId Is Nothing) Then
                                objRequest.packageArray(i).provisioningId = objTempRequest.packageArray(i).provisioningId
                            End If
                            If Not (objTempRequest.packageArray(i).status Is Nothing) Then
                                objRequest.packageArray(i).status = objTempRequest.packageArray(i).status
                            End If
                            If Not (objTempRequest.packageArray(i).type Is Nothing) Then
                                objRequest.packageArray(i).type = objTempRequest.packageArray(i).type
                            End If
                        End If
                    Next
                End If

                'If Not (objTempRequest.status Is Nothing) Then
                '    objRequest.status = objTempRequest.status
                'End If
                If Not (objTempRequest.type Is Nothing) Then
                    objRequest.type = objTempRequest.type
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If
            End If


            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.getAccountInfo(objRequest)



            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################

            If Not (objTempResponse Is Nothing) Then
                If Not (objTempResponse.accountId Is Nothing) Then
                    objResponse.accountId = objTempResponse.accountId
                End If
                If Not (objTempResponse.csrLogin Is Nothing) Then
                    objResponse.csrLogin = objTempResponse.csrLogin
                End If
                If Not (objTempResponse.csrPassword Is Nothing) Then
                    objResponse.csrPassword = objTempResponse.csrPassword
                End If
                If Not (objTempResponse.emailArray Is Nothing) Then
                    objResponse.emailArray = objTempResponse.emailArray
                End If
                'If Not (objTempResponse.errorText Is Nothing) Then
                '    objResponse.errorText = objTempResponse.errorText
                'End If
                If Not (objTempResponse.modemArray Is Nothing) Then
                    objResponse.modemArray = objTempResponse.modemArray
                End If


                If Not (objTempResponse.packageArray Is Nothing) Then
                    ReDim objResponse.packageArray(objTempResponse.packageArray.GetUpperBound(0))
                    For i As Integer = 0 To objTempResponse.packageArray.GetUpperBound(0)

                        If Not (objTempResponse.packageArray(i) Is Nothing) Then
                            objResponse.packageArray(i) = New PackageInfo

                            If Not (objTempResponse.packageArray(i).description Is Nothing) Then
                                objResponse.packageArray(i).description = objTempResponse.packageArray(i).description
                            End If

                            If Not (objTempResponse.packageArray(i).emails Is Nothing) Then
                                ReDim objResponse.packageArray(i).emails(objTempResponse.packageArray(i).emails.GetUpperBound(0))
                                For i2 As Integer = 0 To objTempResponse.packageArray(i).emails.GetUpperBound(0)
                                    If Not (objTempResponse.packageArray(i).emails(i2) Is Nothing) Then
                                        objResponse.packageArray(i).emails(i2) = New EmailInfo
                                        If Not (objTempResponse.packageArray(i).emails(i2).domain Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).domain = objTempResponse.packageArray(i).emails(i2).domain
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).HOHStatus Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).HOHStatus = objTempResponse.packageArray(i).emails(i2).HOHStatus
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).provisioningId Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).provisioningId = objTempResponse.packageArray(i).emails(i2).provisioningId
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).status Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).status = objTempResponse.packageArray(i).emails(i2).status
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).userName Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).userName = objTempResponse.packageArray(i).emails(i2).userName
                                        End If
                                    End If
                                Next
                            End If

                            If Not (objTempResponse.packageArray(i).provisioningId Is Nothing) Then
                                objResponse.packageArray(i).provisioningId = objTempResponse.packageArray(i).provisioningId
                            End If
                            If Not (objTempResponse.packageArray(i).status Is Nothing) Then
                                objResponse.packageArray(i).status = objTempResponse.packageArray(i).status
                            End If
                            If Not (objTempResponse.packageArray(i).type Is Nothing) Then
                                objResponse.packageArray(i).type = objTempResponse.packageArray(i).type
                            End If
                            If Not (objTempResponse.packageArray(i).webspace Is Nothing) Then
                                objResponse.packageArray(i).webspace = objTempResponse.packageArray(i).webspace
                            End If
                        End If
                    Next
                End If

                If Not (objTempResponse.preferedEmailId Is Nothing) Then
                    objResponse.preferedEmailId = objTempResponse.preferedEmailId
                End If
                If Not (objTempResponse.securityAnswer Is Nothing) Then
                    objResponse.securityAnswer = objTempResponse.securityAnswer
                End If
                'If Not (objTempResponse.securityKeyArray Is Nothing) Then
                '    objResponse.securityKeyArray = objTempResponse.securityKeyArray
                'End If
                If Not (objTempResponse.securityQuestion Is Nothing) Then
                    objResponse.securityQuestion = objTempResponse.securityQuestion
                End If




                If Not (objTempResponse.status Is Nothing) Then
                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If


                If Not (objTempResponse.type Is Nothing) Then
                    objResponse.type = objTempResponse.type
                End If
                If Not (objTempResponse.userName Is Nothing) Then
                    objResponse.userName = objTempResponse.userName
                End If
            End If


            Return objResponse

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function


    Public Overrides Function GetMSSecurityKeys(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New GetMSSecurityKeysRequest
        Dim objRequest As New WSMemberServices.AccountInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.AccountInfo
        Dim objResponse As New GetMSSecurityKeysResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, GetMSSecurityKeysRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.csrLogin Is Nothing) Then
                    objRequest.csrLogin = objTempRequest.csrLogin
                End If
                If Not (objTempRequest.csrPassword Is Nothing) Then
                    objRequest.csrPassword = objTempRequest.csrPassword
                End If
                If Not (objTempRequest.emailArray Is Nothing) Then
                    objRequest.emailArray = objTempRequest.emailArray
                End If
                'If Not (objTempRequest.errorText Is Nothing) Then
                '    objRequest.errorText = objTempRequest.errorText
                'End If
                If Not (objTempRequest.modemArray Is Nothing) Then
                    objRequest.modemArray = objTempRequest.modemArray
                End If


                If Not (objTempRequest.packageArray Is Nothing) Then
                    ReDim objResponse.packageArray(objTempRequest.packageArray.GetUpperBound(0))
                    For i As Integer = 0 To objTempRequest.packageArray.GetUpperBound(0)
                        If Not (objTempRequest.packageArray(i) Is Nothing) Then

                            objRequest.packageArray(i) = New WSMemberServices.PackageInfo
                            If Not (objTempRequest.packageArray(i).description Is Nothing) Then
                                objRequest.packageArray(i).description = objTempRequest.packageArray(i).description
                            End If

                            If Not (objTempRequest.packageArray(i).emails Is Nothing) Then
                                ReDim objRequest.packageArray(i).emails(objTempRequest.packageArray(i).emails.GetUpperBound(0))
                                For i2 As Integer = 0 To objTempRequest.packageArray(i).emails.GetUpperBound(0)
                                    If Not (objTempRequest.packageArray(i).emails(i2) Is Nothing) Then
                                        objRequest.packageArray(i).emails(i2) = New WSMemberServices.EmailInfo

                                        If Not (objTempRequest.packageArray(i).emails(i2).domain Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).domain = objTempRequest.packageArray(i).emails(i2).domain
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).HOHStatus Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).HOHStatus = objTempRequest.packageArray(i).emails(i2).HOHStatus
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).provisioningId Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).provisioningId = objTempRequest.packageArray(i).emails(i2).provisioningId
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).status Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).status = objTempRequest.packageArray(i).emails(i2).status
                                        End If
                                        If Not (objTempRequest.packageArray(i).emails(i2).userName Is Nothing) Then
                                            objRequest.packageArray(i).emails(i2).userName = objTempRequest.packageArray(i).emails(i2).userName
                                        End If
                                    End If
                                Next
                            End If

                            If Not (objTempRequest.packageArray(i).provisioningId Is Nothing) Then
                                objRequest.packageArray(i).provisioningId = objTempRequest.packageArray(i).provisioningId
                            End If
                            If Not (objTempRequest.packageArray(i).status Is Nothing) Then
                                objRequest.packageArray(i).status = objTempRequest.packageArray(i).status
                            End If
                            If Not (objTempRequest.packageArray(i).type Is Nothing) Then
                                objRequest.packageArray(i).type = objTempRequest.packageArray(i).type
                            End If
                        End If
                    Next
                End If

                'If Not (objTempRequest.status Is Nothing) Then
                '    objRequest.status = objTempRequest.status
                'End If
                If Not (objTempRequest.type Is Nothing) Then
                    objRequest.type = objTempRequest.type
                End If
                If Not (objTempRequest.userName Is Nothing) Then
                    objRequest.userName = objTempRequest.userName
                End If
            End If


            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.getAccountInfo(objRequest)



            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################

            If Not (objTempResponse Is Nothing) Then
                If Not (objTempResponse.accountId Is Nothing) Then
                    objResponse.accountId = objTempResponse.accountId
                End If
                If Not (objTempResponse.csrLogin Is Nothing) Then
                    objResponse.csrLogin = objTempResponse.csrLogin
                End If
                If Not (objTempResponse.csrPassword Is Nothing) Then
                    objResponse.csrPassword = objTempResponse.csrPassword
                End If
                If Not (objTempResponse.emailArray Is Nothing) Then
                    objResponse.emailArray = objTempResponse.emailArray
                End If
                'If Not (objTempResponse.errorText Is Nothing) Then
                '    objResponse.errorText = objTempResponse.errorText
                'End If
                If Not (objTempResponse.modemArray Is Nothing) Then
                    objResponse.modemArray = objTempResponse.modemArray
                End If


                If Not (objTempResponse.packageArray Is Nothing) Then
                    ReDim objResponse.packageArray(objTempResponse.packageArray.GetUpperBound(0))
                    For i As Integer = 0 To objTempResponse.packageArray.GetUpperBound(0)

                        If Not (objTempResponse.packageArray(i) Is Nothing) Then
                            objResponse.packageArray(i) = New PackageInfo

                            If Not (objTempResponse.packageArray(i).description Is Nothing) Then
                                objResponse.packageArray(i).description = objTempResponse.packageArray(i).description
                            End If

                            If Not (objTempResponse.packageArray(i).emails Is Nothing) Then
                                ReDim objResponse.packageArray(i).emails(objTempResponse.packageArray(i).emails.GetUpperBound(0))
                                For i2 As Integer = 0 To objTempResponse.packageArray(i).emails.GetUpperBound(0)
                                    If Not (objTempResponse.packageArray(i).emails(i2) Is Nothing) Then
                                        objResponse.packageArray(i).emails(i2) = New EmailInfo
                                        If Not (objTempResponse.packageArray(i).emails(i2).domain Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).domain = objTempResponse.packageArray(i).emails(i2).domain
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).HOHStatus Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).HOHStatus = objTempResponse.packageArray(i).emails(i2).HOHStatus
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).provisioningId Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).provisioningId = objTempResponse.packageArray(i).emails(i2).provisioningId
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).status Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).status = objTempResponse.packageArray(i).emails(i2).status
                                        End If
                                        If Not (objTempResponse.packageArray(i).emails(i2).userName Is Nothing) Then
                                            objResponse.packageArray(i).emails(i2).userName = objTempResponse.packageArray(i).emails(i2).userName
                                        End If
                                    End If
                                Next
                            End If

                            If Not (objTempResponse.packageArray(i).provisioningId Is Nothing) Then
                                objResponse.packageArray(i).provisioningId = objTempResponse.packageArray(i).provisioningId
                            End If
                            If Not (objTempResponse.packageArray(i).status Is Nothing) Then
                                objResponse.packageArray(i).status = objTempResponse.packageArray(i).status
                            End If
                            If Not (objTempResponse.packageArray(i).type Is Nothing) Then
                                objResponse.packageArray(i).type = objTempResponse.packageArray(i).type
                            End If
                            If Not (objTempResponse.packageArray(i).webspace Is Nothing) Then
                                objResponse.packageArray(i).webspace = objTempResponse.packageArray(i).webspace
                            End If


                            If (objTempResponse.packageArray(i).emailsAllowed > 0) Then
                                objResponse.packageArray(i).MaxEmailsAllowed = objTempResponse.packageArray(i).emailsAllowed
                            End If


                            If Not (objTempResponse.packageArray(i).securityKeys Is Nothing) Then
                                objResponse.packageArray(i).securityKeysArray = New SecurityKeyArray
                                objResponse.packageArray(i).securityKeysArray.KeysArray = objTempResponse.packageArray(i).securityKeys
                            End If
                            If (objTempResponse.packageArray(i).securityKeysAllowed > 0) Then
                                If (objResponse.packageArray(i).securityKeysArray Is Nothing) Then
                                    objResponse.packageArray(i).securityKeysArray = New SecurityKeyArray
                                End If
                                objResponse.packageArray(i).securityKeysArray.MaxKeysAllowed = objTempResponse.packageArray(i).securityKeysAllowed
                            End If

                        End If
                    Next
                End If

                If Not (objTempResponse.preferedEmailId Is Nothing) Then
                    objResponse.preferedEmailId = objTempResponse.preferedEmailId
                End If
                If Not (objTempResponse.securityAnswer Is Nothing) Then
                    objResponse.securityAnswer = objTempResponse.securityAnswer
                End If
                'If Not (objTempResponse.securityKeyArray Is Nothing) Then
                '    objResponse.securityKeyArray = objTempResponse.securityKeyArray
                'End If
                If Not (objTempResponse.securityQuestion Is Nothing) Then
                    objResponse.securityQuestion = objTempResponse.securityQuestion
                End If



                If Not (objTempResponse.status Is Nothing) Then

                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If

                If Not (objTempResponse.type Is Nothing) Then
                    objResponse.type = objTempResponse.type
                End If
                If Not (objTempResponse.userName Is Nothing) Then
                    objResponse.userName = objTempResponse.userName
                End If
            End If


            Return objResponse

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function


    Public Overrides Function ActivateMSSecurityKey(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New ActivateMSSecurityKeyRequest
        Dim objRequest As New WSMemberServices.ActivateKeyInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New ActivateMSSecurityKeyResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, ActivateMSSecurityKeyRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.CSRlogin Is Nothing) Then
                    objRequest.login = objTempRequest.CSRlogin
                End If
                If Not (objTempRequest.CSRpassword Is Nothing) Then
                    objRequest.password = objTempRequest.CSRpassword
                End If
                If Not (objTempRequest.provisioningId Is Nothing) Then
                    objRequest.provisioningId = objTempRequest.provisioningId
                End If
            End If


            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.activateSecurityKey(objRequest)



            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            If Not (objTempResponse Is Nothing) Then
                If Not (objTempResponse.status Is Nothing) Then
                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If
            End If


            Return objResponse

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function


    Public Overrides Function GetSignInData(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        Dim objTempRequest As GetSignInDataRequest


        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        'Dim lMSProvider As New MemberServicesProvider.ProviderManager
        Dim lEBSProvider As New EBSServicesProvider.ProviderManager

        Dim CSRLOGIN As String = ""
        Dim CSRPASSWORD As String = ""
        Dim MSACCOUNTID As String = ""

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        'Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New GetSignInDataResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, GetSignInDataRequest)

                If Not (objTempRequest Is Nothing) Then

                    CSRLOGIN = objTempRequest.csrLogin
                    CSRPASSWORD = objTempRequest.csrPassword


                    '############################################################
                    'BUILD REQUEST OBJECT AND CALL THE MEMBER SERVICE PROVIDER AUTHENTICATE METHOD
                    '############################################################
                    Dim objAuthenticateMsExRequest As New AuthenticateMsExRequest
                    Dim objAuthenticateMsExResponse As New AuthenticateMsExResponse

                    objAuthenticateMsExRequest.csrLogin = CSRLOGIN
                    objAuthenticateMsExRequest.csrPassword = CSRPASSWORD
                    objAuthenticateMsExRequest.Login = objTempRequest.Login
                    objAuthenticateMsExRequest.Password = objTempRequest.Password
                    'objAuthenticateMsExRequest.SourceIPAddress = objTempRequest.SourceIPAddress

                    '################################
                    'EXECUTE THE CALL TO THE PROVIDER
                    '################################
                    objAuthenticateMsExResponse = Me.AuthenticateMsEx(objAuthenticateMsExRequest)

                    ' todo:dtb: spoof login
                    objAuthenticateMsExResponse.accountNumber = "1234567890"
                    objAuthenticateMsExResponse.accountStatus = 0
                    objAuthenticateMsExResponse.accountType = "csg"
                    objAuthenticateMsExResponse.address1 = "123 Main Street"
                    objAuthenticateMsExResponse.address2 = "Unit 1313"
                    objAuthenticateMsExResponse.billingType = "csg"
                    objAuthenticateMsExResponse.CharterDotCom_Friendly_Messages = ""
                    objAuthenticateMsExResponse.city = "Denver"
                    objAuthenticateMsExResponse.company = "ABC Corp"
                    objAuthenticateMsExResponse.contactEmail = "a@charter.com"
                    objAuthenticateMsExResponse.firstName = "Fred"
                    objAuthenticateMsExResponse.lastName = "Murtz"
                    objAuthenticateMsExResponse.phoneNumber = "222-222-2222"
                    objAuthenticateMsExResponse.secretCode = "abc"
                    objAuthenticateMsExResponse.secretHint = "def"
                    objAuthenticateMsExResponse.StateInitials = "CO"
                    objAuthenticateMsExResponse.zipCode = "80400"

                    objAuthenticateMsExResponse.totalActivePackage = 0
                    objAuthenticateMsExResponse.totalPendingPackage = 0

                    objAuthenticateMsExResponse.hasEmail = True
                    objAuthenticateMsExResponse.hasSecurity = False
                    objAuthenticateMsExResponse.hasWebspace = False

                    objAuthenticateMsExResponse.Exception = False
                    objAuthenticateMsExResponse.ExceptionMessage = ""
                    objAuthenticateMsExResponse.ExceptionStackTrace = ""

                    ' packageArray      CharterDotCom.CommonEntities.Library.EntityMemberServices.PackageDetailInfo()






                    '#######################
                    '#######################
                    '##########################################################
                    'ASSIGN RESULT OBJECT TO THE GETSIGNINDATARESPONSE OBJECT
                    '##########################################################
                    objResponse.MSAuthenticateMsExResponse = objAuthenticateMsExResponse




                    If Not objResponse.MSAuthenticateMsExResponse.Exception Then

                        '############################################################
                        'GET THE BILLING SUMMARY INFO FROM THE EBS WEB SERVICE
                        '############################################################
                        If Not (objAuthenticateMsExResponse Is Nothing) Then
                            If Not (objAuthenticateMsExResponse.billingType Is Nothing) Then
                                Select Case objAuthenticateMsExResponse.billingType.Trim().ToLower()
                                    Case "csg"
                                        If Not (objResponse Is Nothing) Then
                                            If Not (objResponse.MSAuthenticateMsExResponse Is Nothing) Then
                                                If Not (objResponse.MSAuthenticateMsExResponse.accountNumber Is Nothing) Then
                                                    '################################################################################################
                                                    'MODIFICATION	ROD COPELAND	ISSUE ID 6661	CSG Multi-Statement - My Account Overview Page
                                                    '################################################################################################
                                                    '################################################################################################
                                                    Dim objGetCustomerStatementsRequest As New GetCustomerStatementsRequest()
                                                    Dim objGetCustomerStatementsResponse As New GetCustomerStatementsResponse()
                                                    objGetCustomerStatementsRequest.CsgHeaderInfo = New CsgHeaderInfo()

                                                    objGetCustomerStatementsRequest.AccountId = objResponse.MSAuthenticateMsExResponse.accountNumber
                                                    objGetCustomerStatementsRequest.CsgHeaderInfo.ConversationId = ""
                                                    objGetCustomerStatementsRequest.CsgHeaderInfo.Region = ""
                                                    objGetCustomerStatementsRequest.CsgHeaderInfo.RoutingArea = objResponse.MSAuthenticateMsExResponse.accountNumber.Substring(0, 6) & "00"



                                                    '########################################################################
                                                    'MAKE CALL TO THE PROVIDER WHICH IN TURN WILL CALL THE EBS WEB SERVICE
                                                    '########################################################################
                                                    objGetCustomerStatementsResponse = CType(lEBSProvider.GetCustomerStatements(objGetCustomerStatementsRequest), GetCustomerStatementsResponse)




                                                    '#######################################################################################
                                                    'MODIFICATION 3/16/2010  ROD COPELAND    ISSUE 8241  DONT DISPLAY THE TRANSFERED ACCOUNT
                                                    '#######################################################################################
                                                    If HttpContext.Current.Application("STRIPOUT_TRANSFER_ACCOUNTS_ENABLED") IsNot Nothing AndAlso _
                                                    HttpContext.Current.Application("STRIPOUT_TRANSFER_ACCOUNTS_ENABLED") = "T" AndAlso _
                                                    objGetCustomerStatementsResponse IsNot Nothing AndAlso _
                                                    objGetCustomerStatementsResponse.AccountStatementAllInfo IsNot Nothing AndAlso _
                                                    objGetCustomerStatementsResponse.AccountStatementAllInfo.Length() > 1 Then

                                                        '##############################################################################
                                                        'ATTEMPT TO STRIP OUT ANY STATEMENT THAT MAY BE AN OLD PRE-TRANSFER ACCOUNT 
                                                        'STATEMENT.  THESE STATEMENTS ARE NOT SUPPOSED TO DISPLAY ON THE PAGE EVEN 
                                                        'THOUGH THEY COME BACK FROM THE EAI WEB SERVICE METHOD GetCustomerStatements().
                                                        '##############################################################################

                                                        Dim filteredTransferedAccounts As New GetCustomerStatementsResponse()
                                                        filteredTransferedAccounts.AccountStatementAllInfo = New AccountStatementAllInfo() {}

                                                        '###########################################################################################
                                                        'PER TIM W, EAI TEAM.  PASS IN THE CUSTOMER ID TO EAI AND EAI WILL DO A LOOK UP TO BUILD 
                                                        'THE ACTIVE POST-TRANSFER ACCOUNT NUMBER LIST, 0 TO MANY POTENTIALLY.  WITHIN THIS LIST, 
                                                        'EAI HAS INDICATED THAT NO CLOSED OUT/OLD PRE-TRANSFER ACCOUNT NUMBERS SHOULD BE PRESENT, 
                                                        'ONLY ACTIVE ACCOUNT NUMBERS.  SHOOTING FOR A CLEAN LIST TO USE TO INDICATE WHICH 
                                                        'ACCOUNTS WE CAN ACTUALLY SHOW ON THE BILLING SUMMARY WITHIN THE MY ACCOUNT OVERVIEW PAGE.
                                                        '###########################################################################################
                                                        Dim lGetDataRequest As New GetDataRequest
                                                        Dim lGetDataResponse As New GetDataResponse


                                                        If Not String.IsNullOrEmpty(objGetCustomerStatementsResponse.CustomerId) Then
                                                            filteredTransferedAccounts.CustomerId = objGetCustomerStatementsResponse.CustomerId
                                                            lGetDataRequest.CustomerId = objGetCustomerStatementsResponse.CustomerId
                                                        End If


                                                        '########################################################################
                                                        'MAKE CALL TO THE PROVIDER WHICH IN TURN WILL CALL THE EBS WEB SERVICE
                                                        '########################################################################
                                                        lGetDataResponse = CType(lEBSProvider.GetTransferedAccounts(lGetDataRequest), GetDataResponse)



                                                        '########################################################################################################
                                                        'BUILD POST-TRANSFER ACCOUNT NUMBER COLLECTION TO USE IN THE "ACCOUNT STATEMENT ALL INFO" FILTERING LOOP.
                                                        '########################################################################################################
                                                        Dim TransferedAccountList As New List(Of String)
                                                        If lGetDataResponse IsNot Nothing AndAlso lGetDataResponse.TransferedAccounts IsNot Nothing Then
                                                            For Each strTransferedAccount As String In lGetDataResponse.TransferedAccounts
                                                                If Not String.IsNullOrEmpty(strTransferedAccount) Then
                                                                    TransferedAccountList.Add(strTransferedAccount.Trim())
                                                                End If
                                                            Next
                                                        End If



                                                        '#############################################################################
                                                        'LOOP THRU EACH ACCOUNT IN THE CustomerStatements OBJECT AND COMPARE TO THE 
                                                        'FILTERED LIST OF ACCOUNTS EAI HAS PROVIDED IN THE TRANSFERED ACCOUNTS WS CALL.  
                                                        'IF THE ACCOUNT NUMBER IN THE CustomerStatements EXISTS IN THE APPROVED 
                                                        'TRANSFERED ACCOUNT LIST THEN IT'S OKAY TO DISPLAY THAT ACCOUNT ON THE PAGE.  
                                                        'IF THE ACCOUNT IN THE CustomerStatements DOES NOT EXIST IN THE TRANSFERED 
                                                        'ACCOUNT LIST FROM EAI, THEN SKIP OVER ACCOUNT AND DO NOT DISPLAY IT ON THE 
                                                        'BILLING SUMMARY PAGE WITHIN THE MY ACCOUNT OVERVIEW.
                                                        '#############################################################################
                                                        If TransferedAccountList IsNot Nothing AndAlso TransferedAccountList.Count > 0 Then
                                                            For Each lAccountStatementAllInfo As AccountStatementAllInfo In objGetCustomerStatementsResponse.AccountStatementAllInfo

                                                                If lAccountStatementAllInfo IsNot Nothing AndAlso _
                                                                lAccountStatementAllInfo.AccountId IsNot Nothing AndAlso _
                                                                TransferedAccountList.Contains(lAccountStatementAllInfo.AccountId.Trim()) Then
                                                                    '###############################################################################
                                                                    'ADD TO THE ACCOUNT STATEMENT COLLECTION SO THAT IT GETS DISPLAYED ON THE PAGE.
                                                                    '###############################################################################
                                                                    ReDim Preserve filteredTransferedAccounts.AccountStatementAllInfo(filteredTransferedAccounts.AccountStatementAllInfo.GetUpperBound(0) + 1)
                                                                    filteredTransferedAccounts.AccountStatementAllInfo(filteredTransferedAccounts.AccountStatementAllInfo.GetUpperBound(0)) = lAccountStatementAllInfo
                                                                Else
                                                                    '#############################################################
                                                                    'DO NOT ADD TO OUTPUT/DISPLAY COLLECTION, JUST SKIP OVER IT.
                                                                    '#############################################################
                                                                End If
                                                            Next

                                                        End If

                                                        objResponse.EAICustomerStatementsResponse = filteredTransferedAccounts

                                                    Else
                                                        objResponse.EAICustomerStatementsResponse = objGetCustomerStatementsResponse
                                                    End If



                                                End If

                                            End If
                                        End If
                                    Case "icoms"
                                        If Not (objResponse Is Nothing) Then
                                            If Not (objResponse.MSAuthenticateMsExResponse Is Nothing) Then
                                                If Not (objResponse.MSAuthenticateMsExResponse.accountNumber Is Nothing) Then
                                                    Dim objGetAccountStatementsAllRequest As GetAccountStatementsAllRequestICOMS
                                                    Dim objGetAccountStatementsAllResponse As GetAccountStatementsAllResponseICOMS
                                                    Dim objHeader As New IcomsHeaderInfo

                                                    Select Case Left(objResponse.MSAuthenticateMsExResponse.accountNumber, 3)
                                                        Case "100"
                                                            objHeader.SiteId = SiteId.Site100
                                                        Case "200"
                                                            objHeader.SiteId = SiteId.Site200
                                                        Case "300"
                                                            objHeader.SiteId = SiteId.Site300
                                                        Case "400"
                                                            objHeader.SiteId = SiteId.Site400
                                                        Case "500"
                                                            objHeader.SiteId = SiteId.Site500
                                                        Case "600"
                                                            objHeader.SiteId = SiteId.Site600
                                                    End Select

                                                    Dim lstrAccountNumber As String = objResponse.MSAuthenticateMsExResponse.accountNumber.Substring(3, 9)
                                                    objGetAccountStatementsAllRequest = New GetAccountStatementsAllRequestICOMS(objHeader, lstrAccountNumber)

                                                    '########################################################################
                                                    'MAKE CALL TO THE PROVIDER WHICH IN TURN WILL CALL THE EBS WEB SERVICE
                                                    '########################################################################
                                                    objGetAccountStatementsAllResponse = CType(lEBSProvider.GetAccountsFromICOMS(objGetAccountStatementsAllRequest), GetAccountStatementsAllResponseICOMS)


                                                    objResponse.EBSGetAccountStatementsAllResponseICOMS = objGetAccountStatementsAllResponse



                                                End If
                                            End If
                                        End If
                                End Select
                            End If
                        End If
                    End If
                End If
            End If





            Return objResponse

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function

    Public Overrides Function ChangeWebSpacePassword(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New ChangeWebSpacePasswordRequest

        Dim objRequest As New WSMemberServices.UpdateWebspaceInfo

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.WSResult
        Dim objResponse As New TheCommonResponse

        Try
            If Not (obj Is Nothing) Then
                objTempRequest = CType(obj, ChangeWebSpacePasswordRequest)

                If Not (objTempRequest.accountId Is Nothing) Then
                    objRequest.accountId = objTempRequest.accountId
                End If
                If Not (objTempRequest.login Is Nothing) Then
                    objRequest.login = objTempRequest.login
                End If
                If Not (objTempRequest.password Is Nothing) Then
                    objRequest.password = objTempRequest.password
                End If
                If Not (objTempRequest.provisionId Is Nothing) Then
                    objRequest.provisionId = objTempRequest.provisionId
                End If
                If Not (objTempRequest.webspaceLogin Is Nothing) Then
                    objRequest.webspaceLogin = objTempRequest.webspaceLogin
                End If
                If Not (objTempRequest.webspacePassword Is Nothing) Then
                    objRequest.webspacePassword = objTempRequest.webspacePassword
                End If
            End If

            '########################
            'EXECUTE THE WEB SERVICE
            '########################
            objTempResponse = Me.MemberServicesWS.changeWebspacePassword(objRequest)




            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '#########################################################################################
            Return GetTheCommonResponse(objTempResponse)

        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function
    Public Overrides Function AuthenticateLoginSecretQA(ByVal obj As IProviderParameters) As IProviderResults
        '#######################################
        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New AuthenticateLoginSecretQARequest

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As New WSMemberServices.CustomerSummaryInfo
        Dim objResponse As New AuthenticateLoginSecretQAResponse


        Try
            objTempRequest = CType(obj, AuthenticateLoginSecretQARequest)

            '#################################################
            'BUILD REQUEST OBJECT FOR THE WEB SERVICE REQUEST
            '#################################################



            If Not objTempRequest Is Nothing Then
                '########################################
                'DO THE CALL TO THE WEB SERVICE
                '########################################
                objTempResponse = Me.MemberServicesWS.authenticateMsQA(objTempRequest.LoginID, objTempRequest.SecurityQuestion, objTempRequest.SecurityAnswer, objTempRequest.csrLogin, objTempRequest.csrPassword)
            End If




            ''#########################################################################################
            ''translate back to a common object in the gateway, visible from Provider and the BL both.
            ''########################################################################################

            'Return GetTheCommonResponse(objTempResponse)

            '#########################################################################################
            'translate back to a common object in the gateway, visible from Provider and the BL both.
            '########################################################################################

            If Not (objTempResponse Is Nothing) Then

                If Not (objTempResponse.accountNumber Is Nothing) Then
                    objResponse.accountNumber = objTempResponse.accountNumber
                End If

                objResponse.accountType = objTempResponse.accountType
                objResponse.address1 = objTempResponse.address1
                objResponse.address2 = objTempResponse.address2
                objResponse.city = objTempResponse.city
                'commented out, it doesn't exist on the object 
                'objResponse.company = objTempResponse.company
                objResponse.company = String.Empty
                objResponse.firstName = objTempResponse.firstName
                objResponse.lastName = objTempResponse.lastName

                objResponse.phoneNumber = objTempResponse.phoneNumber
                objResponse.StateInitials = objTempResponse.state
                objResponse.zipCode = objTempResponse.zipCode



                If Not (objTempResponse.status Is Nothing) Then
                    Select Case True
                        Case objTempResponse.status.ToUpper() = "SUCCESS"
                            objResponse.Exception = False
                        Case Else
                            '#################################
                            'ERROR CODE MAPPING SOLUTION
                            '#################################
                            Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                            objResponse.CharterDotCom_Friendly_Messages = lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objTempResponse.errorCodes, objTempResponse.errorText)
                            '#################################
                            objResponse.Exception = True
                            objResponse.ExceptionMessage = objTempResponse.errorText
                    End Select
                End If

            End If

            Return objResponse




        Catch ex As Exception
            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
            Return objResponse
        Finally

        End Try
    End Function
    '#############################################
    'SHEILA SHAHPARI 09/10/2009 
    'ADDED GETOSSAUTHSTRING IMPLEMENTATION
    '#############################################
    Public Overrides Function GetOSSAuthString(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults
        Dim objResponse As GetEncryptStringResponse = Nothing
        Try

            objResponse = OSSApiWS.GetEncryptString(CType(obj, GetEncryptStringRequest))
        Catch ex As Exception
            If objResponse Is Nothing Then
                objResponse = New GetEncryptStringResponse
            End If

            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
        End Try
        Return objResponse
    End Function
   

    Public Overrides Function GetLoginID(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) As CharterDotCom.CommonEntities.Library.IProviderResults

        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New GetLoginRequest

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As XmlDocument
        Dim objResponse As New GetLoginResponse

        Try
            objTempRequest = CType(obj, GetLoginRequest)

            '########################################
            'DO THE CALL TO THE WEB SERVICE
            '########################################
            If objTempRequest IsNot Nothing Then
                objTempResponse = OSSApiWS.GetLoginIDResponseXMLdoc(objTempRequest)
           
                If Not (objTempResponse Is Nothing) Then

                    Try
                        Dim returnListNode As XmlNodeList = objTempResponse.GetElementsByTagName("th:returnString")
                        Dim returnNode As XmlNode
                        If Not (returnListNode Is Nothing) Then
                            returnNode = objTempResponse.GetElementsByTagName("th:returnString").Item(0)



                            If Not (returnNode Is Nothing) Then
                                If returnNode.FirstChild.Value.ToString.ToUpper = "SUCCESS" Then
                                    Dim userNameListNode As XmlNodeList = objTempResponse.GetElementsByTagName("th:username")
                                    If userNameListNode.Count > 0 Then
                                        Dim userNameNode As XmlNode = objTempResponse.GetElementsByTagName("th:username").Item(0)
                                        If Not (userNameNode Is Nothing) Then
                                            objResponse.UserName = userNameNode.FirstChild.Value.ToString()
                                        End If
                                        Dim secQuestionNodeList As XmlNodeList = objTempResponse.GetElementsByTagName("th:secQuestion")
                                        'check if there is any secret question entered previously by the user
                                        If secQuestionNodeList.Count > 0 Then
                                            Dim secQuestionNode As XmlNode = objTempResponse.GetElementsByTagName("th:secQuestion").Item(0)
                                            If Not (secQuestionNode Is Nothing) Then
                                                objResponse.SecretQuestion = secQuestionNode.FirstChild.Value.ToString()
                                                Dim secAnswerNodeList As XmlNodeList = objTempResponse.GetElementsByTagName("th:secAnswer")
                                                If secAnswerNodeList.Count > 0 Then
                                                    Dim secAnswerNode As XmlNode = objTempResponse.GetElementsByTagName("th:secAnswer").Item(0)
                                                    objResponse.SecretAnswer = secAnswerNode.FirstChild.Value.ToString()
                                                End If

                                            End If
                                        End If
                                    End If


                                Else
                                    '#################################
                                    'ERROR CODE MAPPING SOLUTION
                                    '#################################
                                    objResponse.Exception = True
                                    'return string also holds any error messages thrown by OSSAPI calls
                                    objResponse.ExceptionMessage = returnNode.FirstChild.Value.ToString
                                    Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                                    objResponse.CharterDotCom_Friendly_Messages = "Sorry, we're unable to retrieve your username at this time." 'lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objresponse.errorCodes, objTempResponse.errorText)
                                    '#################################

                                End If
                            Else
                                objResponse.Exception = True
                                objResponse.ExceptionMessage = "No valid response received from web service layer"
                                objResponse.CharterDotCom_Friendly_Messages = "Sorry, we're unable to retrieve your username at this time." 'Add message here that is friendly for the user
                            End If
                        End If
                    Catch ex As Exception
                        'any XML format issues with the response should be caught by this exception
                        objResponse.Exception = True
                        objResponse.ExceptionMessage = "Unable to parse the XML doc response for GetLogin"
                        objResponse.CharterDotCom_Friendly_Messages = "Sorry, we're unable to retrieve your username at this time." 'Add message here that is friendly for the user
                    End Try


                End If
            End If


        Catch ex As Exception
            If objResponse Is Nothing Then
                objResponse = New GetLoginResponse
            End If

            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
        End Try
        Return objResponse
    End Function
   

    Public Overrides Function GetLoginIDByUserName(ByVal obj As CharterDotCom.CommonEntities.Library.IProviderParameters) _
        As CharterDotCom.CommonEntities.Library.IProviderResults

        'TEMP LOCAL VARIABLES FOR REQUEST OBJECT
        '#######################################
        Dim objTempRequest As New GetLoginRequest

        '#######################################
        'TEMP LOCAL VARIABLES FOR RESPONSE OBJECT
        '#######################################
        Dim objTempResponse As XmlDocument
        Dim objResponse As New GetLoginResponse

        Try
            objTempRequest = CType(obj, GetLoginRequest)

            '########################################
            'DO THE CALL TO THE WEB SERVICE
            '########################################
            If objTempRequest IsNot Nothing Then
                objTempResponse = OSSApiWS.GetLoginIDByUserNameResponseXMLdoc(objTempRequest)

                If Not (objTempResponse Is Nothing) Then

                    Try
                        Dim returnListNode As XmlNodeList = objTempResponse.GetElementsByTagName("th:returnString")
                        Dim returnNode As XmlNode
                        If Not (returnListNode Is Nothing) Then
                            returnNode = objTempResponse.GetElementsByTagName("th:returnString").Item(0)
                            If Not (returnNode Is Nothing) Then
                                If returnNode.FirstChild.Value.ToString.ToUpper = "SUCCESS" Then
                                    Dim userNameListNode As XmlNodeList = objTempResponse.GetElementsByTagName("th:username")
                                    If userNameListNode.Count > 0 Then
                                        Dim userNameNode As XmlNode = objTempResponse.GetElementsByTagName("th:username").Item(0)
                                        If Not (userNameNode Is Nothing) Then
                                            objResponse.UserName = userNameNode.FirstChild.Value.ToString()
                                        End If
                                        Dim secQuestionNodeList As XmlNodeList = objTempResponse.GetElementsByTagName("th:secQuestion")
                                        'check if there is any secret question entered previously by the user
                                        If secQuestionNodeList.Count > 0 Then
                                            Dim secQuestionNode As XmlNode = objTempResponse.GetElementsByTagName("th:secQuestion").Item(0)
                                            If Not (secQuestionNode Is Nothing) Then
                                                objResponse.SecretQuestion = secQuestionNode.FirstChild.Value.ToString()
                                                Dim secAnswerNodeList As XmlNodeList = objTempResponse.GetElementsByTagName("th:secAnswer")
                                                If secAnswerNodeList.Count > 0 Then
                                                    Dim secAnswerNode As XmlNode = objTempResponse.GetElementsByTagName("th:secAnswer").Item(0)
                                                    objResponse.SecretAnswer = secAnswerNode.FirstChild.Value.ToString()
                                                End If

                                            End If
                                        End If
                                    End If
                                Else
                                    '#################################
                                    'ERROR CODE MAPPING SOLUTION
                                    '#################################
                                    objResponse.Exception = True
                                    'return string also holds any error messages thrown by OSSAPI calls
                                    objResponse.ExceptionMessage = returnNode.FirstChild.Value.ToString
                                    Dim lErrorMappingProvider As New ErrorMappingProvider.ProviderManager
                                    objResponse.CharterDotCom_Friendly_Messages = "Sorry, we're unable to retrieve your username at this time." 'lErrorMappingProvider.GetErrorMessageList("MEMBERSERVICES", objresponse.errorCodes, objTempResponse.errorText)
                                    '#################################

                                End If
                            Else
                                objResponse.Exception = True
                                objResponse.ExceptionMessage = "No valid response received from web service layer"
                                objResponse.CharterDotCom_Friendly_Messages = "Sorry, we're unable to retrieve your username at this time." 'Add message here that is friendly for the user
                            End If
                        End If
                    Catch ex As Exception
                        'any XML format issues with the response should be caught by this exception
                        objResponse.Exception = True
                        objResponse.ExceptionMessage = "Unable to parse the XML doc response for GetLogin"
                        objResponse.CharterDotCom_Friendly_Messages = "Sorry, we're unable to retrieve your username at this time." 'Add message here that is friendly for the user
                    End Try
                End If
            End If

        Catch ex As Exception
            If objResponse Is Nothing Then
                objResponse = New GetLoginResponse
            End If

            objResponse.Exception = True
            objResponse.ExceptionMessage = ex.Message
            objResponse.ExceptionStackTrace = ex.StackTrace
        End Try
        Return objResponse
    End Function
End Class