Archived Forum Post

Index of archived forum posts


how to call json web service using t-sql.

Sep 04 '12 at 13:19

I read t-sql code on your website and trying very hard to call a json webservice but in-vain. Accepts three parameters by HTTP POST request (phone = phone number to which the sms will be sent, msg = message, type = 0 for regular and 1 for flash sms) to send sms.

Declare @Object as Int; Declare @ResponseText as Varchar(8000); DECLARE @login VARCHAR(50); DECLARE @user_passwd VARCHAR(50)

Exec master..sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;

--Exec master..sp_OAMethod @Object, 'open', NULL, 'get', '', 'false' --Exec master..sp_OAMethod @Object, 'open', NULL, 'get', '', 'false' Exec master..sp_OAMethod @Object, 'open', NULL, 'POST', '', 'false'

EXEC master..sp_OASetProperty @Object, 'phone', '03214040362' EXEC master..sp_OASetProperty @Object, 'msg', 'Testing is going on.' EXEC master..sp_OASetProperty @Object, 'type', 0

Exec master..sp_OAMethod @Object, 'send' Exec master..sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT Select @ResponseText as ResponseText Exec master..sp_OADestroy @Object

above api return {"result":"false","message":"You have not written any message. Please write something to send."}


How is this question related to a Chilkat API? This forum is for Chilkat related questions, not general-purpose programming relating to anything and everything..