WebService
Need to be configured as Get mode
sp_configure ' show advanced options ', 1; Goreconfigure; Gosp_configure ' Ole Automation procedures ', 1; Goreconfigure; Go/********************************************/declare @ServiceUrl as varchar (declare @UrlAddress varchar (500 --webservice address: Starts with HTTP and ends with slashes, such as ' http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/' set @UrlAddress = ' http://127.0.0.1/Service/MessageService.asmx/' Declare @FunName the method name called in varchar (--webservice): for example ' Getmobilecodeinfo ' Set @FunName = ' SendMessage '--the following parameters correspond to the [parameter name]declare of the 4 parameters in WebService @appcode NVARCHAR () DECLARE @ Password NVARCHAR () DECLARE @sendModes NVARCHAR () DECLARE @title NVARCHAR () DECLARE @content NVARCHAR () DECLARE @ Needreply VARCHAR (1) DECLARE @bizObjId NVARCHAR () DECLARE @senderUserID NVARCHAR (@receiveUserIds DECLARE) NVARCHAR ( DECLARE @receiveAcounts NVARCHAR () DECLARE @sendTime datetimedeclare @expiredTime datetimeset @appcode =n ' Personalportal ' Set @password =n ' personalportal ' Set @sendModes =n '%e7%9f%ad%e4%bf%a1 ' Set @title =n ' tesT ' set @content =n ' Test ' set @needReply = ' 0 ' Set @bizObjId =n ' test ' set @senderUserID =n ' work number ' set @receiveUserIds = ' SET @ Receiveacounts= ' mobile number or mail ' Set @sendTime =getdate () set @expiredTime =dateadd (Hour,1,getdate ()) Set @ServiceUrl = @ Urladdress + @FunName + '? appcode= ' + @appcode + ' & ' + ' password= ' + @password + ' & ' + ' sendmodes= ' + @sendModes + ' & ' + ' title= ' + @title + ' & ' + ' content= ' + @content + ' & ' + ' needreply= ' + @needReply + ' & ' + ' bizobjid= ' + @bizObjId + ' & ' + ' senderuserid= ' + @senderUserID + ' & ' + ' receiveuserids= ' + @receiveUserIds + ' & ' + ' Receiveaco Unts= ' + @receiveAcounts + ' & ' + ' sendtime= ' + CONVERT (VARCHAR (+), @sendTime, +) + ' & ' + ' expiretime= ' + CON VERT (VARCHAR, @expiredTime,) PRINT @ServiceUrl Declare @Object as intDECLARE @Resp Onsetext as Varchar (8000) Exec sp_OACreate ' MSXML2. XMLHTTP ', @Object out; exec sp_OAMethod @Object, ' open ', NULL, ' get ', @ServiceUrl, ' false ' exec sp_OAMethod @Object, ' send ' exec sp_oamethod @Object, ' responsetext ', @ResponseText OUTPUT Select @ResponseText Exec sp_oadest Roy @Object
SQL Call WebService