Saravana Kumar

Saravana Kumar

  • 1.4k
  • 374
  • 6.2k

How to call webservice from stored Procedure.

Dec 29 2014 9:57 AM


declare @objRef int 
declare @resultcode int
declare @responseText varchar(8000) 

 EXEC @resultcode = sp_OACreate 'MSXML2.ServerXMLHTTP', @objRef OUT,4 
 EXEC @resultcode = sp_OAMethod @objRef, 'Open', NULL,'GET','http://localhost:16808/OracleDataInsert.asmx?op=data', false 
 EXEC @resultcode = sp_OAMethod @objRef, 'Send',null 
 EXEC @resultcode = sp_OAGetProperty @objRef, 'responseText',@responseText output 




 EXEC sp_OADestroy @objRef


i got this code from surfed in web site. but it is not working.

Answers (2)