sql触发器调用webservice超时

时间:2015-06-13 21:03:34

标签: sql sql-server web-services stored-procedures triggers

我有一个调用Web服务的sql触发器但由于插入和更新时有几个触发器,触发器会引发超时错误。

我在Visual Studio中进行了调试,并在插入或更新记录时始终收到超时错误。

在我的代码下面

ALTER   TRIGGER [dba].[TriggerWebservice] ON [dba].[CallID]
AFTER INSERT
AS

   DECLARE @InternFactureren nvarchar(1)
DECLARE @ID varchar(50)

   --check if something was updated or inserted


   BEGIN
                -- Insert statements for trigger here

         Select @Id=Id From inserted
         EXEC [dba].[usp_CallOphalenVoorDelaware] @Id

END




USE [Helpdesk]
GO
/****** Object:  StoredProcedure [dba].[usp_WebService]    Script Date:          13/06/2015 22:53:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dba].[usp_WebService]]
@CallID varchar(38) = NULL

AS

Declare @Object as Int; 
Declare @URL as varchar(255)
Declare @ResponseText as Varchar(8000);

SET @URL = 'http://localhost:4000/Service1.asmx/xxxxxxx?CallID=' +  @CallID + ''

Exec sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'get', @URL, 'false';
Exec sp_OAMethod @Object, 'send';
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT;
EXEC sp_OAGetErrorInfo @Object
Select @ResponseText Resultado;
Exec sp_OADestroy @Object;

0 个答案:

没有答案