Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

xanburzum

Enviando SMS com ASPSMS

Recommended Posts

Enviando SMS com ASPSMS

 

aspsms_xml_vbscript_class

<%
'aspsms_xml.asp


Class ASPSMS_XML
 

    '--- Private Member Variables --------------------------

    Private m_nRandomNumber

    Private m_sXmlInterfaceUrl

    Private m_sXmlLog

    Private m_nErrorCode
    Private m_sErrorDescription

    Private m_sPasswordFileLocation
    Private m_sUserkey
    Private m_sPassword

    Private m_sPhoneNumber
    Private m_sXmlRecipients
    Private m_sXmlTransRefNumbers

    Private m_sOriginator

    Private m_bFlashingSMS
    Private m_bBlinkingSMS
    Private m_nReplaceMessage

    Private m_sXser
    Private m_sMessageData

    Private m_nMCC
    Private m_nMNC

    Private m_sURLBinaryFile

    Private m_sVCardName
    Private m_sVCardPhoneNumber

    Private m_sTimeZone
    Private m_sDeferredDeliveryTime

    Private m_nLifeTime

    Private m_sURLBufferedMessageNotification
    Private m_sURLDeliveryNotification
    Private m_sURLNonDeliveryNotification

    Private m_nNotificationInquirySettingsFormat
    Private m_sNotificationInquirySettingsSeparator

    Private m_sWAPPushDescription
    Private m_sWAPPushURL

    Private oXmlDocRequest
    Private oXmlDocResponse
    Private oXmlHttp

    '--- Event Handlers ------------------------------------

    Private Sub Class_Initialize()


        Randomize
        m_nRandomNumber = Int(Rnd()*2)+1

        If m_nRandomNumber/2 = Int(m_nRandomNumber/2) Then
            m_sXmlInterfaceUrl  = "http://xml1.aspsms.com:5061/xmlsvr.asp"
        Else
            m_sXmlInterfaceUrl  = "http://xml2.aspsms.com:5061/xmlsvr.asp"
        End If

        m_sXmlLog = m_sXmlLog & vbCr & m_sXmlInterfaceUrl & vbCr

        'cria  XML objects
        Set oXmlDocRequest  = CreateObject("MSXML2.DOMDocument")
        Set oXmlHttp        = CreateObject("MSXML2.XMLHTTP")
        Set oXmlDocResponse = CreateObject("MSXML2.DOMDocument")

    End Sub

    Private Sub Class_Terminate()


        'destroi objectos XML 
        Set oXmlDocResponse = Nothing
        Set oXmlHttp        = Nothing
        Set oXmlDocRequest  = Nothing

    End Sub




    Public Property Let PasswordFileLocation(sPasswordFileLocation)
        m_sPasswordFileLocation = sPasswordFileLocation
    End Property

    Public Property Let Userkey(sUserkey)
        m_sUserkey = sUserkey
    End Property

    Public Property Let Password(sPassword)
        m_sPassword = sPassword
    End Property

    Public Property Let Originator(sOriginator)
        m_sOriginator = sOriginator
    End Property

    Public Property Let FlashingSMS(bFlashingSMS)
        m_bFlashingSMS = bFlashingSMS
    End Property

    Public Property Let BlinkingSMS(bBlinkingSMS)
        m_bBlinkingSMS = bBlinkingSMS
    End Property

    Public Property Let ReplaceMessage(nReplaceMessage)
        m_nReplaceMessage = nReplaceMessage
    End Property

    Public Property Let MCC(nMCC)
        m_nMCC = nMCC
    End Property

    Public Property Let MNC(nMNC)
        m_nMNC = nMNC
    End Property

    Public Property Let URLBinaryFile(sURLBinaryFile)
        m_sURLBinaryFile = sURLBinaryFile
    End Property

    Public Property Let VCardName(sVCardName)
        m_sVCardName = sVCardName
    End Property

    Public Property Let VCardPhoneNumber(sVCardPhoneNumber)
        m_sVCardPhoneNumber = sVCardPhoneNumber
    End Property

    Public Property Let XSer(sXSer)
        m_sXSer = sXSer
    End Property

    Public Property Let MessageData(sMessageData)
        m_sMessageData = sMessageData
    End Property

    Public Property Let TimeZone(sTimeZone)
        m_sTimeZone = sTimeZone
    End Property

    Public Property Let DeferredDeliveryTime(sDeferredDeliveryTime)
        m_sDeferredDeliveryTime = sDeferredDeliveryTime
    End Property

    Public Property Let LifeTime(nLifeTime)
        m_nLifeTime = nLifeTime
    End Property

    Public Property Let URLBufferedMessageNotification(sURLBufferedMessageNotification)
        m_sURLBufferedMessageNotification = sURLBufferedMessageNotification
    End Property

    Public Property Let URLDeliveryNotification(sURLDeliveryNotification)
        m_sURLDeliveryNotification = sURLDeliveryNotification
    End Property

    Public Property Let URLNonDeliveryNotification(sURLNonDeliveryNotification)
        m_sURLNonDeliveryNotification = sURLNonDeliveryNotification
    End Property

    Public Property Let NotificationInquirySettingsFormat(nNotificationInquirySettingsFormat)
        m_nNotificationInquirySettingsFormat = nNotificationInquirySettingsFormat
    End Property

    Public Property Let NotificationInquirySettingsSeparator(sNotificationInquirySettingsSeparator)
        m_sNotificationInquirySettingsSeparator = sNotificationInquirySettingsSeparator
    End Property

    Public Property Let WAPPushDescription(sWAPPushDescription)
        m_sWAPPushDescription = sWAPPushDescription
    End Property

    Public Property Let WAPPushURL(sWAPPushURL)
        m_sWAPPushURL = sWAPPushURL
    End Property


    '--- Propriedade Gets -------------------------------------

    Public Property Get XmlLog()
         XmlLog = m_sXmlLog
    End Property

    Public Property Get ErrorCode()
         ErrorCode = m_nErrorCode
    End Property

    Public Property Get ErrorDescription()
         ErrorDescription = m_sErrorDescription
    End Property

    '---  Metodos Private-----------------------------------

    Private Function isoEncode(sString)
      

        Dim i
        Dim sChar

        For i = 1 To Len(sString)

            sChar = Mid(sString, i, 1)

            Select Case True

                'caracteres devem ser codificados
                '&, <, >, chr(128)-chr(255)
                Case Asc(sChar) = 38 OR _
                     Asc(sChar) = 60 OR _
                     Asc(sChar) = 62 OR _
                     (Asc(sChar) >= 128 AND Asc(sChar) <= 255)
                isoEncode = isoEncode & "" & Asc(sChar) & ";"

                'caracteres não deve ser codificado
                Case Else
                isoEncode = isoEncode & sChar

            End Select

        Next 'i

    End Function

    Private Sub talkToXmlInterfaceForSend(byVal sXml)
   

        Dim sResponseXml

        oXmlDocRequest.SetProperty "ServerHTTPRequest", False
        oXmlDocRequest.Async = False
        oXmlDocRequest.LoadXML(sXml)

        If oXmlDocRequest.ParseError = 0 Then
            oXmlHttp.Open "POST", m_sXmlInterfaceUrl, False
            oXmlHttp.Send oXmlDocRequest.xml
            sResponseXml = oXmlHttp.ResponseXML.xml

            m_sXmlLog = m_sXmlLog & vbCr & sResponseXml & vbCr

            oXmlDocResponse.setProperty "ServerHTTPRequest", True
            oXmlDocResponse.async = False
            oXmlDocResponse.LoadXML sResponseXml

            m_nErrorCode = CInt(oXmlDocResponse.getElementsByTagName("ErrorCode").item(0).text)
            m_sErrorDescription = oXmlDocResponse.getElementsByTagName("ErrorDescription").item(0).text

        Else
            m_nErrorCode = 99
            m_sErrorDescription = "XML ParseError"
        End If

    End Sub


    Private Function setTimeZoneDeferredDeliveryTime()

        If m_sTimeZone <> "" Then
            setTimeZoneDeferredDeliveryTime = setTimeZoneDeferredDeliveryTime & "  <TimeZone>" & m_sTimeZone & "</TimeZone>" & vbCr
        End If
        If m_sDeferredDeliveryTime <> "" Then
            setTimeZoneDeferredDeliveryTime = setTimeZoneDeferredDeliveryTime & "  <DeferredDeliveryTime>" & m_sDeferredDeliveryTime & "</DeferredDeliveryTime>" & vbCr
        End If
    End Function

    Private Function setLifeTime()

        If m_nLifeTime <> "" Then
            setLifeTime = setLifeTime & "  <LifeTime>" & m_nLifeTime & "</LifeTime>" & vbCr
        End If
    End Function


    Private Function setNotificationURLs()
     
        If m_sURLBufferedMessageNotification <> "" Then
            setNotificationURLs = setNotificationURLs & "  <URLBufferedMessageNotification>" & isoEncode(m_sURLBufferedMessageNotification) & "</URLBufferedMessageNotification>" & vbCr
        End If
        If m_sURLDeliveryNotification <> "" Then
            setNotificationURLs = setNotificationURLs & "  <URLDeliveryNotification>" & isoEncode(m_sURLDeliveryNotification) & "</URLDeliveryNotification>" & vbCr
        End If
        If m_sURLNonDeliveryNotification <> "" Then
            setNotificationURLs = setNotificationURLs & "  <URLNonDeliveryNotification>" & isoEncode(m_sURLNonDeliveryNotification) & "</URLNonDeliveryNotification>" & vbCr
        End If
    End Function


    Private Function setUserkeyPassword()


        Dim sMyUserkey
        Dim sMyPassword

        Dim oFs
        Dim oF
        Dim sLine
        Dim sLineArray

        If m_sPasswordFileLocation <> "" Then
            Set oFs = Server.CreateObject("Scripting.FileSystemObject")
                If oFs.FileExists(m_sPasswordFileLocation) Then
                    Set oF = oFs.OpenTextFile(m_sPasswordFileLocation, 1)

                        '1. linha (Userkey = XXXXXXXXXXXX)
                        sLine = oF.ReadLine
                        sLineArray = Split(sLine, "=")
                        sMyUserkey = Trim(sLineArray(1))

                        '2. Linha (Password = XXXXXX)
                        sLine = oF.ReadLine
                        sLineArray = Split(sLine, "=")
                        sMyPassword = Trim(sLineArray(1))

                        oF.Close
                    Set oF = Nothing
                End If
            Set oFs = Nothing
        Else
            sMyUserkey  = m_sUserkey
            sMyPassword = m_sPassword
        End If

        setUserkeyPassword = setUserkeyPassword & "  <Userkey>" & isoEncode(sMyUserkey) & "</Userkey>" & vbCr
        setUserkeyPassword = setUserkeyPassword & "  <Password>" & isoEncode(sMyPassword) & "</Password>" & vbCr

    End Function


    '--- Métodos públicos ------------------------------------

    Public Sub AddRecipient(byVal sPhoneNumber, byVal sTransRefNumber)
        '2004 by aspsms.com
        m_sXmlRecipients = m_sXmlRecipients & "  <Recipient>" & vbCr
        m_sXmlRecipients = m_sXmlRecipients & "    <PhoneNumber>" & sPhoneNumber & "</PhoneNumber>" & vbCr
        m_sXmlRecipients = m_sXmlRecipients & "    <TransRefNumber>" & sTransRefNumber & "</TransRefNumber>" & vbCr
        m_sXmlRecipients = m_sXmlRecipients & "  </Recipient>" & vbCr
    End Sub

    Public Sub DeleteAllRecipients()
        m_sXmlRecipients = ""
    End Sub

    Public Sub AddTransRefNumberForNotificationInquiry(byVal sTransRefNumber)
   
        m_sXmlTransRefNumbers = m_sXmlTransRefNumbers & "  <TransRefNumber>" & isoEncode(sTransRefNumber) & "</TransRefNumber>" & vbCr
    End Sub


    Public Sub SendTextMessage()


        Dim sXml

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & m_sXmlRecipients
        sXml = sXml & "  <Originator>" & m_sOriginator & "</Originator>" & vbCr
        If bFlashingSMS Then
            sXml = sXml & "  <FlashingSMS>1</FlashingSMS>" & vbCr
        End If
        If bBlinkingSMS Then
            sXml = sXml & "  <BlinkingSMS>1</BlinkingSMS>" & vbCr
        End If
        If m_nReplaceMessage <> "" Then
            sXml = sXml & "  <ReplaceMessage>" & m_nReplaceMessage & "</ReplaceMessage>" & vbCr
        End If


        sXml = sXml & "  <MessageData><![CDATA[" & m_sMessageData & "]]></MessageData>" & vbCr
        'sXml = sXml & "  <MessageData>" & isoEncode(m_sMessageData) & "</MessageData>" & vbCr
        'sXml = sXml & "  <MessageData>" & m_sMessageData & "</MessageData>" & vbCr


        sXml = sXml & setTimeZoneDeferredDeliveryTime()
        sXml = sXml & setLifeTime()
        sXml = sXml & setNotificationURLs()
        sXml = sXml & "  <Action>SendTextSMS</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        Call talkToXmlInterfaceForSend(sXml)
    End Sub


    Public Sub SendRandomLogo()
 
 

        Dim sXml

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & m_sXmlRecipients
        sXml = sXml & "  <Originator>" & m_sOriginator & "</Originator>" & vbCr
        sXml = sXml & setTimeZoneDeferredDeliveryTime()
        sXml = sXml & setLifeTime()
        sXml = sXml & setNotificationURLs()
        sXml = sXml & "  <Action>SendRandomLogo</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        Call talkToXmlInterfaceForSend(sXml)
    End Sub


    Public Sub SendLogo()
  
  

        Dim sXml

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & m_sXmlRecipients
        sXml = sXml & "  <Originator>" & m_sOriginator & "</Originator>" & vbCr
        sXml = sXml & "  <URLBinaryFile>" & isoEncode(m_sURLBinaryFile) & "</URLBinaryFile>" & vbCr
        sXml = sXml & setTimeZoneDeferredDeliveryTime()
        sXml = sXml & setLifeTime()
        sXml = sXml & setNotificationURLs()
        sXml = sXml & "  <Action>SendLogo</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        Call talkToXmlInterfaceForSend(sXml)
    End Sub

    Public Sub SendGroupLogo()
        '2005 by aspsms.com

        Dim sXml

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & m_sXmlRecipients
        sXml = sXml & "  <Originator>" & m_sOriginator & "</Originator>" & vbCr
        sXml = sXml & "  <URLBinaryFile>" & isoEncode(m_sURLBinaryFile) & "</URLBinaryFile>" & vbCr
        sXml = sXml & setTimeZoneDeferredDeliveryTime()
        sXml = sXml & setLifeTime()
        sXml = sXml & setNotificationURLs()
        sXml = sXml & "  <Action>SendGroupLogo</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        Call talkToXmlInterfaceForSend(sXml)
    End Sub

    Public Sub SendPictureMessage()



        Dim sXml

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & m_sXmlRecipients
        sXml = sXml & "  <Originator>" & m_sOriginator & "</Originator>" & vbCr
        sXml = sXml & "  <URLBinaryFile>" & isoEncode(m_sURLBinaryFile) & "</URLBinaryFile>" & vbCr
        sXml = sXml & setTimeZoneDeferredDeliveryTime()
        sXml = sXml & setLifeTime()
        sXml = sXml & setNotificationURLs()
        sXml = sXml & "  <Action>SendPictureMessage</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        Call talkToXmlInterfaceForSend(sXml)
    End Sub


    Public Sub SendRingtone()

        Dim sXml

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & m_sXmlRecipients
        sXml = sXml & "  <Originator>" & m_sOriginator & "</Originator>" & vbCr
        sXml = sXml & "  <URLBinaryFile>" & isoEncode(m_sURLBinaryFile) & "</URLBinaryFile>" & vbCr
        sXml = sXml & setTimeZoneDeferredDeliveryTime()
        sXml = sXml & setLifeTime()
        sXml = sXml & setNotificationURLs()
        sXml = sXml & "  <Action>SendRingtone</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        Call talkToXmlInterfaceForSend(sXml)
    End Sub

    Public Sub SendVCard()


        Dim sXml

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & m_sXmlRecipients
        sXml = sXml & "  <Originator>" & m_sOriginator & "</Originator>" & vbCr
        sXml = sXml & "  <VCard>" & vbCr
        sXml = sXml & "    <VName>" & isoEncode(m_sVCardName) & "</VName>" & vbCr
        sXml = sXml & "    <VPhoneNumber>" & isoEncode(m_sVCardPhoneNumber) & "</VPhoneNumber>" & vbCr
        sXml = sXml & "  </VCard>" & vbCr
        sXml = sXml & setTimeZoneDeferredDeliveryTime()
        sXml = sXml & setLifeTime()
        sXml = sXml & setNotificationURLs()
        sXml = sXml & "  <Action>SendVCard</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        Call talkToXmlInterfaceForSend(sXml)
    End Sub


    Public Sub SendBinaryData()


        Dim sXml

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & m_sXmlRecipients
        sXml = sXml & "  <Originator>" & m_sOriginator & "</Originator>" & vbCr
        sXml = sXml & "  <XSer>" & isoEncode(m_sXSer) & "</XSer>" & vbCr
        sXml = sXml & "  <MessageData>" & isoEncode(m_sMessageData) & "</MessageData>" & vbCr
        sXml = sXml & setTimeZoneDeferredDeliveryTime()
        sXml = sXml & setLifeTime()
        sXml = sXml & setNotificationURLs()
        sXml = sXml & "  <Action>SendBinaryData</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        Call talkToXmlInterfaceForSend(sXml)
    End Sub


    Public Function InquireDeliveryNotifications()
 
        Dim sXml
        Dim sResponseXml

        Dim oDeliveryNotifications
        Dim oDeliveryNotification

        Dim sTransRefNumber
        Dim nDeliveryStatus
        Dim sSubmissionDate
        Dim sNotification
        Dim sReasonCode

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & m_sXmlTransRefNumbers
        sXml = sXml & "  <Action>InquireDeliveryNotifications</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        oXmlDocRequest.SetProperty "ServerHTTPRequest", False
        oXmlDocRequest.Async = False
        oXmlDocRequest.LoadXML(sXml)

        If oXmlDocRequest.ParseError = 0 Then
            oXmlHttp.Open "POST", m_sXmlInterfaceUrl, False
            oXmlHttp.Send oXmlDocRequest.xml
            sResponseXml = oXmlHttp.ResponseXML.xml

            m_sXmlLog = m_sXmlLog & vbCr & sResponseXml & vbCr

            oXmlDocResponse.setProperty "ServerHTTPRequest", True
            oXmlDocResponse.async = False
            oXmlDocResponse.LoadXML sResponseXml

            m_nErrorCode = CInt(oXmlDocResponse.getElementsByTagName("ErrorCode").item(0).text)
            m_sErrorDescription = oXmlDocResponse.getElementsByTagName("ErrorDescription").item(0).text

            If m_nErrorCode = 1 Then
                Set oDeliveryNotifications = oXmlDocResponse.getElementsByTagName("aspsms/DeliveryNotification")

                    For Each oDeliveryNotification In oDeliveryNotifications

                        sTransRefNumber = oDeliveryNotification.childNodes(0).text
                        nDeliveryStatus = oDeliveryNotification.childNodes(1).text
                        sSubmissionDate = oDeliveryNotification.childNodes(2).text
                        sNotification   = oDeliveryNotification.childNodes(3).text
                        sReasonCode     = oDeliveryNotification.childNodes(4).text

                        Select Case m_nNotificationInquirySettingsFormat

                            Case 1
                            InquireDeliveryNotifications = InquireDeliveryNotifications & sTransRefNumber & m_sNotificationInquirySettingsSeparator & _
                                                           nDeliveryStatus & m_sNotificationInquirySettingsSeparator & _
                                                           sSubmissionDate & m_sNotificationInquirySettingsSeparator & _
                                                           sNotification   & m_sNotificationInquirySettingsSeparator & _
                                                           sReasonCode     & m_sNotificationInquirySettingsSeparator

                            Case 2
                            InquireDeliveryNotifications = InquireDeliveryNotifications & sTransRefNumber & m_sNotificationInquirySettingsSeparator & _
                                                           nDeliveryStatus & vbCrLf

                            Case 3
                            InquireDeliveryNotifications = InquireDeliveryNotifications & sTransRefNumber & m_sNotificationInquirySettingsSeparator & _
                                                           nDeliveryStatus & m_sNotificationInquirySettingsSeparator

                            Case Else '0 = Default
                            InquireDeliveryNotifications = InquireDeliveryNotifications & sTransRefNumber & m_sNotificationInquirySettingsSeparator & _
                                                           nDeliveryStatus & m_sNotificationInquirySettingsSeparator & _
                                                           sSubmissionDate & m_sNotificationInquirySettingsSeparator & _
                                                           sNotification   & m_sNotificationInquirySettingsSeparator & _
                                                           sReasonCode     & vbCrLf

                        End Select

                    Next

                Set oDeliveryNotifications = Nothing
            End If

        Else
            m_nErrorCode = 99
            m_sErrorDescription = "XML ParseError"
        End If

    End Function


    Public Function Credits()


        Dim sXml
        Dim sResponseXml

        Dim oFilesystem
        Dim oFile

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & "  <Action>ShowCredits</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        oXmlDocRequest.SetProperty "ServerHTTPRequest", False
        oXmlDocRequest.Async = False
        oXmlDocRequest.LoadXML(sXml)

        If oXmlDocRequest.ParseError = 0 Then
            oXmlHttp.Open "POST", m_sXmlInterfaceUrl, False
            oXmlHttp.Send oXmlDocRequest.xml
            sResponseXml = oXmlHttp.ResponseXML.xml

            m_sXmlLog = m_sXmlLog & vbCr & sResponseXml & vbCr

            oXmlDocResponse.setProperty "ServerHTTPRequest", True
            oXmlDocResponse.async = False
            oXmlDocResponse.LoadXML sResponseXml

            m_nErrorCode = CInt(oXmlDocResponse.getElementsByTagName("ErrorCode").item(0).text)
            m_sErrorDescription = oXmlDocResponse.getElementsByTagName("ErrorDescription").item(0).text

            If m_nErrorCode = "1" Then
                Credits = oXmlDocResponse.getElementsByTagName("Credits").item(0).text
            End If

        Else
            m_nErrorCode = 99
            m_sErrorDescription = "XML ParseError"
        End If

    End Function

    Public Sub SendWAPPushSMS()

        Dim sXml

               'sXml = "<?xml version=""1.0""?>" & vbCr
               sXml = "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCr
        sXml = sXml & "<aspsms>" & vbCr
        sXml = sXml & setUserkeyPassword()
        sXml = sXml & m_sXmlRecipients
        sXml = sXml & "  <Originator>" & m_sOriginator & "</Originator>" & vbCr
        sXml = sXml & "  <WAPPushDescription>" & isoEncode(m_sWAPPushDescription) & "</WAPPushDescription>" & vbCr
        sXml = sXml & "  <WAPPushURL>" & isoEncode(m_sWAPPushURL) & "</WAPPushURL>" & vbCr
        sXml = sXml & setTimeZoneDeferredDeliveryTime()
        sXml = sXml & setLifeTime()
        sXml = sXml & setNotificationURLs()
        sXml = sXml & "  <Action>SendWAPPushSMS</Action>" & vbCr
        sXml = sXml & "</aspsms>"

        m_sXmlLog = m_sXmlLog & sXml & vbCr

        Call talkToXmlInterfaceForSend(sXml)
    End Sub



