REST call

Posted by goo on 13-Nov-2018 08:18

https://test.epayment.nets.eu/Netaxept/Query.aspx?merchantId=something&token=somethingelse&transactionId=XXXXa7a4a4d83eb5XX01641257...…..

When running this from Postman, it Works swell, but when trying to run this from webclient it fails With System.Net.WebException: The underlaying Connection was closed: an unexpected error occourred on a send.

Could this be caused by lack of certificate? Is there another way of getting more errorinfo?

The code:

URIextra = 'Query.apsx?merchantId=' + MerchantID + '&token=' + Token + '&transactionId=' + TransactionId.

oURI = new System.Uri('epayment-test.bbs.no/.../' + URIextra).
oWeb = new System.Net.WebClient().

oWeb:Headers:Add("Content-Type", "text/xml").

lcRespons = oWeb:DownloadString(oURI).

What am I doing wrong?

//Geir Otto

Posted by goo on 13-Nov-2018 08:59

I checked the diff between postman and webclient, and found that it was a typo …. .apsx instead of .aspx

I also had to add:

System.Net.ServicePointManager:SecurityProtocol = System.Net.SecurityProtocolType:Tls12.

Now it Works :-)

All Replies

Posted by goo on 13-Nov-2018 08:59

I checked the diff between postman and webclient, and found that it was a typo …. .apsx instead of .aspx

I also had to add:

System.Net.ServicePointManager:SecurityProtocol = System.Net.SecurityProtocolType:Tls12.

Now it Works :-)

This thread is closed