<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      VS2008中Web Reference和Service Reference的區(qū)別

      很早就發(fā)現(xiàn)在vs2008中應(yīng)用web service有兩種方式,即Add Web Reference和Add Service Reference,但是一直不是很清楚這兩者有什么區(qū)別。趁著今天有空實(shí)驗(yàn)一下這兩者的區(qū)別并記錄下來供大家參考。

       

      首先在網(wǎng)上查找,發(fā)現(xiàn)有如下兩個主要區(qū)別:

      1.Add Web Reference是由wsdl.exe生成客戶端代理的。

         Add Service Reference是由svcutil.exe生成客戶端代理的。

      2.Add Web Reference生成的代理可以被.net1.1或.net2.0的客戶端調(diào)用

         Add Service Reference生成的代理只能被.net3.0+的客戶端調(diào)用,而且Add Service Reference后不僅生成代理類,在web.config中還會生成相應(yīng)的Tag。

       

      下面是我的實(shí)驗(yàn):

      首先建立一個solution,在其中增加三個工程(一個WebApplication,一個Webservice,一個Wcfservice)。

      solution

      1.測試Web Reference

      (1.1)在WebApplication中引用WebService(即WebServiceForTest)

           引用后可正常使用,web.config中多出如下配置(url上的端口號和個人機(jī)器相關(guān))

      <applicationSettings>
      <WebReferAndSvcRefer.Properties.Settings>
      <setting name="WebReferAndSvcRefer_AsmxWebRefer_Service1"
      serializeAs="String">

      <value>http://localhost:1253/Service1.asmx"</value>
      </setting>
      </WebReferAndSvcRefer.Properties.Settings>
      </applicationSettings

       

      (1.2) 在WebApplication中引用WcfService(即WcfServiceForTest)

             引用后無法正常使用,web.config中多出的配置和上面類似

      <applicationSettings>
      <WebReferAndSvcRefer.Properties.Settings>
      <setting name="WebReferAndSvcRefer_WcfWebRefer_Service1"
      serializeAs="String">
      <value>http://localhost:1254/Service1.svc</value>
      </setting>
      </WebReferAndSvcRefer.Properties.Settings>
      </applicationSettings>

       

      2.測試Service Reference

      (2.1)在WebApplication中引用WebService(即WebServiceForTest)

         引用后可正常使用,web.config中多出如下配置(url上的端口號和個人機(jī)器相關(guān))

      <system.serviceModel>
      <bindings>
      <basicHttpBinding>
      <binding name="Service1Soap" closeTimeout="00:01:00"
      openTimeout="00:01:00"
      receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false"
      bypassProxyOnLocal="false"
      hostNameComparisonMode="StrongWildcard"
      maxBufferSize="65536" maxBufferPoolSize="524288"
      maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8"
      transferMode="Buffered"
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192"
      maxArrayLength="16384"
      maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
      <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
      <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
      </binding>
      </basicHttpBinding>
      </bindings>
      <client>
      <endpoint address="http://localhost:1253/Service1.asmx" binding="basicHttpBinding"
      bindingConfiguration="Service1Soap"
      contract="AsmxSvcRefer.Service1Soap" name="Service1Soap" />
      </client>

      </system.serviceModel>

       

      (2.2)在WebApplication中引用WcfService(即WcfServiceForTest)

          引用后可正常使用,web.config中多出如下配置(url上的端口號和個人機(jī)器相關(guān))

      <system.serviceModel>
      <bindings>
      <wsHttpBinding>
      <binding name="WSHttpBinding_IService1"
      closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00"
      sendTimeout="00:01:00"
      bypassProxyOnLocal="false" transactionFlow="false"
      hostNameComparisonMode="StrongWildcard"
      maxBufferPoolSize="524288"
      maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8"
      useDefaultWebProxy="true"
      allowCookies="false">
      <readerQuotas maxDepth="32" maxStringContentLength="8192"
      maxArrayLength="16384"
      maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00"
      enabled="false" />
      <security mode="Message">
      <transport clientCredentialType="Windows"
      proxyCredentialType="None" realm="" />
      <message clientCredentialType="Windows"
      negotiateServiceCredential="true"
      algorithmSuite="Default" establishSecurityContext="true" />
      </security>
      </binding>
      </wsHttpBinding>
      </bindings>
      <client>
      <endpoint address="http://localhost:1254/Service1.svc"
      binding="wsHttpBinding"
      bindingConfiguration="WSHttpBinding_IService1"
      contract="WcfSvcRefer.IService1"
      name="WSHttpBinding_IService1">
      <identity>
      <dns value="localhost" />
      </identity>
      </endpoint>
      </client>

      </system.serviceModel>

       

      3.測試客戶端的.net framework要求

      將WebApplication(即WebReferAndSvcRefer)的Target Framework降為2.0

      image

      然后發(fā)現(xiàn)在WebReferAndSvcRefer中無法引用Service Reference,證明了Add Service Reference生成的代理只能被.net3.0+的客戶端調(diào)用。

       

      4.總結(jié)

      以上的實(shí)驗(yàn)過程基本證明了本文開頭提到的兩個區(qū)別,其中(1.2)Add Web Reference的方式不能使用Wcf也證明了Add Web Reference生成的代理是面向.net1.1或.net2.0的客戶端的(wcf需要.net3.0的支持)。

      posted @ 2010-04-28 22:32  wang_yb  閱讀(7908)  評論(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 国产精品不卡区一区二| 亚洲日韩精品无码一区二区三区| 精品国产中文字幕av| 久久99久久99精品免观看| 日韩精品不卡一区二区三区| 99久久亚洲综合精品成人网| 精品少妇无码一区二区三批| 国厂精品114福利电影免费| 亚洲人成在线观看| 无码专区 人妻系列 在线| 欧美不卡无线在线一二三区观 | 日韩精品无码一区二区三区视频| 亚洲爆乳WWW无码专区| 远安县| 日韩毛片在线视频x| 国产综合色产在线精品| 亚洲色拍拍噜噜噜最新网站| 夜夜躁日日躁狠狠久久av| 国产亚洲精品超碰| 亚洲精品美女一区二区| 国产午夜福利精品视频| 国产男女爽爽爽免费视频| 亚洲成人一区| 精品亚洲欧美中文字幕在线看| 亚洲欧美人成电影在线观看 | 在线观看免费网页欧美成| 50岁熟妇的呻吟声对白| 人妻丝袜AV中文系列先锋影音| 亚洲成片在线看一区二区| 国产精品久久久久av福利动漫| 色综合人人超人人超级国碰| 国产老熟女狂叫对白| 亚洲av永久无码精品水牛影视| 国内精品极品久久免费看| 国产精品一区中文字幕| 国产69成人精品视频免费| 日韩国产精品中文字幕| 色欲综合久久中文字幕网| 国产精品线在线精品| 午夜福利看片在线观看| 亚洲成av人片天堂网无码|