Hi EveryOne am trying to Send Request in Json and get the response from Navision, Am New to Dot.Net Variables.
Below is Code i have Tried So Far
HttpwebreqHan := HttpwebreqHan.WebRequestHandler();
HttpwebreqHan.ClientCertificateOptions(HttpClientCerOpt.Manual);
X509Store := X509Store.X509Store(X509StoreName.My,X509StoreLocation.CurrentUser);
X509Store.Open(X509OpenFlags.ReadOnly);
X509Store := X509Store.Certificates.Find(X509StoreType.FindBySubjectName,'J5UKSH8F',TRUE);
HttpwebreqHan.ClientCertificates();
HttpClient := HttpClient.HttpClient(HttpwebreqHan);
BaseUrl := 'vsdc.staging.vms.frcs.org.fj/.../Sign'; // Added
INvc := '0010001335';
StringContent := StringContent.StringContent(GetJsonInvoice_StructureString(INvc,sas),Encoding.UTF8,'application/json');
HttpClient.BaseAddress := Uri.Uri(BaseUrl);
HttpResponseMessage := HttpClient.PostAsync('POST',StringContent).Result; // Error Coming At this Point
IF HttpResponseMessage.IsSuccessStatusCode THEN
result := HttpResponseMessage.Content.ReadAsStringAsync.Result;
The Error Is Saying like Below
A call to System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage].Result failed with this message: The remote certificate is invalid according to the validation procedure.
---------------------------
OK
---------------------------