مشخصات کتاب
-
Mike Liu
-
2014
-
انگلیسی
-
23922
-
818
-
0
WCF 4.5 Multi-Layer Services Development with Entity Framework
Chapter 1: Web Services and Windows Communication Foundation 7
What is SOA? 8
Web services 8
What is a web service? 8
WSDL 10
Web service proxy 10
SOAP 11
Web services: standards and specifications 11
WS-I Profiles 12
WS-Addressing 12
WS-Security 12
WS-ReliableMessaging 12
WS-Coordination and WS-Transaction 13
Windows Communication Foundation (WCF) 13
What is WCF? 14
Why is WCF used for SOA? 14
WCF architecture 16
Basic WCF concepts – WCF ABCs 17
Address 17
Binding 17
Contract 18
Endpoint 22
Behavior 23
Hosting 23
Channels 24
Metadata 25
WCF production and development environments 25
Summary 26
Chapter 2: Implementing a Basic HelloWorld WCF Service 27
Creating the HelloWorld solution and project 27
Creating the HelloWorldService service contract interface 36
Implementing the HelloWorldService service contract 38
Hosting the WCF service in IIS Express 39
Creating the host application 39
Testing the host application 42
IIS Express 43
Modifying the web.config file 44
Starting the host application 46
Creating a client to consume the WCF service 47
Creating the client application project 47
Generating the proxy and configuration files 48
Customizing the client application 49
Running the client application 50
Setting the service application to AutoStart 51
Summary 52
Chapter 3: Hosting and Debugging the HelloWorld WCF Service 53
Hosting the HelloWorld WCF service 54
Hosting the service in ASP.NET Development Server 54
Hosting the service in a managed application 55
Hosting the service in a console application 56
Consuming the service hosted in a console application 59
Hosting the service in a Windows service 60
Hosting the service in the Internet Information Services server using the
HTTP protocol 60
Preparing the folders and files 61
Turn on Internet Information Services 63
Creating the IIS application 63
Starting the WCF service in IIS 64
Testing the WCF service hosted in IIS 64
Hosting the service in the Internet Information Services server using
the TCP protocol 65
Benefits of hosting a WCF service using the TCP protocol 65
Preparing the folders and files 66
Enabling the non-HTTP WCF activation for the hosting machine 69
Creating the IIS application 70
Testing the WCF service hosted in IIS using the TCP protocol 71
Other WCF service hosting options 72
Debugging the HelloWorld WCF service 72
Debugging from the client application 72
Starting the debugging process 73
Debugging on the client application 74
Stepping into the WCF service 75
Directly debugging the WCF service 76
Starting the WCF service in debugging mode 76
Starting the client application 77
Attaching to a running WCF service process 77
Running the WCF service and client applications in non-debugging mode 77
Debugging the WCF service hosted in IIS 78
Summary 79
Chapter 4: Implementing a WCF Service in the Real World 81
Why layer a service? 82
Creating a new solution and project using WCF templates 83
Creating the WCF service project 83
Creating the service interface layer 84
Creating the service interfaces 85
Creating the data contracts 86
Implementing the service contracts 88
Modifying the app.config file 91
Testing the service using WCF Test Client 93
Testing the service using our own client 97
Adding a business logic layer 104
Adding the business domain object project 104
Adding the business logic project 106
Calling the business logic layer from the service interface layer 110
Testing the WCF service with a business logic layer 114
Summary 116
Chapter 5: Adding Database Support and Exception Handling 117
Adding a data access layer 117
Creating the data access layer project 118
Calling the data access layer from the business logic layer 120
Preparing the database 122
Adding the connection string to the configuration file 123
Querying the database (GetProduct) 124
Testing the GetProduct method 126
Updating the database (UpdateProduct) 129
Adding error handling to the service 132
Adding a fault contract 133
Throwing a fault contract exception 135
Updating the client program to catch the fault exception 137
Testing the fault exception 141
Summary 142
Chapter 6: LINQ: Language Integrated Query 143
What is LINQ? 144
Creating the test solution and project 144
Datatype var 145
Automatic properties 146
Object initializer 147
Collection initializer 148
Anonymous types 149
Extension methods 150
Lambda expressions 156
Built-in LINQ extension methods and method syntax 159
LINQ query syntax and query expression 160
Built-in LINQ operators 163
Summary 165
Chapter 7: LINQ to Entities: Basic Concepts and Features 167
ORM: Object-Relational Mapping 168
Entity Framework 169
LINQ to Entities 170
Comparing LINQ to Entities with LINQ to Objects 171
LINQ to SQL 172
Comparing LINQ to SQL with LINQ to Entities 173
Creating a LINQ to Entities test application 174
Creating the data model 175
Adding a LINQ to Entities item to the project 175
Generated LINQ to Entities classes 181
Querying and updating a database table 182
Querying records 182
Updating records 183
Inserting records 184
Deleting records 184
Running the program 185
Viewing generated SQL statements 187
Viewing SQL statements using ToString 187
Viewing SQL statements using SQL Profiler 189
Deferred execution 190
Checking deferred execution with SQL Profiler 190
Deferred execution for singleton methods 192
Deferred execution for singleton methods within sequence expressions 193
Deferred (lazy) loading versus eager loading 197
Lazy loading by default 198
Eager loading with the Include method 199
Comparing lazy loading and eager loading 201
Joining two tables 201
Querying a view 202
Summary 203
Chapter 8: LINQ to Entities: Advanced Concepts and Features 205
Calling a stored procedure 205
Mapping a stored procedure to a new entity class 206
Modeling a stored procedure 206
Querying a stored procedure 207
Mapping a stored procedure to an existing entity class 208
Inheritance 212
LINQ to Entities Table per Hierarchy inheritance 212
Modeling the BaseCustomer and USACustomer entities 213
Modeling the UKCustomer entity 216
Generated classes with TPH inheritance 217
Testing the TPH inheritance 217
LINQ to Entities Table per Type inheritance 220
Preparing database tables 221
Modeling USACustomer1 and UKCustomer1 entities 222
Generated classes with TPT inheritance 223
Testing the TPT inheritance 223
Handling simultaneous (concurrent) updates 227
Detecting conflicts using a data column 228
The Concurrency Mode property 228
Adding another entity data model 229
Writing the test code 231
Testing the conflicts 232
Turning on concurrency control 232
Detecting conflicts using a version column 236
Adding a version column 236
Modeling the Products table with a version column 237
Writing the test code 238
Testing the conflicts 239
Transaction support 239
Implicit transactions 240
Explicit transactions 241
Summary 244
Chapter 9: Applying LINQ to Entities to a WCF Service 245
Creating the LINQNorthwind solution 246
Modeling the Northwind database 246
Creating the business domain object project 247
Using LINQ to Entities in the data access layer 249
Adding a reference to the BDO project 249
Creating UpdateProduct in the data access layer 251
Creating the business logic layer 253
Creating the service interface layer 254
Testing the service with the WCF Test Client 260
Testing concurrency with our own client 262
Creating the test client 262
Implementing the GetProduct functionality 264
Implementing the UpdateProduct functionality 265
Testing the GetProduct and UpdateProduct operations 269
Testing concurrent update manually 271
Testing concurrent updates automatically 274
Summary 280
Chapter 10: Distributed Transaction Support of WCF 281
Creating the DistNorthwind solution 282
Hosting the WCF service in IIS 284
Testing the transaction behavior of the WCF service 285
Creating a client to call the WCF service sequentially 286
Testing the sequential calls to the WCF service 293
Wrapping the WCF service calls in one transaction scope 295
Testing multiple database support of the WCF service 296
Creating a new WCF service 297
Calling the new WCF service in the client application 298
Testing the WCF service with two databases 303
Enabling distributed transaction support 306
Enabling transaction flow in service binding 306
Enabling transaction flow on the service hosting application 307
Modifying the service operation contract to allow a transaction flow 308
Modifying the service operation implementation to require a
transaction scope 309
Understanding the distributed transaction support of a WCF service 310
Testing the distributed transaction support of the WCF service 311
Configuring the Microsoft Distributed Transaction Coordinator 311
Configuring the firewall 313
Propagating a transaction from the client to the WCF service 314
Testing distributed transaction support with one database 314
Testing the distributed transaction support with two databases 315
Tradeoffs of distributed transactions 319
Summary 319
Chapter 11: WCF Security 321
WCF security components 321
WCF authorization 322
WCF auditing 322
WCF transfer security 323
WCF security modes 323
WCF transport security 324
WCF message security 325
WCF mixed security 325
WCF transport and message (both) security 325
Authentication options for transport security 325
Authentication options for message security 326
Hosting a WCF service using Basic Authentication 327
Setting up the service 327
Enabling the Basic Authentication feature 328
Configuring Basic Authentication on IIS 329
Configuring the HTTPS protocol 331
Configuring Basic Authentication on the service 333
Testing the service with Basic Authentication 336
Hosting a WCF service with Windows Authentication 338
WCF Security Guidance 340
Summary 340
Chapter 12: Extending WCF Services 341
WCF runtime architecture 341
Why extend WCF services? 343
WCF extension points 343
Client-side extension points 344
Service-side extension points 345
Extending a WCF service 345
WCF extension classes 346
WCF behavior classes 347
WCF behavior element classes 348
Applying the extensions 348
Extending HelloWorldService 349
Setting up the service 349
Creating the extension project 350
Creating an extension class 351
Creating a behavior class 354
Creating a behavior element class 356
Applying the extension to HelloWorldService 358
Testing the extended HelloWorldService 359
Summary 361
Index 363
آموزش Programming Entity Framework : Entity Framework
نویسنده: Julia Lerman
زبان: انگلیسی
آموزش Entity Framework 4 in Action : Entity Framework
نویسنده: Stefano Mostarda
زبان: انگلیسی
آموزش Entity Framework 6 Recipes : Entity Framework
نویسنده: Brian Driscoll
زبان: انگلیسی