diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb index 55f9d559..9797d9a5 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/Creditsafe/cCreditSafeAPI.vb @@ -315,22 +315,6 @@ Public Class cCreditSafeAPI Dim success As Boolean = json.Load(jsonRespString) If (success <> True) Then Return "Verbindungsfehler" - 'Aubbau JSON Object - - ' "report" { - ' "companyIdentification" : { - ' "basicInformation" : { - ' "companyRegistrationDate" : "01.01.2022", - ' "creditScore" : { - ' "currentCreditRating" : { - ' "commonValue" : "A", - ' "providerValue" : { - ' "value" : "350", - '....} - ' "pdfReportStream": "base64" - '}, - - Dim reportObj As Chilkat.JsonObject = json.ObjectOf("report") If (json.LastMethodSuccess = True) Then @@ -345,28 +329,32 @@ Public Class cCreditSafeAPI Dim turnover As Chilkat.JsonObject = turnoverArray.ObjectAt(0) company.csTurnover = turnover.StringOf("range") & " (" & turnover.StringOf("year") & ")" Else - Debug.WriteLine("otherInformationObject object not found.") + Debug.WriteLine("additionalInformationObject object not found.") End If End If If (reportObj.LastMethodSuccess = True) And companyAddInformObj IsNot Nothing Then Dim companyMiscObj As Chilkat.JsonObject = companyAddInformObj.ObjectOf("misc") - company.csBusinessPurpose = companyMiscObj.StringOf("businessPurpose") - If (companyAddInformObj.LastMethodSuccess = True) Then - Dim deCurrentRatingObj As Chilkat.JsonObject = companyMiscObj.ObjectOf("deCurrentRating") - If (companyAddInformObj.LastMethodSuccess = True) And deCurrentRatingObj IsNot Nothing Then - If (deCurrentRatingObj.LastMethodSuccess = True) Then - company.csIndex = deCurrentRatingObj.StringOf("value") - Else + If companyMiscObj IsNot Nothing AndAlso companyMiscObj.LastMethodSuccess = True Then + company.csBusinessPurpose = companyMiscObj.StringOf("businessPurpose") + If (companyAddInformObj.LastMethodSuccess = True) Then + Dim deCurrentRatingObj As Chilkat.JsonObject = companyMiscObj.ObjectOf("deCurrentRating") + If (companyAddInformObj.LastMethodSuccess = True) And deCurrentRatingObj IsNot Nothing Then + If (deCurrentRatingObj.LastMethodSuccess = True) Then + company.csIndex = deCurrentRatingObj.StringOf("value") + Else + Debug.WriteLine("deCurrentRatingObj.value not found.") + End If Debug.WriteLine("deCurrentRatingObj object not found.") End If - Debug.WriteLine("companyMiscObj object not found.") + Debug.WriteLine("businessPurpose object not found.") End If - Debug.WriteLine("companyAddInformObj object not found.") + Debug.WriteLine("companyMiscObj object not found.") End If Debug.WriteLine("reportObj object not found.") End If + 'End If