Sinan EGE

Sinan EGE

  • NA
  • 8
  • 13.9k

Sql Web Service Call

Nov 14 2013 1:50 AM
What is wrong ?

Thix code EXEC [dbo].[sp_call_web_service] 'test_value' 

(1 row(s) affected)
Msg 9413, Level 16, State 1, Procedure sp_call_web_service, Line 24
XML parsing: line 1, character 55, A string literal was expected


ALTER PROCEDURE [dbo].[sp_call_web_service] --'test_value'  @parametre VARCHAR(20)  AS DECLARE @obj INT DECLARE @valorDeRegreso INT DECLARE @sURL VARCHAR(200) DECLARE @response VARCHAR(8000) DECLARE @hr INT DECLARE @src VARCHAR(255) DECLARE @desc VARCHAR(255) DECLARE @UserName nvarchar(100) -- Domain\UserName or UserName      DECLARE @Password nvarchar(100)   SET @sURL = 'http://10.10.25.23:33021/openx/XXXWS_PUB/leave_list?pusername='+ @parametre +'' EXEC sp_OACreate 'MSXML2.ServerXMLHttp', @obj OUT EXEC sp_OAMethod @obj, 'Open', NULL, 'GET', @sURL, false, 'TESTUSER', 'PASS123' EXEC sp_OAMethod @obj, 'send' EXEC sp_OAGetProperty @obj, 'responseText', @response OUT  SELECT @response [response]  INSERT INTO [dbo].[_XML_TEST]            ([XML_DATA])      VALUES            (@response)   EXEC sp_OADestroy @obj  RETURN

Answers (1)