Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports System.Collections.Generic
Imports CommonBLEntities


<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service
     Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function HelloWorld() As String
        Return "Hello World"
    End Function

    <WebMethod()> _
    Public Function GetWebConfig(ByVal ConfigLocation As String) As Data.DataSet
        Dim strSQL As String = "SELECT [ID],[Key],XMLdata FROM SessionState.WebConfig WHERE CONFIGLOCATION = '" & ConfigLocation & "'"
        Dim DB As Sql.SqlDatabase = DatabaseFactory.CreateDatabase("Charter.Website.WS.CommerceEngineConnectionString")
        Dim CMD As Data.Common.DbCommand = DB.GetSqlStringCommand(strSQL)

        Dim retCode As Data.DataSet = DB.ExecuteDataSet(CMD)

        'Dim outList As New ArrayList
        'Dim outResponse As New BLWebConfigSettingsCollection


        'If Not retCode Is Nothing Then
        '    If retCode.Tables.Count = 1 Then
        '        outResponse.WebConfigSetting = New List(Of IWebConfigSetting)
        '        For Each objConfigSetting As Data.DataRow In retCode.Tables(0).Rows
        '            Dim lWebConfigSetting As New BLWebConfigSetting
        '            lWebConfigSetting.ID = objConfigSetting.Item("ID")
        '            lWebConfigSetting.key = objConfigSetting.Item("key")
        '            lWebConfigSetting.XMLData = objConfigSetting.Item("XMLData")

        '            outResponse.WebConfigSetting.Add(lWebConfigSetting)
        '        Next
        '    End If
        'End If

        'Return outResponse


        'If Not retCode Is Nothing Then
        '    If retCode.Tables.Count = 1 Then
        '        For Each row As Data.DataRow In retCode.Tables(0).Rows
        '            Dim outRow As New ArrayList
        '            outRow.Add(row.Item("ID"))
        '            outRow.Add(row.Item("Key"))
        '            outRow.Add(row.Item("XMLData"))

        '            outList.Add(outRow)
        '        Next
        '    End If
        'End If

        'Return outList

        Return retCode

    End Function




End Class
