You are on page 1of 5

WINDOWS COMMUNICATION FOUNDATION

• INTRODUZIONE
• 1.1 Windows communication foundation e le architetture serviceoriented
• 1.2 Scopo di questo libro . . . . . . . . . . . . . . . . . . . . . . . . . . .8
• 1.3 Prerequisiti . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
• 1.4 Contattare l’autore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
• ADDRESS, BINDING, CONTRACT E OLTRE
• 2.1 Introduzione . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
• 2.2 Architettura di Windows comunication foundation . . . . 10
• 2.2.1 WCF Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
• 2.2.2 Il service Model Layer . . . . . . . . . . . . . . . . . . . . . . . . 11
• 2.2.3 Il Messaging Layer . . . . . . . . . . . . . . . . . . . . . . . . . . .12
• 2.2.4 L’Hosting Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
• 2.3 Concetto di Endpoint . . . . . . . . . . . . . . . . . . . . . . . . . . .13
• 2.4 Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
• 2.5 Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
• 2.6 Contract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
• 2.7 Definire un servizio WCF . . . . . . . . . . . . . . . . . . . . . . . . .17
• 2.8 Definire un endpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18
• 2.9 Metadata Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
• 2.9.1 Esporre il WSDL in HTTP-GET . . . . . . . . . . . . . . . . . . .22
• 2.9.2 Utilizzare un endpoint di tipo WS- MetadataExchange 26
• 2.10 Generare i clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
• 2.11 Message-Exchange patterns . . . . . . . . . . . . . . . . . . . . .30
• 2.12 L’operationcontext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

Scaricalo gratis su http://www.punto-informatico.it/PILibri


WINDOWS COMMUNICATION FOUNDATION
• CONTRACTS
• 3.1 Introduzione ai contratti in WCF . . . . . . . . . . . . . . . . . .35
• 3.2 Code-first o contract-first? . . . . . . . . . . . . . . . . . . . . . . 36
• 3.3 Service contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
• 3.4 data contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
• 3.4.1 Ordine di serializzazione . . . . . . . . . . . . . . . . . . . . . .41
• 3.5 Message contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
• 3.6 Fault contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
• 3.7 Callback contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
• 3.8 Gestire le versioni dei contratti . . . . . . . . . . . . . . . . . . . .54

• HOSTING
• 4.1 Introduzione . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
• 4.2 La classe servicehost . . . . . . . . . . . . . . . . . . . . . . . . . . 57
• 4.3 Self-hosting con WCF . . . . . . . . . . . . . . . . . . . . . . . . . . 58
• 4.4 Hosting in iis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
• 4.5 Hosting in Windows activation services (WAS) . . . . . . .65
• 4.6 Estendere il service host . . . . . . . . . . . . . . . . . . . . . . . . 66
• 4.7 Utilizzare il Bookservicehost . . . . . . . . . . . . . . . . . . . . . .69

Scaricalo gratis su http://www.punto-informatico.it/PILibri


WINDOWS COMMUNICATION FOUNDATION
• I BEHAVIORS
• 5.1 Introduzione ai Behaviors . . . . . . . . . . . . . . . . . . . . . . . 73
• 5.2 Service Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74
• 5.3 Endpoint Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
• 5.4 Operation Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
• 5.5 Contract Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
• 5.6 Creare un custom Behaviors . . . . . . . . . . . . . . . . . . . . .80
• 5.6.1 Il Messagelnspector . . . . . . . . . . . . . . . . . . . . . . . . . .81
• 5.6.2 Utilizzo programmatico di un custom Behavior . . . . . 83
• 5.6.3 Utilizzo di un custom Behavior mediante attributi . . . .83
• 5.6.4 Utilizzo di un custom Behavior mediante file
• di configurazione . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
• RELIABILITY, QUEUE, TRANSACTIONS
• 6.1 Introduzione . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
• 6.2 Scrivere servizi affidabili . . . . . . . . . . . . . . . . . . . . . . . .87
• 6.3 Il meccanismo di affidabilità . . . . . . . . . . . . . . . . . . . . . 88
• 6.4 Servizi affidabili in WCF . . . . . . . . . . . . . . . . . . . . . . . .89
• 6.5 Ordinare i messaggi . . . . . . . . . . . . . . . . . . . . . . . . . . .91
• 6.6 Message Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
• 6.7 Funzionamento delle code di messaggi . . . . . . . . . . . .93
• 6.8 Installazione e configurazione di MSMQ . . . . . . . . . . . 95
• 6.9 Message queuing in WCF . . . . . . . . . . . . . . . . . . . . . . 97
• 6.10 Transazioni . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102
• 6.11 Transaction promotion . . . . . . . . . . . . . . . . . . . . . . . . 104
• 6.12 Il TWO-PHASE Commit . . . . . . . . . . . . . . . . . . . . . . . 104
• 6.13 Abilitare un servizio alle transazioni . . . . . . . . . . . . . . 105
• 6.14 Votare per la transazione . . . . . . . . . . . . . . . . . . . . . . .109