End Class
%>

home.asp

<%
Option Explicit


%>
<!--#include file="aspsms_xml_vbscript_class.asp"-->
<%

declarar variáveis
'-------------------------------------------------------

Dim bLogXml

Dim sPasswordFileLocation
Dim sUserkey
Dim sPassword

Dim sRecipient
Dim sTransRefNumber

Dim nNotificationInquirySettingsFormat
Dim sNotificationInquirySettingsSeparator

Dim sOriginator

Dim bFlashingSMS
Dim bBlinkingSMS
Dim nReplaceMessage

Dim sMessageData

Dim nMCC
Dim nMNC
Dim sURLBinaryFileLogo
Dim sURLBinaryFilePictureMessage
Dim sURLBinaryFileRingtone

Dim sVCardName
Dim sVCardPhoneNumber

Dim sXSer
Dim sMessageDataBinHex

Dim nTimeZone
Dim sDeferredDeliveryTime
Dim nLifeTime 

Dim sURLBufferedMessageNotification
Dim sURLDeliveryNotification
Dim sURLNonDeliveryNotification

Dim sWAPPushDescription
Dim sWAPPushURL

Dim SMS
Dim rCredits
Dim sNotifications

'procedures
'-------------------------------------------------------
Function RequestDefault(byVal sKey, byVal aDefaultValue)

    If Request(sKey) <> "" Then
        RequestDefault = Request(sKey)
    Else
        RequestDefault = aDefaultValue
    End If
