發表文章

目前顯示的是 9月, 2014的文章

[Visual Studio]Web Service 與 WCF 差異表筆記

差異表 NO 功能 Web Service WCF (原名  Indigo)   .NET Farmework .NET 1.1 以上 .NET 3.5 以上   Hosting 可建置於 IIS 可建置於 IIS, Windows Activation Service, Self-hosting, Windows Service   Programming 定義 [WebService] Attribute 於類別 定義 [ServiceContract] Attribute 於類別   Model 使用 [WebMethod] Attribute 公開可見的方法 使用 [OperationContract] Attribute 公開可見的方法   Operation One-Way, Request - Response 於 Web Service 中支援各種操作 One-Way, Request - Response, Duplex 於 WCF 中支援不同類型的操作   XML 使用 System.Xml.Seriallzation 命名空間進行序列化 使用 System.Runtime.Serialization 命名空間進行序列化   Encoding XML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME, Custom XML 1.0, MTOM, Binary, Custom   Transports 透過 HTTP, TCP, Custom 溝通 透過 HTTP, TCP, Named Pipes, MSMQ, P2P, Custom 溝通   Protocols 配合 WSE 可支援 WS-*,提供安全性 支援 WS-*,提供安全性、可靠性、交易   State Management 無狀態 可管理狀態   Other   整合 Enterprise Sevices(COM+)、.Net Remoting、Web Service(ASMX)、WSE3.0 和 MSMQ reference web: http://www.dotblogs.com.tw/joysdw12/archive/2013/07/25/note-wcf-

[C#]Client呼叫WebService時發生逾時作業

這個實作是使用VS2010寫的, 微軟在VS2010已將原本的ASP.NET WebService整合至WCF, 所以相關資料用WCF去找比較找得到。 [Server端] 1. web.config (在<system.web></system.web>之間) <httpRuntime executionTimeout="1000"/>, 單位為秒, 設定仍無效 <sessionState mode="InProc" timeout="200" cookieless="UseCookies"></sessionState>, 單位為分鐘, 設定仍無效 [Client端] 1.修改app.config 引用WebService後, app.config會增加下列的XML <system.serviceModel>     <bindings>       <basicHttpBinding>         <binding name="WebService1Soap"/>         <binding name="Service1Soap" />       </basicHttpBinding>     </bindings>     <client>       <endpoint address="http://127.0.0.1/ws/WebService1.asmx" binding="basicHttpBinding"         bindingConfiguration="WebService1Soap" contract="rsService1.WebService1Soap"         name="WebService1Soap" />       <endpoint address="http://12