Fehlerhandling ATEZ bei not receivedResponseHeader verbessert., Digicust API erweitert.

This commit is contained in:
2023-09-13 10:38:20 +02:00
parent 093931e9fa
commit b5ffd4433d
2 changed files with 17 additions and 4 deletions

View File

@@ -581,7 +581,6 @@ Public Class cATEZ_NCTS_IN
Dim rest As New Chilkat.Rest Dim rest As New Chilkat.Rest
Dim success As Boolean Dim success As Boolean
Dim bTls As Boolean = True Dim bTls As Boolean = True
Dim port As Integer = 443 Dim port As Integer = 443
Dim bAutoReconnect As Boolean = True Dim bAutoReconnect As Boolean = True
@@ -608,6 +607,7 @@ Public Class cATEZ_NCTS_IN
'rest.PercentDoneOnSend = True 'rest.PercentDoneOnSend = True
rest.IdleTimeoutMs = 5000 * 16 rest.IdleTimeoutMs = 5000 * 16
rest.VerboseLogging = True
success = rest.SendReqSb("POST", "/api/integrations/verag", sbRequestBody) success = rest.SendReqSb("POST", "/api/integrations/verag", sbRequestBody)
@@ -621,8 +621,12 @@ Public Class cATEZ_NCTS_IN
Next Next
If rest.ResponseStatusCode <> 200 Then If rest.ResponseStatusCode <> 200 Then
If responseStatusCode = -1 Then
Return responseStatusCode
End If
MsgBox(rest.LastErrorText) MsgBox(rest.LastErrorText)
Return responseStatusCode & "-" & rest.ResponseStatusText failureDesc = responseStatusCode & "-" & rest.ResponseStatusText
Return failureDesc
End If End If
End If End If
@@ -691,7 +695,6 @@ Public Class cATEZ_NCTS_IN
success = jsonData.UpdateString("Guarantee.GRN", ncts.Guarantee_GRN) success = jsonData.UpdateString("Guarantee.GRN", ncts.Guarantee_GRN)
Dim Route_LIST As New List(Of VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_Routen) Dim Route_LIST As New List(Of VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_Routen)
VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_Routen.LOAD_LIST_ByNCTS(Route_LIST, ncts.Id) VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_Routen.LOAD_LIST_ByNCTS(Route_LIST, ncts.Id)

View File

@@ -487,7 +487,7 @@ Public Class cDigicustAPI
' createUserinput(rest, counter, dig) ' createUserinput(rest, counter, dig)
rest.PartSelector = "0"
rest.AddHeader("Content-Type", "multipart/form-data") rest.AddHeader("Content-Type", "multipart/form-data")
rest.AddHeader("Authorization", "Bearer " & token) rest.AddHeader("Authorization", "Bearer " & token)
@@ -499,6 +499,11 @@ Public Class cDigicustAPI
rest.SendReqMultipart("POST", "/upload/api/" & settings.customerId & "/" & settings.projectId & "/new") rest.SendReqMultipart("POST", "/upload/api/" & settings.customerId & "/" & settings.projectId & "/new")
rest.PartSelector = "0"
rest.ClearAllHeaders()
rest.ClearAllParts()
rest.PartSelector = ""
Dim responseStatusCode = rest.ReadResponseHeader() Dim responseStatusCode = rest.ReadResponseHeader()
If (responseStatusCode < 0) Then If (responseStatusCode < 0) Then
For i = 0 To 15 'Versuche den Header 16x abzufragen (funktioniert ab und zu nicht). For i = 0 To 15 'Versuche den Header 16x abzufragen (funktioniert ab und zu nicht).
@@ -619,10 +624,15 @@ Public Class cDigicustAPI
Shared Function createUserinput(ByRef rest As Chilkat.Rest, ByRef counter As Integer, ByVal sendung As cDigicustSendungen) Shared Function createUserinput(ByRef rest As Chilkat.Rest, ByRef counter As Integer, ByVal sendung As cDigicustSendungen)
'zusätzliche Informationen aus dem AVISO
'beforeNormalization(fallback -> falls Daten nicht gelesen werden können, wird ergänzt) 'beforeNormalization(fallback -> falls Daten nicht gelesen werden können, wird ergänzt)
'afterNormalization(overwrite -> werden mit mitgeschickten Infos überschrieben). 'afterNormalization(overwrite -> werden mit mitgeschickten Infos überschrieben).
Dim jsonArray As New Chilkat.JsonArray()
Dim json As New Chilkat.JsonObject Dim json As New Chilkat.JsonObject
If sendung.licencePlate <> "" Then If sendung.licencePlate <> "" Then
json.UpdateString("truckLicensePlate", sendung.licencePlate) json.UpdateString("truckLicensePlate", sendung.licencePlate)