Sub Class_Globals
'
' Attributes
'
Public ClientBuild As Int
Public IndLaborCode As String
Public EmployeeNumber As String
Public BarcodePrinterPath As String
Public BarcodeSystemType As Int
Public AutoIndirectAfterTA As Boolean
Public WarnErrorNegativeInventory As String
Public PasswordMinLength As Int
Public PasswordRepeatingCharLimit As Int
Public PasswordHistoryLimit As Int
Public PasswordResetRequired As Boolean
Public PasswordDays As Int
Public PasswordExpireDate As String
Public EmployeeClearConstant As Int
Public CurrentPrinter As String
Public DefaultPrinter As String
Public HomeFacility As String
Public TimeZoneAddSubtract As String
Public TimeZoneOffset As Int
Public DefaultMenu As String
Public Password As String
Public UserName As String
Public UserID As String
Public IsSystemAdmin As Boolean
Public ForceInvTransactions As Boolean
Public NumericMenus As Boolean
Public ClientIdent As String
Public ServerLoginsDisabled As Boolean
Public ServerLoginDMessage As String
Public ServerSystemVersion As Int
Public AuthFlags As String
'
' Controls
'
Public ParseError As Boolean
Public ParseErrorMsg As String
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
ParseError = False
ParseErrorMsg = ""
End Sub
public Sub RequestXML As String
Return $"<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ValidateUser xmlns="http://tempuri.org/">
<Environment>
<ClientBuild>${ClientBuild}</ClientBuild>
<Password>${Password}</Password>
<UserID>${UserID}</UserID>
</Environment>
</ValidateUser>
</soap:Body>
</soap:Envelope>"$
End Sub
'public Sub getRequestJob As HttpJob
'
' Dim j As HttpJob
'
' j.Initialize("",Main)
' j.PostString(Globals.WebServerPath & "server.asmx", RequestXML )
' j.GetRequest.SetContentType("text/xml; charset=utf-8")
' j.GetRequest.SetHeader("SOAPAction",$""http://tempuri.org/ValidateUser""$)
'
' Return j
'
'End Sub
public Sub ValidateUser
Dim j As HttpJob
j.Initialize("",Me)
j.PostString(Globals.WebServerPath & "server.asmx", RequestXML )
j.GetRequest.SetContentType("text/xml; charset=utf-8")
j.GetRequest.SetHeader("SOAPAction",$""http://tempuri.org/ValidateUser""$)
wait for (j) jobdone(j As HttpJob)
If j.Success Then
ParseXml(j.GetString)
Else
ParseErrorMsg = "Error Communicating with Web Server: " & j.ErrorMessage
ParseError = True
End If
j.Release
End Sub
public Sub ParseXml(XmlString As String)
Dim x2m As Xml2Map
x2m.Initialize
'
' extract base document root
'
Dim root As Map
If x2m.Parse(XmlString) Is Map Then
root = x2m.Parse(XmlString)
Else
ParseError = True
ParseErrorMsg = "Missing Document Root"
Return
End If
'
' extract base document root
'
'Log(root)
Dim envelope As Map
If root.Get("Envelope") Is Map Then
envelope = root.Get("Envelope")
Else
ParseError = True
ParseErrorMsg = "Soap Envelope Missing"
Return
End If
'
' extract soap body
'
Dim body As Map
If envelope.Get("Body") Is Map Then
body = envelope.Get("Body")
Else
ParseError = True
ParseErrorMsg = "Soap Body Missing"
Return
End If
'
' extract Environment from Response
'
Dim EnvironmentResponse As Map
If body.Get("ValidateUserResponse") Is Map Then
EnvironmentResponse = body.Get("ValidateUserResponse")
Else
ParseError = True
ParseErrorMsg = "Environment Response is missing from Soap Envelope"
Return
End If
'
' extract environment from response
'
Dim Environment As Map
If EnvironmentResponse.Get("Environment") Is Map Then
Environment = EnvironmentResponse.Get("Environment")
Else
ParseError = True
ParseErrorMsg = "Environment is missing from Environment Response"
Return
End If
'
' Extract Individual Attributes
'
ClientBuild = Environment.Get("ClientBuild")
IndLaborCode = Environment.Get("IndLaborCode")
EmployeeNumber = Environment.Get("EmployeeNumber")
BarcodePrinterPath = Environment.Get("BarcodePrinterPath")
BarcodeSystemType = Environment.Get("BarcodeSystemType")
AutoIndirectAfterTA = Environment.Get("AutoIndirectAfterTA")
WarnErrorNegativeInventory = Environment.Get("WarnErrorNegativeInventory")
PasswordMinLength = Environment.Get("PasswordMinLength")
PasswordRepeatingCharLimit = Environment.Get("PasswordRepeatingCharLimit")
PasswordHistoryLimit = Environment.Get("PasswordHistoryLimit")
PasswordResetRequired = Environment.Get("PasswordResetRequired")
PasswordDays = Environment.Get("PasswordDays")
PasswordExpireDate = Environment.Get("PasswordExpireDate")
EmployeeClearConstant = Environment.Get("EmployeeClearConstant")
CurrentPrinter = Environment.Get("CurrentPrinter")
DefaultPrinter = Environment.Get("DefaultPrinter")
HomeFacility = Environment.Get("HomeFacility")
TimeZoneAddSubtract = Environment.Get("TimeZoneAddSubtract")
TimeZoneOffset = Environment.Get("TimeZoneOffset")
DefaultMenu = Environment.Get("DefaultMenu")
Password = Environment.Get("Password")
UserName = Environment.Get("UserName")
UserID = Environment.Get("UserID")
IsSystemAdmin = Environment.Get("IsSystemAdmin")
ForceInvTransactions = Environment.Get("ForceInvTransactions")
NumericMenus = Environment.Get("NumericMenus")
ClientIdent = Environment.Get("ClientIdent")
ServerLoginsDisabled = Environment.Get("ServerLoginsDisabled")
ServerLoginDMessage = Environment.Get("ServerLoginDMessage")
ServerSystemVersion = Environment.Get("ServerSystemVersion")
AuthFlags = Environment.Get("AuthFlags")
End Sub