资源简介

SQL触发器到WebService调用Socket调用存储过程实现闭环

介绍存储过程调用WebService

ALTER PROCEDURE [dbo].[U_CallWebService]
@tableName varchar(200) 
AS 
BEGIN
    DECLARE @OBJ INT
   -- DECLARE @URL VARCHAR(500)
    DECLARE @RESPONSE VARCHAR(3000)
    DECLARE @RET VARCHAR(1000)
    declare @FunName varchar(50)
    declare @P1 varchar(800)
    declare @P1_Value varchar(100)
    declare @ServiceUrl as varchar(1000) 
    Declare @ResponseText as Varchar(8000)
    
    Set @ServiceUrl = 'http://localhost:8732/WebDataService.asmx/'
set @FunName = 'sendMessage'        
set @P1 = 'msgInfo'
set @P1_Value =@tableName
set @ServiceUrl = @ServiceUrl @FunName '?' @P1 '=' @P1_Value                       
print 'My Service Address:' @ServiceUrl 
  ................
    --释放、销毁
    EXEC SP_OADESTROY @OBJ
    
END

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SocketClient
{
    public partial class Form1 : Form
    {
        /// 
        /// 字符编码处理.
        /// 

        private static readonly Encoding ASCII =  Encoding.ASCII; 
        /// 
        /// 用于 发送/接收的端口.
        /// 

        private const int PORT = 2333; 
        

        public Form1()
        {
            InitializeComponent();
        }
        /// 
        /// 接收消息
        /// 

        /// 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     145532  2017-12-12 11:19  SocketClient\packages\Antlr.3.4.1.9004\Antlr.3.4.1.9004.nupkg

     文件     102912  2017-12-12 11:19  SocketClient\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll

     文件     431616  2017-12-12 11:19  SocketClient\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.pdb

     文件       7054  2017-12-12 11:19  SocketClient\packages\AspNet.scriptManager.bootstrap.3.0.0\AspNet.scriptManager.bootstrap.3.0.0.nupkg

     文件       5632  2017-12-12 11:19  SocketClient\packages\AspNet.scriptManager.bootstrap.3.0.0\lib\net40\AspNet.scriptManager.bootstrap.dll

     文件       6144  2017-12-12 11:19  SocketClient\packages\AspNet.scriptManager.bootstrap.3.0.0\lib\net45\AspNet.scriptManager.bootstrap.dll

     文件       7057  2017-12-12 11:19  SocketClient\packages\AspNet.scriptManager.jQuery.1.10.2\AspNet.scriptManager.jQuery.1.10.2.nupkg

     文件       5120  2017-12-12 11:19  SocketClient\packages\AspNet.scriptManager.jQuery.1.10.2\lib\net40\AspNet.scriptManager.jQuery.dll

     文件       5120  2017-12-12 11:19  SocketClient\packages\AspNet.scriptManager.jQuery.1.10.2\lib\net45\AspNet.scriptManager.jQuery.dll

     文件     121137  2017-12-12 11:19  SocketClient\packages\bootstrap.3.0.0\bootstrap.3.0.0.nupkg

     文件     120502  2017-12-12 11:19  SocketClient\packages\bootstrap.3.0.0\content\Content\bootstrap.css

     文件      97949  2017-12-12 11:19  SocketClient\packages\bootstrap.3.0.0\content\Content\bootstrap.min.css

     文件      14079  2017-12-12 11:19  SocketClient\packages\bootstrap.3.0.0\content\fonts\glyphicons-halflings-regular.eot

     文件      63157  2017-12-12 11:19  SocketClient\packages\bootstrap.3.0.0\content\fonts\glyphicons-halflings-regular.svg

     文件      29512  2017-12-12 11:19  SocketClient\packages\bootstrap.3.0.0\content\fonts\glyphicons-halflings-regular.ttf

     文件      16448  2017-12-12 11:19  SocketClient\packages\bootstrap.3.0.0\content\fonts\glyphicons-halflings-regular.woff

     文件      59250  2017-12-12 11:19  SocketClient\packages\bootstrap.3.0.0\content\scripts\bootstrap.js

     文件      28518  2017-12-12 11:19  SocketClient\packages\bootstrap.3.0.0\content\scripts\bootstrap.min.js

     文件        209  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\content\App.config.transform

     文件        209  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\content\Web.config.transform

     文件    4255648  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\Entityframework.6.1.3.nupkg

     文件    4976848  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\lib\net40\Entityframework.dll

     文件     601808  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\lib\net40\Entityframework.SqlServer.dll

     文件     145441  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\lib\net40\Entityframework.SqlServer.xml

     文件    3229543  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\lib\net40\Entityframework.xml

     文件     326352  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\lib\net40\zh-Hans\Entityframework.resources.dll

     文件      19664  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\lib\net40\zh-Hans\Entityframework.SqlServer.resources.dll

     文件     172253  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\lib\net40\zh-Hans\Entityframework.SqlServer.xml

     文件    2576741  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\lib\net40\zh-Hans\Entityframework.xml

     文件    5196496  2017-12-12 11:19  SocketClient\packages\Entityframework.6.1.3\lib\net45\Entityframework.dll

............此处省略694个文件信息

评论

共有 条评论