21. Juli 2015 09:48
Path := FileMgt.Magicpath();
XMLRequestDoc := XMLResponseDoc.XmlDocument;
XMLElement1 := XMLRequestDoc.CreateElement('soap','Envelope','http://schemas.xmlsoap.org/soap/envelope/');
XMLElement1.SetAttribute('xmlns:ws','urn:microsoft-dynamics-schemas/codeunit/Testcodeunit');
XMLElement2 := XMLRequestDoc.CreateElement('soap','Body','http://schemas.xmlsoap.org/soap/envelope/');
XMLElement3 := XMLRequestDoc.CreateElement('ws','Insert','urn:microsoft-dynamics-schemas/codeunit/Testcodeunit');
XMLNode4 := XMLRequestDoc.CreateElement('ws','noteText','urn:microsoft-dynamics-schemas/codeunit/Testcodeunit');
XMLNode4.InnerText := '1';
XMLElement3.AppendChild(XMLNode4);
XMLNode4 := XMLRequestDoc.CreateElement('ws','toUser','urn:microsoft-dynamics-schemas/codeunit/Testcodeunit');
XMLNode4.InnerText := '1';
XMLElement3.AppendChild(XMLNode4);
XMLElement3.AppendChild(XMLNode4);
XMLElement2.AppendChild(XMLElement3);
XMLElement1.AppendChild(XMLElement2);
XMLRequestDoc.AppendChild(XMLElement1);
//XMLRequestDoc.Save('D:\Temp\RequestDotNet.xml');
HttpWebRequest := HttpWebRequest.Create(WebserviceLink);
HttpWebRequest.Timeout := 30000;
HttpWebRequest.UseDefaultCredentials(TRUE);
HttpWebRequest.Method := 'POST';
HttpWebRequest.ContentType := 'text/xml; charset=utf-8';
HttpWebRequest.Accept := 'text/xml';
HttpWebRequest.Headers.Add('SOAPAction','Insert');
MemoryStream := HttpWebRequest.GetRequestStream;
XMLRequestDoc.Save(MemoryStream);
MemoryStream.Flush;
MemoryStream.Close;
HttpWebResponse := HttpWebRequest.GetResponse;
MemoryStream := HttpWebResponse.GetResponseStream;
XMLResponseDoc := XMLResponseDoc.XmlDocument;
XMLResponseDoc.Load(MemoryStream);
MemoryStream.Flush;
MemoryStream.Close;
//XMLRequestDoc.Save('D:\Temp\Response.xml');
EXIT;
22. Juli 2015 22:54