Hello, how do I get a post request passing an xml as date? I tried it on another GET request and it worked:
DECLARE @Tabela TABLE ( CampoXML XML);
DECLARE @URL VARCHAR(8000)
SELECT @URL = 'url?parametros='
DECLARE @Response varchar(8000)
DECLARE @XML xml
DECLARE @Obj int
DECLARE @Result int
DECLARE @HTTPStatus int
DECLARE @ErrorMsg varchar(MAX)
EXEC @Result = sp_OACreate 'MSXML2.XMLHttp', @Obj OUT
EXEC @Result = sp_OAMethod @Obj, 'open', NULL, 'GET', @URL, false
EXEC @Result = sp_OAMethod @Obj, 'setRequestHeader', NULL, 'Content-Type', 'application/x-www-form-urlencoded'
EXEC @Result = sp_OAMethod @Obj, send, NULL, ''
EXEC @Result = sp_OAGetProperty @Obj, 'status', @HTTPStatus OUT
INSERT @Tabela ( CampoXML )
EXEC @Result = sp_OAGetProperty @Obj, 'responseXML.xml'--, @Response OUT
SELECT * FROM @Tabela
however I need to do a post request, and go through body xml below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<acertaContratoEntrada xmlns="http://...">
<usuario>usuario</usuario>
<senha>senha</senha>
</acertaContratoEntrada>
Thank you for your response.