I am connected to a Web Services, and I would like to insert the result of this call in a table. Could you help me please?
I leave you an overview of the code I use.
url := '
http://192.168.16.23/CAMESER/cfmsv.asmx';
uriObj := uriObj.Uri(url);
Request := Request.CreateDefault(uriObj);
Request.Method := 'POST';
Request.ContentType := 'text/xml';
soapAction:= '"
http://www.respuesta.com/GetContabilidad"';
Request.Headers.Add('SOAPAction',soapAction);
Request.Timeout := 120000;
xml := '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>'+
'<GetContabilidadResponse xmlns="
http://www.respuesta.com/">'+
'<Sociedad>'+Sociedad+'</Sociedad>'+
'</GetContabilidadResponse>'+
'</soap:Body></soap:Envelope>';
//Send the request to the webservices
stream := stream.StreamWriter(Request.GetRequestStream(), ascii.UTF8);
stream.Write(xml);
stream.Close();
//Get the response
Response := Request.GetResponse();
reader := reader.XmlTextReader(Response.GetResponseStream());
//Save the response to a XML
document := document.XmlDocument();
document.Load(reader);
Answers
I am trying to store the result the XML in a table.
Thank you for your cooperation