Programming C# 4.0 phần 7

Khi định nghĩa một class thừa kế từ DynamicObject, chúng ta vẫn thực hiện các thao tác như việc định nghĩa một class thông thường, có nghĩa là việc định nghĩa các properties, các phương thức là hoàn toàn hợp lệ. | To make life easy for developers Visual Studio s installer sets up a special range of addresses with an ACL that makes it open for any user logged in to the machine. Listening on anything starting with http localhost 8732 Design_Time_Addresses will work even if you re logged on with a nonadministrative account. That s why Visual Studio chooses the base address you see in Example 13-3 it means you don t need to run with elevated privileges. After the services element you ll see a behaviors element in your containing a serviceBehaviors element which contains a behavior element. This section allows various WCF features to be switched on or off. You might wonder why these settings don t just go into the services section. The reason is that you might want to host multiple services all of which share common behavior configuration. You can define a single named behavior element and then point multiple service elements behaviorConfiguration attributes at that behavior reducing clutter in your configuration file. Or as in this case you can create an unnamed behavior element which defines default behavior that applies to all services in this host process. Since we re hosting only one service here this doesn t offer much advantage but this separation can be useful when hosting multiple services. The behavior element that Visual Studio provides has some comments telling you what you might want to change and why but paring it down to the essential content leaves just this behaviors serviceBehaviors behavior serviceMetadata httpGetEnabled True serviceDebug includeExceptionDetailInFaults False behavior serviceBehaviors behaviors This configures a couple of optional features. The first is related to the metadata exchange mentioned earlier it just ensures that the service description can be fetched in a certain way. Again we ll come back to metadata when we get to the client so you can ignore that for now. The second behavior here the serviceDebug element doesn t have .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.