End Function


'obtêm valores de forma ou padrão
'-------------------------------------------------------
bLogXml                               = RequestDefault("LogXml", Null)
sPasswordFileLocation                 = RequestDefault("PasswordFileLocation", "")
sUserkey                              = RequestDefault("Userkey", "")
sPassword                             = RequestDefault("Password", "")

sRecipient                            = RequestDefault("Recipient", "")
sTransRefNumber                       = RequestDefault("TransRefNumber", Timer)

nNotificationInquirySettingsFormat    = RequestDefault("NotificationInquirySettingsFormat", 0)
sNotificationInquirySettingsSeparator = RequestDefault("NotificationInquirySettingsSeparator", "|")

sOriginator                           = RequestDefault("Originator", "1234")

bFlashingSMS                          = RequestDefault("FlashingSMS", "False")
bBlinkingSMS                          = RequestDefault("BlinkingSMS", "False")
nReplaceMessage                       = RequestDefault("ReplaceMessage", "")

sMessageData                          = RequestDefault("MessageData", "TEST MESSAGE")
'sMessageData = "vbCr" & vbCr & "vbCr" & vbCr & "vbCrLf" & vbCrLf & "vbCrLf" & vbCrLf

nMCC                                  = RequestDefault("MCC", "228")
nMNC                                  = RequestDefault("MNC", "2")
sURLBinaryFileLogo                    = RequestDefault("URLBinaryFileLogo", "http://www.aspsms.com/0003.bmp")

