[WCF 學習筆記] 12. 宿主環境

WCF 部署模式比較靈活,我們可以依據服務的使用目的從多種宿主中選擇一個最適合的。可用的宿主模式包括:"Self-Hosting" in a Managed Application: 也就是 Console Application 或者 WinForm Application。我們在前面的章節都是使用這種模式進行示範。它的好處是簡單、部署方便,但缺乏相關環境支援,不適合用於企業級服務部署。Managed Windows Services:

[WCF 學習筆記] 4. 訊息作業

WCF 的一切都是圍繞著 Message 進行,那麼 Message 究竟是什麼樣子?[ServiceContract]public interface ICalculate{  [OperationContract]  double Add(double a, double b);}public class CalculateService : ICalculate{  public double Add(double a, double b)  {    Message msg =

WPF 學習筆記 – 1. Application

和 WinForm 類似, WPF 同樣需要一個 Application 來統領一些全域的行為和操作,並且每個 Domain 中只能有一個Application 執行個體存在。和 WinForm 不同的是 WPF Application 預設由兩部分組成 : App.xaml 和App.xaml.cs,這有點類似於 Delphi Form,將定義和行為代碼相分離。當然,WebForm 也採用了類似的方式。XAML從嚴格意義上說並不是一個純粹的 XML 格式檔案,它更像是一種

[WCF 學習筆記] 5. 異常處理

WCF 將服務異常(Exception)轉換成 SOAP faults,傳遞到用戶端後再次轉換成 Exception。只不過預設情況下,我們很難從中擷取有意義的資訊。[ServiceContract]public interface ICalculate{  [OperationContract]  int Add(int a, int b);}public class CalculateService : ICalculate{  public int Add(int a, int b)  {

Microsoft Dynamics CRM特性

Features in Microsoft Dynamics CRMThe following topics provide an overview of significant features andcapabilities of Microsoft Dynamics CRM. The features described are related tosecurity, organization and business structure, the entity model, the

[WCF 學習筆記] 6. 工作階段狀態

WCF 工作階段狀態和兩個端點(EndPoint)之間的一系列訊息交換相關聯,它實際上是 "執行個體上下文(Instance Context)”,控制著服務物件執行個體的建立方式和生存期。和 ASP.NET Session 有很大不同。WCF Session 特點: 由調用程式(Calling Application)發起初始化和終止操作。 由具體的 Binding 類型實現,因此它們之間的細節可能有所不同。 不提供 ASP.NET Session 那樣的資料容器。啟動 Session

WCF – 版本問題

在前面的文章中,我們曾試過用繼承的方式來實現版本更新。如果我們直接修改原有服務和資料類型會怎麼樣呢?測試原型:[DataContract]public class Data{  [DataMember]  public int x;}[ServiceContract]public interface IMyService{  [OperationContract]  void Test(Data d);}用戶端代理//---------------------------------------

Role-Based Security

Role-Based SecurityThe fundamental concept in role-based security is that privileges areassigned to defined categories of users (known as roles) rather than toindividual users. When a user is assigned to one of these roles, he or she isassigned the

WCF – 枚舉類型

通常情況下,我們無需做任何設定就可以在 WCF 中使用枚舉類型。public enum DataType{  A,  B,  C}[ServiceContract]public interface IMyService{  [OperationContract]  void Test(DataType d);}用戶端代理//------------------------------------------------------------------------------//

[WCF 學習筆記] 13. 分布事務

WCF 對分布事務提供了良好的支援,這使得我們可以協調多個服務之間的資料完整性。通過TransactionFlowAttribute、ServiceBehaviorAttribute 和OperationBehaviorAttribute 這三個特性,我們可以很好地控制事務的相關細節。TransactionFlowAttribute 的構造參數 "TransactionFlowOption transactions"

Object-Based Security

Object-Based SecurityObject-based security applies to individual instances of entities and isprovided by using access rights. The relationship between an access right and aprivilege is that access rights apply only after privileges have taken effect.

WCF – 服務執行個體管理員模式

WCF 提供了三種執行個體上下文模式:PreCall、PreSession 以及 Single。開發人員通過ServiceBehavior.InstanceContextMode 就可以很容易地控制服務物件的執行個體管理員模式。而當 WCF釋放服務物件時,會檢查該對象是否實現了 IDisposable 介面,並調用其 Dispose方法,以便及時釋放相關資源,同時也便於我們觀察對象釋允許存取為。1. PreCall在 PreCall

WCF – ServiceContract Operation 重載

方法重載在 OOP 中很常見,但在 WCF 中可能會有些麻煩。看下面的例子。[ServiceContract]public interface IContract{  void Test(int i);  void Test(string s);}public class MyService : IContract{  public void Test(int i)  {    Console.WriteLine(i);  }  public void Test(string s)  {    

WCF – 釋放服務物件執行個體

雖然通過設定 ServiceBehavior.InstanceContextMode 特性或關閉用戶端代理可以達到釋放服務物件的目的,但某些時候我們可能希望獲得更好的主動權。1. ReleaseServiceInstance這應該是最直接的方式了。看下面例子的輸出結果,我們可以看到在用戶端代理對象釋放之前,服務執行個體就被釋放了。[ServiceContract(SessionMode = SessionMode.Required)]public interface IMyService{  [

WCF – ServiceContract 繼承

ServiceContract 支援繼承的好處是我們可以在不影響現有用戶端的情況下自由擴充服務的功能。本文的目的是瞭解一下繼承的一些細節問題。(註:為了顯示方便,以下示範代碼中作了些刪減。)示範原型:伺服器端代碼[ServiceContract]public interface IMyService{  [OperationContract]  int Add(int a, int b);}public class MyServie : IMyService{  public int

[WCF 學習筆記] 10. 行為控制

在完成服務契約設計和服務實現後,我們可以設定該服務的運行期行為(Behavior)。這些行為包括 Service Behaviors、Endpoint Behaviors、Contract Behaviors、Operation Behaviors。有關所有行為的說明,可以查看

WCF – IsInitiating & IsTerminating

"IsInitiating=false" 表示執行該方法前,必須調用一個標註了 "IsInitiating=true" 的方法來建立Session;而 "IsTerminating=true" 表示該方法調用結束後,WCF將會釋放服務物件,用戶端代理將不能繼續任何操作(除非我們建立一個新的代理)。IsInitiating 和 IsTerminating只能用於啟用了 Session 的服務物件上,預設情況下 "IsInitiating=true,

[WCF 學習筆記] 7. 非同步呼叫

WCF 的非同步呼叫是基於訊息交換(Message Exchange)來實現的,和我們通常使用委託來實現非同步呼叫有所不同。編寫步驟:1. 建立服務契約。[ServiceContract(SessionMode=SessionMode.Required)]public interface ICalculate{  [OperationContract]  int Add(int a, int b);}2. 為契約方法添加非同步版本。我們為 Add 方法添加了 BeginAdd 和 EndAdd

[WCF 學習筆記] 11. 設定檔

WCF 的設定檔並不複雜,相對於手工編寫設定檔,我更傾向於使用 SDK 所附帶的工具 —— "Service Configuration Editor"。使用這個工具,我們可以非常方便地建立或修改伺服器和用戶端的設定檔。 WCF 設定檔基本元素:<system.ServiceModel>  <services>    <service>      <endpoint/>    </service>  </services> 

Microsoft Dynamics CRM系統架構概述

Microsoft Dynamics CRM Architecture OverviewThe following diagram illustrates the Microsoft Dynamics CRMarchitecture. The platform is the heart of the Microsoft Dynamics CRM system. When you usethe Microsoft Dynamics CRM SDK, you are building on top

總頁數: 61357 1 .... 20668 20669 20670 20671 20672 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.