万本电子书0元读

万本电子书0元读

顶部广告

WCF Multi-layer Services Development with Entity Framework电子书

售       价:¥

7人正在读 | 0人评论 6.2

作       者:Mike Liu

出  版  社:Packt Publishing

出版时间:2014-10-31

字       数:282.9万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
If you are a C#, VB.NET, or C++ developer and want to get started with WCF and Entity Framework, then this book is for you. Competence in Entity Framework will be needed to follow the examples in the book, but experience in creating WCF services using Entity Framework is not necessary. Developers and architects evaluating SOA implementation technologies for their company will find this book useful.
目录展开

WCF Multi-layer Services Development with Entity Framework Fourth Edition

Table of Contents

WCF Multi-layer Services Development with Entity Framework Fourth Edition

Credits

About the Author

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

Instant updates on new Packt books

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Implementing a Basic HelloWorld WCF Service

The basic WCF concepts

Address

Binding

Contract

The service contract

The operation contract

The message contract

The data contract

The fault contract

Endpoint

Behavior

Hosting

Channels

Metadata

WCF environments

Creating the HelloWorld solution and project

Defining the HelloWorldService service contract interface

Implementing the HelloWorldService service contract

Hosting the WCF service in IIS Express

Creating the host application

Testing the host application

IIS Express

Modifying the Web.config file

Starting the host application

Creating a client to consume the WCF service

Creating the client application project

Generating the proxy and configuration files

Customizing the client application

Running the client application

Setting the service application to autostart

Summary

2. Hosting the HelloWorld WCF Service

WCF hosting options

Hosting the service in a managed application

Hosting the service in a console application

Consuming the service hosted in a console application

Hosting the service in a Windows service

Hosting the service in IIS using the HTTP protocol

Preparing the folders and files

Starting IIS

Enabling WCF services on Windows 8

Creating the IIS application

Starting the WCF service in IIS

Testing the WCF service hosted in IIS using the HTTP protocol

Hosting the service in IIS using the TCP protocol

Benefits of hosting a WCF service using the TCP protocol

Preparing the folders and files

Enabling the TCP WCF activation for the host machine

Creating the IIS application

Testing the WCF service hosted in IIS using the TCP protocol

Summary

3. Deploying the HelloWorld WCF Service

Publishing the HelloWorldService from Visual Studio

Publishing from Visual Studio to an on-premise computer

Creating the publishing project

Publishing the HelloWorldService

Testing the service

Publishing to the cloud

Creating the profile to be published

Creating the cloud website

Publishing the HelloWorldService to the cloud website

Testing the service

Publishing the HelloWorldService using a deployment package

Creating the package

Installing the package

Testing the service

Summary

4. Debugging the HelloWorld WCF Service

Debugging a WCF service from a client application

Starting the debugging process

Debugging the client application

Stepping into the WCF service

Directly debugging the WCF service

Starting the WCF service in the debugging mode

Starting the client application

Attaching the debugger to a running WCF service process

Running the WCF service and client applications in a non-debugging mode

Debugging the WCF service hosted in IIS

Debugging a WCF service hosted in the cloud

Enabling debugging of the service

Attaching to the cloud service process

Debugging the service

Summary

5. Implementing a Three-layer WCF Service

Why layer a service?

Creating a new solution and project using the built-in WCF service template

Creating the WCF service project

Creating the service interface layer

Creating service interfaces

Creating data contracts

Implementing the service contracts

Modifying the App.config file

Testing the service using the WCF Test Client

Testing the service using your own client

Adding a business logic layer

Adding the business domain object project

Adding the business logic project

Calling the business logic layer from the service interface layer

Testing the WCF service with a business logic layer

Summary

6. Adding Database Support and Exception Handling

Adding a data access layer

Creating the data access layer project

Calling the data access layer from the business logic layer

Preparing the database

Adding the connection string to the configuration file

Querying the database using GetProduct

Testing the GetProduct method

Updating the database using UpdateProduct

Testing the UpdateProduct method

Adding error handling to the service

Adding a fault contract

Throwing a fault contract exception

Updating the client program to catch the fault exception

Changing the exception options

Testing the fault exception

Summary

7. LINQ to Entities – Basic Concepts and Features

LINQ to Entities

Creating a LINQ to Entities test application

Creating the data model

Installing Entity Framework

Adding a LINQ to Entities item to the project

The generated LINQ to Entities classes

Querying and updating a database table

Querying records

Updating records

Inserting records

Deleting records

Running the program

Viewing the generated SQL statements

Viewing the SQL statements using ToString

Viewing the SQL statements using SQL Profiler

Deferred execution

Checking deferred execution with SQL Profiler

Deferred execution for aggregation methods