sURLBinaryFilePictureMessage          = RequestDefault("URLBinaryFilePictureMessage", "http://www.aspsms.com/PicMessage.bmp")

sURLBinaryFileRingtone                = RequestDefault("URLBinaryFileRingtone", "http://www.aspsms.com/Barbie.ott")

sVCardName                            = RequestDefault("VCardName", "")
sVCardPhoneNumber                     = RequestDefault("CardPhoneNumber", "")

sXSer                                 = RequestDefault("XSer", "01070605040B8423F00201F5")
sMessageDataBinHex                    = RequestDefault("MessageDataBinHex", "090601AE02056A0045C60D03617370736D732E636F6D2F696D672F6D6D732D73616D706C652E6769660001035469746C6520666F722061205741502D5075736820534D53000101")

nTimeZone                             = RequestDefault("TimeZone", "")
sDeferredDeliveryTime                 = RequestDefault("DeferredDeliveryTime", "")
nLifeTime                             = RequestDefault("LifeTime", "")
sURLBufferedMessageNotification       = RequestDefault("URLBufferedMessageNotification", "")
sURLDeliveryNotification              = RequestDefault("URLDeliveryNotification", "")
sURLNonDeliveryNotification           = RequestDefault("URLNonDeliveryNotification", "")

sWAPPushDescription                   = RequestDefault("WAPPushDescription", "")
sWAPPushURL                           = RequestDefault("WAPPushURL", "")

