国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

SQL2005中的HTTP端點

2024-07-21 02:05:30
字體:
來源:轉載
供稿:網友
  • 網站運營seo文章大全
  • 提供全面的站長運營經驗及seo技術!
  • sql2005提供了一個新的執行存儲過程或者t-sql的方法,它可以以web服務的方式發布到服務器上,而無須使用iis

    這個新特點通過http api把http端點暴露給用戶,在winxp sp2和win2003上被支持建立一個http端點是非常簡單的,如下

    create endpoint myendpoint?
    state = started
    as http (
      authentication = (integrated),
      path = '/sql/myendpoint',
      ports = (clear) )
    for soap (
      batches = enabled,
      wsdl = default
    )
    在上面的案例中我建立一個命名為myendpoint的端點,它在http://localhost/sql/myendpoint監聽t-sql語句,你可以使用下面url測試它
     http://localhost/sql/myendpoint?wsdl.
    上面這個url還可以附加很豐富的參數,具體參見sql幫助
    下面這個例子顯示如何通過javscript來調用端點執行t-sql語句,如下
    function sendbatchrequest( strservername, strurlpath, strquery )
    {
       var objxmlhttp = null;
       var strrequest = "";

       objxmlhttp = new activexobject( "microsoft.xmlhttp" );
       objxmlhttp.open( "post", "http://" + strservername + strurlpath, false );
       objxmlhttp.setrequestheader( "content-type", "text/xml" );
       objxmlhttp.setrequestheader( "host", strservername );

       strrequest = "<soap-env:envelope
                               xmlns:soap-env='http://schemas.xmlsoap.org/soap/envelope/'
                               xmlns:sql='http://schemas.microsoft.com/sqlserver/2004/soap'>
                                  <soap-env:body>
                                     <sql:sqlbatch>
                                        <sql:batchcommands>" + strquery + "</sql:batchcommands>
                                     </sql:sqlbatch>
                                  </soap-env:body>
                            </soap-env:envelope>";

       objxmlhttp.send( strrequest );

       if( objxmlhttp.status == 200 )
          return objxmlhttp.responsexml.xml;
       else
          return "";
    }

    var response = sendbatchrequest( 'localhost', '/sql/myendpoint', 'select * from sys.http_endpoints' );

    發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 赤峰市| 财经| 贺兰县| 张家界市| 波密县| 大名县| 措美县| 临江市| 宿州市| 东乌| 平乡县| 新干县| 天祝| 出国| 新巴尔虎右旗| 阿克苏市| 武强县| 三明市| 宽城| 武汉市| 丽江市| 老河口市| 互助| 汉寿县| 黄大仙区| 抚顺市| 霍州市| 陆良县| 建德市| 巴彦县| 万州区| 清水县| 静海县| 都昌县| 绥滨县| 新巴尔虎右旗| 德安县| 唐河县| 汉寿县| 高尔夫| 孟连|