Scaricalo gratis su http://www.punto-informatico.it/PILibri


WINDOWS COMMUNICATION FOUNDATION
• SICUREZZA
• 7.1 Introduzione . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
• 7.2 Sicurezza a livello di trasporto . . . . . . . . . . . . . . . . . . 112
• 7.3 Sicurezza a livello di messaggio . . . . . . . . . . . . . . . . .113
• 7.4 Credenziali in WCF . . . . . . . . . . . . . . . . . . . . . . . . . . .114
• 7.5 Bindings “sicuri” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
• 7.6 Utilizzare la sicurezza a livello di trasporto . . . . . . . . 115
• 7.6.1 Credenziali sul trasporto . . . . . . . . . . . . . . . . . . . . .116
• 7.6.2 Sicurezza del BasicHttpBinding . . . . . . . . . . . . . . . 116
• 7.6.3 Utilizzare la sicurezza a livello di messaggio . . . . . 121
• 7.6.4 Utilizzo del ProtectionLevel . . . . . . . . . . . . . . . . . . .126
• 7.7 Autenticazione . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
• 7.7.1 Autenticazione in WCF . . . . . . . . . . . . . . . . . . . . . . .127
• 7.7.2 Autenticazione mediante Username e Password . . .130
• 7.7.3 Autenticazione utilizzando l’ASP.NET Provider Model 132
• 7.8 Autorizzazione . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
• 7.8.1 Autorizzazione in WCF . . . . . . . . . . . . . . . . . . . . . . .135
• 7.9 Scegliere il livello di sicurezza più adeguato . . . . . . . . 139
• 7.10 Auditing degli accessi . . . . . . . . . . . . . . . . . . . . . . . . .140
• GESTIONE DELLE ISTANZE
• 8.1 Introduzione . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141
• 8.2 Modalità di gestione delle istanze . . . . . . . . . . . . . . . . . 142
• 8.3 Modalità di gestione della sessione . . . . . . . . . . . . . . . . 143
• 8.4 Instancecontextmode e sessionmode . . . . . . . . . . . . . . 148
• 8.5 La concorrenza . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149
• 8.6 Il concurrencymode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

Scaricalo gratis su http://www.punto-informatico.it/PILibri


WINDOWS COMMUNICATION FOUNDATION
INTRODUZIONE

1.1 WINDOWS COMMUNICATION FOUNDATION E LE


ARCHITETTURE SERVICE-ORIENTED

Fin dal suo primo annuncio durante la PDC 2003


(Professional Developer Conference), Microsoft Windows
Communication Foundation, code-name “Indigo”, mi ha
subito incuriosito. Mi sono via via avvicinato al mondo
SOA, ho studiato la tecnologia ed infine ho avuto
l’occasione di provarla sul campo ... e ne sono rimasto
folgorato. Windows Communication Foundation (WCF) è
definito come il framework unificato per lo sviluppo di
architetture Service-Oriented (SOA). Per SOA
intendiamo, in una definizione forse molto semplicistica,
quelle architetture basate sull’erogazione e/o sulla
fruizione di servizi, spesso utili per connettere tra loro
sistemi eterogenei.

Scaricalo gratis su http://www.punto-informatico.it/PILibri

You might also like