'html
'-------------------------------------------------------
%>
<html>
<head>
<style type="text/css">

	td {
		font-family: "Courier New", Courier, monospace;
		font-size: 8pt;
    }

    .formInputText {
		font-family: "Courier New", Courier, monospace;
		font-size: 8pt;
	}

	.formInputTextNarrow {
		width: 20px;
		font-family: "Courier New", Courier, monospace;
		font-size: 8pt;
	}

	.formInputTextWide {
		width: 700px;
		font-family: "Courier New", Courier, monospace;
		font-size: 8pt;
	}

	.formInputSubmit {
		width: 220px;
		font-family: "Courier New", Courier, monospace;
		font-size: 8pt;
	}
</style>
</head>

<body>

<h1><a href="home.asp">aspsms_xml_vbscript_class</a></h1>

<table>
<form action="home.asp" method="post">

  <tr>
    <td>
LogXml:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="LogXml" value="<%=bLogXml%>"> (True/False)<br>
    </td>
  </tr>

<!--

  <tr>
    <td>
PasswordFileLocation:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="PasswordFileLocation" value="<%=sPasswordFileLocation%>"> (Local Path i.E. C:\credentials.txt)<br>
    </td>
  </tr>

-->

  <tr>
    <td>
Userkey:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="Userkey" value="<%=sUserkey%>"><br>
    </td>
  </tr>

  <tr>
    <td>
