Hi, friends!
So, I have some problem with load xml-document, how to solve it?
1. My code, error at last line
HttpWebRequest := HttpWebRequest.Create(URL);
HttpWebRequest.Timeout := 30000;
HttpWebRequest.Method := 'POST';
HttpWebRequest.ContentType := 'text/xml; charset=utf-8';
HttpWebRequest.Accept := 'text/xml';
HttpWebRequest.Headers.Add('SOAPAction','LoadTransaction');
MemoryStream := HttpWebRequest.GetRequestStream;
MemoryStream.Flush;
MemoryStream.Close;
HttpWebResponse := HttpWebRequest.GetResponse;
MemoryStream := HttpWebResponse.GetResponseStream;
XMLResponseDoc := XMLResponseDoc.XmlDocument;
XMLResponseDoc.Load(MemoryStream);
2. My error at screenshot
0
Answers
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
WinHttp.open('POST','URL',0,0,0);
WinHttp.setRequestHeader('Host','YOUR HOST');// This part is optional
WinHttp.setRequestHeader('Content-Type','text/xml; charset=utf-8');
WinHttp.setRequestHeader('Content-Length','Length');
WinHttp.setRequestHeader('SOAPAction','YOUR SOAP ACTION');
WinHttp.send(WinDoc);
WinDoc.load(WinHttp.responseBody);
Actually I too have tried loading a InStream in my WinDoc.Load but seems it was not working so eventually I converted the Instream in Bigtext and then loaded it in the WinDoc.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/