I an a bit amateur and I need to have my webservice called in sp so that I can give it an input right in sp and obtain the output but my sql code makes an error :sp_OACreate has not yet been called successfully for this command batch. what is the solution? could anybody tell me simply? I use sqlserver2012 and my sp is like:
create procedure [dbo].[test2]
@paramd int,
@paramm int,
@paramy int
as
begin
declare @obj int
declare @sUrl nvarchar(max)
declare @response varchar(8000)
declare @xml XML
set @sUrl= 'http://localhost:31876/myage/WebService.asmx?op=converttodaysweb?day:'+convert(nvarchar,@paramd)+'month:'+convert(nvarchar,@paramm)+'year:'+convert(nvarchar,@paramy)
exec sys.sp_OAMethod @obj,'Open',null,'GET',@sUrl,false
exec sys.sp_OAMethod @obj,send,null,''
exec sys.sp_OAGetProperty @obj,'responseXML.xml',@response OUT
SELECT @response [response]
exec sys.sp_OADestroy @obj
RETURN
END