Thursday, 3 September 2020

How to call/convert webservice call from VB to NodeJs?

Good day everyone,I need to call this webservice on Nodejs or Postman, However I dont have any idea how to pass the fields and credentials, the code is in Visual Basic, and i need to mimic this in Nodejs, or even just to call this in postman.Here is the source code in visual basic, i dont have idea what content-type is this, I'm only familiar with basic request body, json, xml etc. but this one is new to me. (sorry for my english):ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();​try {client.ClientCredentials.UserName.UserName = "TestUserName"; client.ClientCredentials.UserName.Password = "TestPassword"; ​client.ClientCredentials.ServieCertificate.Authentication.CertificateValidation = X509CertificateValidationMode.None; ​ServiceReference1.ConfirmPaymentsResult result = new ServiceReference1.ConfirmPaymentsResult(); ServiceReference1.ConfirmPayments cp = new ServiceReference1.ConfirmPayments(); ​cp.PersonName = "johnny"; cp.PaymentRef = "1234567"; cp.AmountToPay = "100.00"; ​result = client.PaymentCofirmation(cp); ​if(result.Status == 'Success'); { do somoething } else if (result.Status == "Error") ​{ do something } }​

Submitted September 04, 2020 at 06:00AM by phil_grow

No comments:

Post a Comment