Error in the call to System.........dispose with this message: A task can only be discarded if has a completion status
HttpWebRequest := WebRequest.Create(Uri.Uri('https://xxxxxxx/shipping/ship')); HttpWebRequest.Method := 'POST'; HttpWebRequest.ContentType := 'text/xml'; HttpWebRequest.Timeout := 120000; //30000 HttpWebRequest.UseDefaultCredentials(FALSE); XMLDocDotNet := XMLDocDotNet.XmlDocument; XMLDoc.save('C:\XML\convert\XXX.xml'); XMLDocDotNet.Load('C:\XML\convert\XXX.xml'); ByteArray := Encoding.UTF8.GetBytes(XMLDocDotNet.OuterXml); HttpWebRequest.ContentLength := ByteArray.Length; TryCreateRequestStream(HttpWebRequest,RequestStream); RequestStream.Write(ByteArray,0,ByteArray.Length); TryGetWebResponse(HttpWebRequest,HttpWebResponse); StatusCode := HttpWebResponse.StatusCode; StatusDescription := HttpWebResponse.StatusDescription; ResponseText := ReadHttpResponseAsText(HttpWebResponse);
Answers
"Cannot serialize the object"