SQL 调用 webservice
webservice
需要配置为get 方式 sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO
/********************************************/ declare @ServiceUrl as varchar(1000)
declare @UrlAddress varchar(500)
--WebService地址:以http开头,结尾带斜杠,例如'http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/'
set @UrlAddress = 'http://127.0.0.1/Service/MessageService.asmx/' declare @FunName varchar(50)
--WebService中调用的方法名:例如'getMobileCodeInfo'
set @FunName = 'SendMessage' --以下参数对应WebService中4个参数的[参数名]
DECLARE @appcode NVARCHAR(50)
DECLARE @password NVARCHAR(50)
DECLARE @sendModes NVARCHAR(50)
DECLARE @title NVARCHAR(50)
DECLARE @content NVARCHAR(50)
DECLARE @needReply VARCHAR(1)
DECLARE @bizObjId NVARCHAR(50)
DECLARE @senderUserID NVARCHAR(50)
DECLARE @receiveUserIds NVARCHAR(50)
DECLARE @receiveAcounts NVARCHAR(50)
DECLARE @sendTime DATETIME
DECLARE @expiredTime DATETIME SET @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'工号'
SET @receiveUserIds=''
SET @receiveAcounts='手机号码或邮件'
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 +'&'
+ 'receiveAcounts=' + @receiveAcounts +'&'
+ 'sendTime=' + CONVERT(VARCHAR(50),@sendTime,120) +'&'
+ 'expireTime=' + CONVERT(VARCHAR(50),@expiredTime,120) PRINT @ServiceUrl Declare @Object as Int
Declare @ResponseText 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_OADestroy @Object
SQL 调用 webservice的更多相关文章
- SQL调用WebService接口
今天在做一个非常奇葩的东西.中间有个过程要在SQL触发器里面调用webservice接口.呵呵~ ALTER TRIGGER tgr_UpdateMemcached ON dbo.[User] AFT ...
- Sql调用WebService
DECLARE @scid int,@rt int ) --创建MSSOAP.SoapClient组件(如果安装的是SoapToolkit30,应该是MSSOAP.SoapClient30,否则是MS ...
- sqlserver能否调用webservice发送短信呢?
上班的时候突然有一个想法,sqlserver能否调用webservice发送短信呢? 经过查找资料,终于找到了解决办法,现将步骤贴到下面: (1)开启sqlserver组件功能,如果不开启这个组件功能 ...
- ASP.NET实现二维码 ASP.Net上传文件 SQL基础语法 C# 动态创建数据库三(MySQL) Net Core 实现谷歌翻译ApI 免费版 C#发布和调试WebService ajax调用WebService实现数据库操作 C# 实体类转json数据过滤掉字段为null的字段
ASP.NET实现二维码 using System;using System.Collections.Generic;using System.Drawing;using System.Linq;us ...
- SQL存储过程来调用webservice
如果用存储过程来调用webservice 那存储过程的功能感觉能做好多事情了? 别自欺欺人了.那些功能还是webservice来实现的... 完整的webservice代码:(也是默认的,新建.asm ...
- Jquery调用Webservice传递Json数组
Jquery由于提供的$.ajax强大方法,使得其调用webservice实现异步变得简单起来,可以在页面上传递Json字符串到Webservice中,Webservice方法进行业务处理后,返回Js ...
- .Net 下采用GET/POST/SOAP方式动态调用WebService的简易灵活方法(C#) [轉]Redfox
一直以来,我都为动态调用WebService方法而烦恼.在.Net环境下,最常用的方法就是采用代理类来调用WebService,可以通过改变代理类的Url属性来实现动态调用,但当xmlns改变时就会出 ...
- Ajax调用webService(一) 不跨域。
注:需要的js文件与组件(jquery-1.4.2.min.js和Newtonsoft.Json) 同域:要调用的webservice与ajax请求页面在同一个网站下(本文中都是本地测试). 数据库( ...
- 一个简单的webservice的demo(下)winform异步调用webservice
绕了一大圈,又开始接触winform的项目来了,虽然很小吧.写一个winform的异步调用webservice的demo,还是简单的. 一个简单的Webservice的demo,简单模拟服务 一个简单 ...
随机推荐
- PowerBuilder -- Len(), LenA() 与 String, Blob
使用的是Powerbuilder12.5与Powerbuild9 不太一样 函数 String Blob Len() 返回字符数 返回字符数对应的字节数 LenA() 返回字节数 返回字符数对应的字节 ...
- oracle角色(role)概念
一个角色是一组特权,它可以授权给用户或其它角色. 特权有:create table,select on boss ,create session,insert on boss,update on bo ...
- Android 自定义View跑马灯效果(一)
今天通过书籍重新复习了一遍自定义VIew,为了加强自己的学习,我把它写在博客里面,有兴趣的可以看一下,相互学习共同进步: 通过自定义一个跑马灯效果,来诠释一下简单的效果: 一.创建一个类继承View, ...
- LoadRunner hits per second 深入理解
Hits per Second Graph The Hits per Second graph shows the number of HTTP requests made by Vusers to ...
- JavaScript中实现继承
今天即兴研究了下JS,查阅了相关资料 ,发现Js中没有"子类"和"父类"的概念,也没有"类"(class)和"实例"(i ...
- Regularization: how complicated the model is? Regularization, measures complexity of model 使预测准确、平稳 predictive stable
http://www.kdd.org/kdd2016/papers/files/rfp0697-chenAemb.pdf https://homes.cs.washington.edu/~tqchen ...
- Paxos is Simple
[角色]0-MainProposer提案生成者1-提案发送者(MainProposer+OtherProposer)2-提案接收者(Acceptor)[动作]0-MainProposer----> ...
- Hadoop实战-Flume之Source replicating(十四)
a1.sources = r1 a1.sinks = k1 k2 a1.channels = c1 c2 # Describe/configure the source a1.sources.r1.t ...
- nvl()与regexp_replace()
NVL(字段,0):将空值转化为0 regexp_replace(字段, ‘[1-9]‘ ,'') is not null; 将数字转化为0
- Database: coursera assignment 1
q.1: Find the titles of all movies directed by Steven Spielberg. select title from moviewhere direct ...