Взял пример запроса, который получает xml ответ через http запрос. С http никаких проблем нет, но встал вопрос получить данные через https. При выполнении возникает ошибка "0x800C0019 msxml3.dll Неправильный сертификат безопасности, необходимый для доступа к этому ресурсу." Попробовал обратиться к этой теме (
http://www.sql.ru/forum/actualthread.aspx?tid=885864&hl=sp_oacreate), но ничего не получилось, та же ошибка. Может кто сталкивался с таким вопросом?
declare @retcode int, @local int, @status int, @url varchar (255)
set @url = '
https://195.248...' EXEC @retcode = sp_OACreate 'Microsoft.XMLHTTP', @local OUT
IF @retcode<>0
EXEC sp_OAGetErrorInfo @local
EXEC @retcode = sp_OAMethod @local, 'Open', NULL, 'GET', @url, 'False'
IF @retcode<>0
EXEC sp_OAGetErrorInfo @local
EXEC @retcode = sp_OAMethod @local, 'SEND', NULL, @status
IF @retcode<>0
EXEC sp_OAGetErrorInfo @local
EXEC @retcode = sp_OAGetProperty @local, 'status', @status OUT
IF @retcode<>0
EXEC sp_OAGetErrorInfo @local
IF @status <> 200
RAISERROR('Invalid response status',16,1)
IF object_id('tempdb..#httpresult') is not null drop table #httpresult
create table #httpresult(http ntext)
insert #httpresult
EXEC @retcode = sp_OAGetProperty @local, 'responsetext'
IF @retcode<>0
EXEC sp_OAGetErrorInfo @local
SELECT http, datalength(http) from #httpresult
EXEC @retcode = sp_OADestroy @local
IF object_id('tempdb..#httpresult') is not null drop table #httpresult