Password:<br>
    </td>
    <td>
<input class=formInputText type="Password" name="Password" value="<%=sPassword%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
Recipiente:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="Recipient" value="<%=sRecipient%>"><br>
    </td>
  </tr>

  <tr>
    <td>
TransRefNumber:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="TransRefNumber" value="<%=sTransRefNumber%>"><br>
    </td>
  </tr>

  <tr>
    <td>
NotificationInquirySettingsFormat:<br>
    </td>
    <td>
<input class=formInputTextNarrow type="Text" name="NotificationInquirySettingsFormat" value="<%=nNotificationInquirySettingsFormat%>"><br>
    </td>
  </tr>

  <tr>
    <td>
NotificationInquirySettingsSeparator:<br>
    </td>
    <td>
<input class=formInputTextNarrow type="Text" name="NotificationInquirySettingsSeparator" value="<%=sNotificationInquirySettingsSeparator%>"><br>
    </td>
  </tr>

  <tr>
    <td>
Originator:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="Originator" value="<%=sOriginator%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
FlashingSMS:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="FlashingSMS" value="<%=bFlashingSMS%>"><br>
    </td>
  </tr>

  <tr>
    <td>
BlinkingSMS:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="BlinkingSMS" value="<%=bBlinkingSMS%>"><br>
    </td>
  </tr>

  <tr>
    <td>
ReplaceMessage:<br>
    </td>
    <td>
<input class=formInputTextNarrow type="Text" name="ReplaceMessage" value="<%=nReplaceMessage%>">(1-7)<br>
    </td>
  </tr>

  <tr>
    <td>
MessageData:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="MessageData" value="<%=sMessageData%>"><br>
(plain text/binhex)<br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
MCC:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="MCC" value="<%=nMCC%>"><br>
    </td>
  </tr>

  <tr>
    <td>
MNC:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="MNC" value="<%=nMNC%>"><br>
    </td>
  </tr>

  <tr>
    <td>
URLBinaryFileLogo/GroupLogo:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="URLBinaryFileLogo" value="<%=sURLBinaryFileLogo%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
URLBinaryFilePictureMessage:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="URLBinaryFilePictureMessage" value="<%=sURLBinaryFilePictureMessage%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
URLBinaryFileRingtone:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="URLBinaryFileRingtone" value="<%=sURLBinaryFileRingtone%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
VCardName:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="VCardName" value="<%=sVCardName%>"><br>
    </td>
  </tr>

  <tr>
    <td>
VCardPhoneNumber:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="VCardPhoneNumber" value="<%=sVCardPhoneNumber%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>
  
  <tr>
    <td>
XSer:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="XSer" value="<%=sXSer%>"><br>
    </td>
  </tr>

  <tr>
    <td>
MessageData (BinHex):<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="MessageDataBinHex" value="<%=sMessageDataBinHex%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
TimeZone:<br>
    </td>
    <td>
<input class=formInputTextNarrow type="Text" name="TimeZone" value="<%=nTimeZone%>"><br>
    </td>
  </tr>

  <tr>
    <td>
DeferredDeliveryTime:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="DeferredDeliveryTime" value="<%=sDeferredDeliveryTime%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
LifeTime:<br>
    </td>
    <td>
<input class=formInputText type="Text" name="LifeTime" value="<%=nLifeTime%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
URLBufferedMessageNotification:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="URLBufferedMessageNotification" value="<%=sURLBufferedMessageNotification%>"><br>
    </td>
  </tr>

  <tr>
    <td>
URLDeliveryNotification:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="URLDeliveryNotification" value="<%=sURLDeliveryNotification%>"><br>
    </td>
  </tr>

  <tr>
    <td>
URLNonDeliveryNotification:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="URLNonDeliveryNotification" value="<%=sURLNonDeliveryNotification%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
WAPPushDescription:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="WAPPushDescription" value="<%=sWAPPushDescription%>"><br>
    </td>
  </tr>

  <tr>
    <td>
WAPPushURL:<br>
    </td>
    <td>
<input class=formInputTextWide type="Text" name="WAPPushURL" value="<%=sWAPPushURL%>"><br>
    </td>
  </tr>

  <tr><td colspan="2"><hr size="1"></td></tr>

  <tr>
    <td>
 <br>
    </td>
    <td>
