SQL触发器到WebService调用Socket调用存储过程实现闭环介绍存储过程调用WebServiceALTER PROCEDURE [dbo].[U_CallWebService]
@tableName varchar(200)
AS
BEGIN
DECLARE @OBJ INT
-- DECLARE @URL VARCHAR(500)
DECLARE @RESPONSE VARCHAR(3000)
DECLARE @RET VARCHAR(1000)
declare @FunName varchar(50)
declare @P1 varchar(800)
declare @P1_Value varchar(100)
declare @ServiceUrl as varchar(1000)
Declare @ResponseText as Varchar(8000)
Set @ServiceUrl = 'http://localhost:8732/WebDataService.asmx/'
set @FunName = 'sendMessage'
set @P1 = 'msgInfo'
set @P1_Value =@tableName
set @ServiceUrl = @ServiceUrl @FunName '?' @P1 '=' @P1_Value
print 'My Service Address:' @ServiceUrl
................
--释放、销毁
EXEC SP_OADESTROY @OBJ
END
评论