Thank you all for your help.
I am working on Windows 10.
I cannot upgrade to Xojo 2019 version for now, because we are using a large framework for database and gui which needs to be upgraded too. (In plans for next month)
I have written some code below to help you understand.
I will try to create a small project later, similiar to this in order to give you access to check it.
//Code in Open Event of Main Window
if mServiceBusTimer = Nil then
mServiceBusTimer = new eOrderCommunication.ServiceBusTimer
end if
mServiceBusTimer.Period = 1
mServiceBusTimer.Mode = Timer.ModeMultiple
mServiceBusTimer.Enabled = true
mServiceBusTimer.Reset()
The Timer calls the code below. I have changed the links that i Really use.
Dim lvUrlSb as String
Dim lb as Boolean = GetConfigValue(“SbUrl”,lvUrlSb)
lb = GetConfigValue(“SbQueue”,lvQueueName)
Dim sock1 as new eOrderCommunication.eOrderPingServerNew
Dim lvS as String = "Basic "+EncodeBase64(eOrderCommunication.eOrderUsername+":"+eOrderCommunication.eOrderPassword)
sock1.RequestHeader("Authorization")=lvS.ToText
sock1.RequestHeader("User-Agent")="ProfitPOS"
sock1.Send("GET","https://www.testsite.gr/healthcheck.txt")
App.errorLogging(“DEBUG - 3 -”)
if lvUrlSb.len > 0 then
App.errorLogging(“DEBUG - 4 -”)
Dim fItem as FolderItem = GetFolderItem("").Child(“serviceBusSas.txt”)
Dim success as Boolean
Dim rest As New eOrderCommunication.ChilcatRest
if lvUrlSb.right(1)="/" then
lvUrlSb = lvUrlSb.Left(lvUrlSb.len-1)
end if
Dim queueName As String
queueName = lvQueueName
Dim sbToken As New Chilkat.StringBuilder
success = sbToken.LoadFile(fItem.NativePath,"utf-8")
if Not(success) then
end if
success = sbToken.Prepend("SharedAccessSignature ")
success = rest.AddHeader("Authorization",sbToken.GetAsString())
'Dim sock as new eOrderCommunication.eOrderGetMessageQueueOld
'Dim lvUrl as Text = lvUrlSb.ToText+"/"+queueName.ToText+"/messages/head?timeout=30&api-version=2013-08"
'sock.SetRequestHeader("Authorization",sbToken.GetAsString.ToText)
'sock.SendRequest("DELETE",lvUrl)
Dim sock as new eOrderCommunication.eOrderGetMessageQueue
sock.ValidateCertificates = false
Dim lvUrl as Text = lvUrlSb.ToText+"/"+queueName.ToText+"/messages/head?timeout=30&api-version=2013-08"
sock.RequestHeader("Authorization") = sbToken.GetAsString.ToText
sock.Send("DELETE",lvUrl)
App.errorLogging("DEBUG - 5 -")
else
Dim sock1 as new eOrderCommunication.eOrderServiceBusRegisterNew
Dim lvS as String = “Basic “+EncodeBase64(eOrderCommunication.eOrderUsername+”:”+eOrderCommunication.eOrderPassword)
sock1.RequestHeader(“Authorization”) = lvS.ToText
sock1.RequestHeader(“Content-type”) = “application/json”
sock1.ValidateCertificates = false
sock1.ClearRequestHeaders()
sock1.Send(“GET”,eOrderCommunication.eOrderServerIP+“System/FranchiseeManagement/GetQueueConnection”) //DEV
end if
App.errorLogging(“DEBUG - 9 -”)
//Display Main eOrder Counter
Dim th as new thLoadeOrderThread
th.Run()
me.Period = 30000
me.Reset()