When consuming a web service from AX this error can occour:
System.ServiceModel.CommunicationException: An error occurred while making the HTTP request to ……… This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server. —> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. —> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
This error indicates that the web service has TLS 1.2 security protocol enabled
In order to solve it you can add this code before to call the web service in X++ :
//Add this code to enable TLS 1.2 security protocol
System.Net.ServicePointManager::set_SecurityProtocol(System.Net.SecurityProtocolType::Tls12);
//Then call Web service
request = new Praxedo.ServiceReference.LocationManager.getLocations(locations, wsEntryArr, credentials);