1

On my .net core project, i am doing standart web request(HttpWebRequest). It started to gives error on ubuntu(docker) after updated .net core 2.0 to 2.2. Works on windows environment.

Error Message is : No such device or address

Code :

HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.Headers.Add("SOAPAction", action);
webRequest.ContentType = "text/xml;charset=\"UTF-8\"";
webRequest.Accept = "text/xml";
webRequest.Method = "POST";

var soapBodyString = CustomXmlSerializer.ToXml(request);
var soapEnvelopeXml = utils.CreateSoapEnvolope<TRequest>(soapBodyString, 
typeof(TRequest), ref soapMethodFullName,  options);
InsertSoapEnvelopeIntoWebRequest(soapEnvelopeXml, webRequest);

var response = await webRequest.GetResponseAsync(); // Thrown error here
var responseStream = response.GetResponseStream();
var rd = new StreamReader(responseStream, Encoding.UTF8);
soapResult = rd.ReadToEnd();
balron
  • 709
  • 4
  • 18
  • 40
  • maybe this could help. https://stackoverflow.com/questions/50365292/dns-gethostaddresshostname-no-such-device-or-address-exception-in-ubuntu-16-04 – Kinjal Parmar Mar 25 '19 at 09:52
  • What is the URL? Is it public? Can it be accessed from inside the container by something like `curl`? Can another machine access that url? – omajid Mar 25 '19 at 14:25
  • Url is the public service adress. It is the same adress as i was using it for months – balron Mar 26 '19 at 09:04

0 Answers0