<input class=formInputSubmit type="Submit" name="action" value="SendTextSMS"> <input class=formInputSubmit type="Submit" name="action" value="InquireDeliveryNotifications"><br>
<input class=formInputSubmit type="Submit" name="action" value="SendRandomLogo"> <input class=formInputSubmit type="Submit" name="action" value="ShowCredits"><br>
<input class=formInputSubmit type="Submit" name="action" value="SendLogo"><br>
<input class=formInputSubmit type="Submit" name="action" value="SendGroupLogo"><br>
<input class=formInputSubmit type="Submit" name="action" value="SendPictureMessage"><br>
<input class=formInputSubmit type="Submit" name="action" value="SendRingtone"><br>
<input class=formInputSubmit type="Submit" name="action" value="SendVCard"><br>
<input class=formInputSubmit type="Submit" name="action" value="SendBinaryData"><br>
<input class=formInputSubmit type="Submit" name="action" value="SendWAPPushSMS"><br>
    </td>
  </tr>
</form>
</table>
<%

'form ação processo
'-------------------------------------------------------
Select Case Request("action")

    Case "SendTextSMS"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword
        SMS.AddRecipient sRecipient, sTransRefNumber
        SMS.Originator   = sOriginator
        If bFlashingSMS Then
            SMS.FlashingSMS = bFlashingSMS
        End If
        If bBlinkingSMS Then
            SMS.BlinkingSMS = bBlinkingSMS
        End If
        If nReplaceMessage <> "" Then
            SMS.ReplaceMessage = nReplaceMessage
        End If
        SMS.MessageData  = sMessageData
        If sDeferredDeliveryTime <> "" Then
            If nTimeZone <> "" Then
                SMS.TimeZone             = nTimeZone
            End If
            SMS.DeferredDeliveryTime = sDeferredDeliveryTime
        End If
        If nLifeTime <> "" Then
            SMS.LifeTime = nLifeTime
        End If
        If sURLBufferedMessageNotification <> "" Then
            SMS.URLBufferedMessageNotification = sURLBufferedMessageNotification
        End If
        If sURLDeliveryNotification <> "" Then
            SMS.URLDeliveryNotification = sURLDeliveryNotification
        End If
        If sURLNonDeliveryNotification <> "" Then
            SMS.URLNonDeliveryNotification = sURLNonDeliveryNotification
        End If
        SMS.SendTextMessage
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing

    Case "SendRandomLogo"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword
        SMS.AddRecipient sRecipient, sTransRefNumber
        SMS.Originator   = sOriginator
        SMS.MCC = nMCC
        SMS.MNC = nMNC
        If sDeferredDeliveryTime <> "" Then
            If nTimeZone <> "" Then
                SMS.TimeZone             = nTimeZone
            End If
            SMS.DeferredDeliveryTime  = sDeferredDeliveryTime
        End If
        If sURLBufferedMessageNotification <> "" Then
            SMS.URLBufferedMessageNotification = sURLBufferedMessageNotification
        End If
        If sURLDeliveryNotification <> "" Then
            SMS.URLDeliveryNotification = sURLDeliveryNotification
        End If
        If sURLNonDeliveryNotification <> "" Then
            SMS.URLNonDeliveryNotification = sURLNonDeliveryNotification
        End If
        SMS.SendRandomLogo
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing

    Case "SendLogo"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword
        SMS.AddRecipient  sRecipient, sTransRefNumber
        SMS.Originator    = sOriginator
        SMS.MCC           = nMCC
        SMS.MNC           = nMNC
        SMS.URLBinaryFile = sURLBinaryFileLogo
        If sDeferredDeliveryTime <> "" Then
            If nTimeZone <> "" Then
                SMS.TimeZone             = nTimeZone
            End If
            SMS.DeferredDeliveryTime = sDeferredDeliveryTime
        End If
        If sURLBufferedMessageNotification <> "" Then
            SMS.URLBufferedMessageNotification = sURLBufferedMessageNotification
        End If
        If sURLDeliveryNotification <> "" Then
            SMS.URLDeliveryNotification = sURLDeliveryNotification
        End If
        If sURLNonDeliveryNotification <> "" Then
            SMS.URLNonDeliveryNotification = sURLNonDeliveryNotification
        End If
        SMS.SendLogo
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing

    Case "SendGroupLogo"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword
        SMS.AddRecipient  sRecipient, sTransRefNumber
        SMS.Originator    = sOriginator
        SMS.MCC           = nMCC
        SMS.MNC           = nMNC
        SMS.URLBinaryFile = sURLBinaryFileLogo
        If sDeferredDeliveryTime <> "" Then
            If nTimeZone <> "" Then
                SMS.TimeZone             = nTimeZone
            End If
            SMS.DeferredDeliveryTime = sDeferredDeliveryTime
        End If
        If sURLBufferedMessageNotification <> "" Then
            SMS.URLBufferedMessageNotification = sURLBufferedMessageNotification
        End If
        If sURLDeliveryNotification <> "" Then
            SMS.URLDeliveryNotification = sURLDeliveryNotification
        End If
        If sURLNonDeliveryNotification <> "" Then
            SMS.URLNonDeliveryNotification = sURLNonDeliveryNotification
        End If
        SMS.SendGroupLogo
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing

    Case "SendPictureMessage"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword
        SMS.AddRecipient  sRecipient, sTransRefNumber
        SMS.Originator    = sOriginator
        SMS.URLBinaryFile = sURLBinaryFilePictureMessage
        If sDeferredDeliveryTime <> "" Then
            If nTimeZone <> "" Then
                SMS.TimeZone             = nTimeZone
            End If
            SMS.DeferredDeliveryTime = sDeferredDeliveryTime
        End If
        If sURLBufferedMessageNotification <> "" Then
            SMS.URLBufferedMessageNotification = sURLBufferedMessageNotification
        End If
        If sURLDeliveryNotification <> "" Then
            SMS.URLDeliveryNotification = sURLDeliveryNotification
        End If
        If sURLNonDeliveryNotification <> "" Then
            SMS.URLNonDeliveryNotification = sURLNonDeliveryNotification
        End If
        SMS.SendPictureMessage
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing

    Case "SendRingtone"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword
        SMS.AddRecipient  sRecipient, sTransRefNumber
        SMS.Originator    = sOriginator
        SMS.URLBinaryFile = sURLBinaryFileRingtone
        If sDeferredDeliveryTime <> "" Then
            If nTimeZone <> "" Then
                SMS.TimeZone             = nTimeZone
            End If
            SMS.DeferredDeliveryTime = sDeferredDeliveryTime
        End If
        If sURLBufferedMessageNotification <> "" Then
            SMS.URLBufferedMessageNotification = sURLBufferedMessageNotification
        End If
        If sURLDeliveryNotification <> "" Then
            SMS.URLDeliveryNotification = sURLDeliveryNotification
        End If
        If sURLNonDeliveryNotification <> "" Then
            SMS.URLNonDeliveryNotification = sURLNonDeliveryNotification
        End If
        SMS.SendRingtone
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing

    Case "SendVCard"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword
        SMS.AddRecipient sRecipient, sTransRefNumber
        SMS.Originator   = sOriginator

        SMS.VCardName        = sVCardName
        SMS.VCardPhoneNumber = sVCardPhoneNumber

        If sDeferredDeliveryTime <> "" Then
            If nTimeZone <> "" Then
                SMS.TimeZone             = nTimeZone
            End If
            SMS.DeferredDeliveryTime = sDeferredDeliveryTime
        End If
        If sURLBufferedMessageNotification <> "" Then
            SMS.URLBufferedMessageNotification = sURLBufferedMessageNotification
        End If
        If sURLDeliveryNotification <> "" Then
            SMS.URLDeliveryNotification = sURLDeliveryNotification
        End If
        If sURLNonDeliveryNotification <> "" Then
            SMS.URLNonDeliveryNotification = sURLNonDeliveryNotification
        End If
        SMS.SendVCard
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing

    Case "SendBinaryData"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword
        SMS.AddRecipient      sRecipient, sTransRefNumber
        SMS.Originator        = sOriginator
        'SMS.MCC               = nMCC
        'SMS.MNC               = nMNC
        SMS.XSer              = sXSer
        SMS.MessageData       = sMessageDataBinHex
        If sDeferredDeliveryTime <> "" Then
            If nTimeZone <> "" Then
                SMS.TimeZone             = nTimeZone
            End If
            SMS.DeferredDeliveryTime = sDeferredDeliveryTime
        End If
        If sURLBufferedMessageNotification <> "" Then
            SMS.URLBufferedMessageNotification = sURLBufferedMessageNotification
        End If
        If sURLDeliveryNotification <> "" Then
            SMS.URLDeliveryNotification = sURLDeliveryNotification
        End If
        If sURLNonDeliveryNotification <> "" Then
            SMS.URLNonDeliveryNotification = sURLNonDeliveryNotification
        End If
        SMS.SendBinaryData
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing

    Case "InquireDeliveryNotifications"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword

        SMS.NotificationInquirySettingsFormat    = 0
        SMS.NotificationInquirySettingsSeparator = sNotificationInquirySettingsSeparator
        SMS.AddTransRefNumberForNotificationInquiry sTransRefNumber
        sNotifications = SMS.InquireDeliveryNotifications
        rCredits = SMS.Credits
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing
    Response.Write "<pre>" & sNotifications & "</pre>" & vbCr
    Response.Write "<pre>Credits: " & rCredits & "</pre>" & vbCr

    Case "ShowCredits"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword

        rCredits = SMS.Credits
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing
    Response.Write "<pre>Credits: " & rCredits & "</pre>" & vbCr

    Case "SendWAPPushSMS"
    '---------------------------------------------------------------------------
    Set SMS = New ASPSMS_XML
        'SMS.PasswordFileLocation = sPasswordFileLocation
        SMS.Userkey  = sUserkey
        SMS.Password = sPassword
        SMS.AddRecipient  sRecipient, sTransRefNumber
        SMS.Originator    = sOriginator
        SMS.WAPPushDescription = sWAPPushDescription
        SMS.WAPPushURL = sWAPPushURL
        If sDeferredDeliveryTime <> "" Then
            If nTimeZone <> "" Then
                SMS.TimeZone             = nTimeZone
            End If
            SMS.DeferredDeliveryTime = sDeferredDeliveryTime
        End If
        If sURLBufferedMessageNotification <> "" Then
            SMS.URLBufferedMessageNotification = sURLBufferedMessageNotification
        End If
        If sURLDeliveryNotification <> "" Then
            SMS.URLDeliveryNotification = sURLDeliveryNotification
        End If
        If sURLNonDeliveryNotification <> "" Then
            SMS.URLNonDeliveryNotification = sURLNonDeliveryNotification
        End If
        SMS.SendWAPPushSMS
        If bLogXml Then
            Response.Write "<pre>" & Server.HTMLEncode(SMS.XmlLog) & "</pre>"
            'MsgBox SMS.XmlLog
        End If
    Set SMS = Nothing


    Case Else


End Select

%>

</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

entra no site do componente e verifique a documentação é mais completa link

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.