Deferred execution for aggregation methods within sequence expressions

Deferred execution – lazy loading versus eager loading

Lazy loading by default

Eager loading with the Include method

Comparing lazy loading and eager loading

Joining two tables

Querying a view

Summary

8. LINQ to Entities – Advanced Concepts and Features

Calling a stored procedure

Mapping a stored procedure to a new entity class

Adding a stored procedure to the model

Querying a stored procedure

Mapping a stored procedure to an existing entity class

Handling simultaneous (concurrent) updates

Detecting conflicts using a data column

The Concurrency Mode property

Adding another entity data model

Writing the test code

Testing the conflicts

Turning on concurrency verification

Detecting conflicts using a version column

Adding a version column

Modeling the Products table with a version column

Writing the test code

Testing the conflicts

Transaction support

Implicit transactions

Explicit transactions

Summary

9. Applying LINQ to Entities to a WCF Service

Creating the LINQNorthwind solution

Installing Entity Framework

Modeling the Northwind database

Creating the business domain object project

Using LINQ to Entities in the data access layer

Adding a reference to the BDO project

Creating GetProduct in the data access layer

Creating UpdateProduct in the data access layer

Creating the business logic layer

Creating the service interface layer

Testing the service with the WCF Test Client

Testing concurrency with our own client

Hosting the WCF service in IIS

Creating the test client

Implementing the GetProduct functionality

Implementing the UpdateProduct functionality

Testing the GetProduct and UpdateProduct operations

Testing concurrent updates manually

Testing concurrent updates automatically

Summary

10. Distributed Transaction Support of WCF

Creating the DistNorthwind solution

Hosting the WCF service in IIS

Testing the transaction behavior of the existing WCF service

Creating a client to call the WCF service sequentially

Testing the sequential calls to the WCF service

Wrapping the WCF service calls in one transaction scope

Testing the multiple database support of the WCF service

Configuring a remote database on a remote machine

Creating a new WCF service

Calling the new WCF service in the client application

Testing the WCF service with two databases

Enabling distributed transaction support

Enabling transaction flow in service binding

Enabling transaction flow on the service hosting the application

Modifying the service operation contract to allow a transaction flow

Modifying the service operation implementation to require a transaction scope

Understanding the distributed transaction support of a WCF service

Testing the distributed transaction support of the new WCF service

Configuring the Microsoft Distributed Transaction Coordinator

Configuring the firewall

Propagating a transaction from the client to the WCF service

Testing the distributed transaction support with one database

Testing the distributed transaction support with two databases

Trade-offs of distributed transactions

Summary

11. Building a RESTful WCF Service

SOAP versus REST

WCF REST versus the ASP.NET Web API

Creating the RESTNorthwind solution

Creating the RESTful service

Defining RESTful service contracts

Implementing the RESTful service

Modifying the configuration file

Testing the RESTful service in a browser

Testing the RESTful WCF service with a C#/XAML client

Creating the C#/XAML client

Implementing the GetProduct method of the C#/XAML client

Testing the GetProduct method of the C#/XAML client

Implementing the UpdateProduct method of the C#/XAML client

Testing the UpdateProduct method of the C#/XAML client

Testing the RESTful WCF service with a JavaScript client

Creating the JavaScript client

Testing the service with jQuery

Installing jQuery to the client project

Implementing the GetProductJQuery method

Testing the GetProductJQuery method of the JavaScript client

Implementing the UpdateProductJQuery method

Testing the UpdateProductJQuery method of the JavaScript client

Testing the service with WinJS

Implementing the GetProductWinJS method

Testing the GetProductWinJS method of the JavaScript client

Implementing the UpdateProductWinJS method

Testing the UpdateProductWinJS method of the JavaScript client

Summary

12. WCF Security

WCF security components

WCF authorization

WCF auditing

WCF transfer security

WCF security modes

WCF transport security

WCF message security

WCF mixed security

WCF transport and message security

Authentication options for transport security

Authentication options for message security

Hosting a WCF service using basic authentication

Setting up the service

Enabling the Basic Authentication feature

Configuring basic authentication on IIS

Configuring the HTTPS protocol

Configuring basic authentication on the service

Testing the service with basic authentication

Hosting a WCF service with Windows authentication

Summary

13. Extending WCF Services

The WCF runtime architecture

Why extend WCF services?

WCF extension points

Client-side extension points

Service-side extension points

Extending a WCF service

WCF extension classes

WCF behavior classes

WCF behavior element classes

Applying the extensions

Extending HelloWorldService

Setting up the service

Creating the extension project

Creating an extension class

Creating a behavior class

Creating a behavior element class

Applying the extension to HelloWorldService

Testing the extended HelloWorldService

Summary

Index

累计评论(0条) 1个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部