Upload
charles-jackson
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
2
Productive Windows Communication Foundation
Jeremy BoydMindscapeMSDN Regional Director ndash New Zealandjeremymindscapeconz
SOA315
3
Legends
Juval Lowy ndash Regional Director Silicon Valley
Christian Weyer ndash Regional Director Germany
4
Agenda
Some useful toolsUnit Testing Services using In Process HostingPer operation scoped extensionsTips around Data ContractsManaging FaultsWindows Forms and WCFHosting services under IIS 7
5
Useful Tools
A number of useful tools were provided with NET 30
SvcTraceViewerSvcConfigEditor
New tools with NET 35Service Test HostService Test Client
6
Sample Test HostUseful Tools
NET 35 ships with simple generic hostWcfSvcHostexe
Must provide as command line argumentsService class assembly
Class library or application assembly Config file (may be separate from normal)Can optionally start a test client at the same time
7
Sample Test ClientUseful Tools
NET 35 ships with simple generic test clientWcfTestClientexe
Must provide service metadata as command line arguments
Eg WcfTestClient httpserverporturl
8
Useful Tools
demo
9
Extra TipsUseful Tools
Can host within Visual Studio for F5rsquoing by using ldquoStart External Programrdquo
Can also have it call to the WcfTestClient
Can use with WCF 30 and Visual Studio 2005 if required ndash just add WcfSvcHost to the GAC
10
Unit Testing with Services
Testing Service Classes is no problemCreate class and invoke methods
Testing classes with dependencies on services is a problem
Should ideally remove dependenciesWhat if execution context matters
11
Hosting In-Process
Need a simple way to host a service in-process so we can simulate the WCF pipelineWant to support security transaction flow etcIdeally avoid any ldquoimplementationrdquo code
Proxy implementationConfig filesServiceHost wrapper
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
3
Legends
Juval Lowy ndash Regional Director Silicon Valley
Christian Weyer ndash Regional Director Germany
4
Agenda
Some useful toolsUnit Testing Services using In Process HostingPer operation scoped extensionsTips around Data ContractsManaging FaultsWindows Forms and WCFHosting services under IIS 7
5
Useful Tools
A number of useful tools were provided with NET 30
SvcTraceViewerSvcConfigEditor
New tools with NET 35Service Test HostService Test Client
6
Sample Test HostUseful Tools
NET 35 ships with simple generic hostWcfSvcHostexe
Must provide as command line argumentsService class assembly
Class library or application assembly Config file (may be separate from normal)Can optionally start a test client at the same time
7
Sample Test ClientUseful Tools
NET 35 ships with simple generic test clientWcfTestClientexe
Must provide service metadata as command line arguments
Eg WcfTestClient httpserverporturl
8
Useful Tools
demo
9
Extra TipsUseful Tools
Can host within Visual Studio for F5rsquoing by using ldquoStart External Programrdquo
Can also have it call to the WcfTestClient
Can use with WCF 30 and Visual Studio 2005 if required ndash just add WcfSvcHost to the GAC
10
Unit Testing with Services
Testing Service Classes is no problemCreate class and invoke methods
Testing classes with dependencies on services is a problem
Should ideally remove dependenciesWhat if execution context matters
11
Hosting In-Process
Need a simple way to host a service in-process so we can simulate the WCF pipelineWant to support security transaction flow etcIdeally avoid any ldquoimplementationrdquo code
Proxy implementationConfig filesServiceHost wrapper
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
4
Agenda
Some useful toolsUnit Testing Services using In Process HostingPer operation scoped extensionsTips around Data ContractsManaging FaultsWindows Forms and WCFHosting services under IIS 7
5
Useful Tools
A number of useful tools were provided with NET 30
SvcTraceViewerSvcConfigEditor
New tools with NET 35Service Test HostService Test Client
6
Sample Test HostUseful Tools
NET 35 ships with simple generic hostWcfSvcHostexe
Must provide as command line argumentsService class assembly
Class library or application assembly Config file (may be separate from normal)Can optionally start a test client at the same time
7
Sample Test ClientUseful Tools
NET 35 ships with simple generic test clientWcfTestClientexe
Must provide service metadata as command line arguments
Eg WcfTestClient httpserverporturl
8
Useful Tools
demo
9
Extra TipsUseful Tools
Can host within Visual Studio for F5rsquoing by using ldquoStart External Programrdquo
Can also have it call to the WcfTestClient
Can use with WCF 30 and Visual Studio 2005 if required ndash just add WcfSvcHost to the GAC
10
Unit Testing with Services
Testing Service Classes is no problemCreate class and invoke methods
Testing classes with dependencies on services is a problem
Should ideally remove dependenciesWhat if execution context matters
11
Hosting In-Process
Need a simple way to host a service in-process so we can simulate the WCF pipelineWant to support security transaction flow etcIdeally avoid any ldquoimplementationrdquo code
Proxy implementationConfig filesServiceHost wrapper
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
5
Useful Tools
A number of useful tools were provided with NET 30
SvcTraceViewerSvcConfigEditor
New tools with NET 35Service Test HostService Test Client
6
Sample Test HostUseful Tools
NET 35 ships with simple generic hostWcfSvcHostexe
Must provide as command line argumentsService class assembly
Class library or application assembly Config file (may be separate from normal)Can optionally start a test client at the same time
7
Sample Test ClientUseful Tools
NET 35 ships with simple generic test clientWcfTestClientexe
Must provide service metadata as command line arguments
Eg WcfTestClient httpserverporturl
8
Useful Tools
demo
9
Extra TipsUseful Tools
Can host within Visual Studio for F5rsquoing by using ldquoStart External Programrdquo
Can also have it call to the WcfTestClient
Can use with WCF 30 and Visual Studio 2005 if required ndash just add WcfSvcHost to the GAC
10
Unit Testing with Services
Testing Service Classes is no problemCreate class and invoke methods
Testing classes with dependencies on services is a problem
Should ideally remove dependenciesWhat if execution context matters
11
Hosting In-Process
Need a simple way to host a service in-process so we can simulate the WCF pipelineWant to support security transaction flow etcIdeally avoid any ldquoimplementationrdquo code
Proxy implementationConfig filesServiceHost wrapper
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
6
Sample Test HostUseful Tools
NET 35 ships with simple generic hostWcfSvcHostexe
Must provide as command line argumentsService class assembly
Class library or application assembly Config file (may be separate from normal)Can optionally start a test client at the same time
7
Sample Test ClientUseful Tools
NET 35 ships with simple generic test clientWcfTestClientexe
Must provide service metadata as command line arguments
Eg WcfTestClient httpserverporturl
8
Useful Tools
demo
9
Extra TipsUseful Tools
Can host within Visual Studio for F5rsquoing by using ldquoStart External Programrdquo
Can also have it call to the WcfTestClient
Can use with WCF 30 and Visual Studio 2005 if required ndash just add WcfSvcHost to the GAC
10
Unit Testing with Services
Testing Service Classes is no problemCreate class and invoke methods
Testing classes with dependencies on services is a problem
Should ideally remove dependenciesWhat if execution context matters
11
Hosting In-Process
Need a simple way to host a service in-process so we can simulate the WCF pipelineWant to support security transaction flow etcIdeally avoid any ldquoimplementationrdquo code
Proxy implementationConfig filesServiceHost wrapper
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
7
Sample Test ClientUseful Tools
NET 35 ships with simple generic test clientWcfTestClientexe
Must provide service metadata as command line arguments
Eg WcfTestClient httpserverporturl
8
Useful Tools
demo
9
Extra TipsUseful Tools
Can host within Visual Studio for F5rsquoing by using ldquoStart External Programrdquo
Can also have it call to the WcfTestClient
Can use with WCF 30 and Visual Studio 2005 if required ndash just add WcfSvcHost to the GAC
10
Unit Testing with Services
Testing Service Classes is no problemCreate class and invoke methods
Testing classes with dependencies on services is a problem
Should ideally remove dependenciesWhat if execution context matters
11
Hosting In-Process
Need a simple way to host a service in-process so we can simulate the WCF pipelineWant to support security transaction flow etcIdeally avoid any ldquoimplementationrdquo code
Proxy implementationConfig filesServiceHost wrapper
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
8
Useful Tools
demo
9
Extra TipsUseful Tools
Can host within Visual Studio for F5rsquoing by using ldquoStart External Programrdquo
Can also have it call to the WcfTestClient
Can use with WCF 30 and Visual Studio 2005 if required ndash just add WcfSvcHost to the GAC
10
Unit Testing with Services
Testing Service Classes is no problemCreate class and invoke methods
Testing classes with dependencies on services is a problem
Should ideally remove dependenciesWhat if execution context matters
11
Hosting In-Process
Need a simple way to host a service in-process so we can simulate the WCF pipelineWant to support security transaction flow etcIdeally avoid any ldquoimplementationrdquo code
Proxy implementationConfig filesServiceHost wrapper
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
9
Extra TipsUseful Tools
Can host within Visual Studio for F5rsquoing by using ldquoStart External Programrdquo
Can also have it call to the WcfTestClient
Can use with WCF 30 and Visual Studio 2005 if required ndash just add WcfSvcHost to the GAC
10
Unit Testing with Services
Testing Service Classes is no problemCreate class and invoke methods
Testing classes with dependencies on services is a problem
Should ideally remove dependenciesWhat if execution context matters
11
Hosting In-Process
Need a simple way to host a service in-process so we can simulate the WCF pipelineWant to support security transaction flow etcIdeally avoid any ldquoimplementationrdquo code
Proxy implementationConfig filesServiceHost wrapper
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
10
Unit Testing with Services
Testing Service Classes is no problemCreate class and invoke methods
Testing classes with dependencies on services is a problem
Should ideally remove dependenciesWhat if execution context matters
11
Hosting In-Process
Need a simple way to host a service in-process so we can simulate the WCF pipelineWant to support security transaction flow etcIdeally avoid any ldquoimplementationrdquo code
Proxy implementationConfig filesServiceHost wrapper
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
11
Hosting In-Process
Need a simple way to host a service in-process so we can simulate the WCF pipelineWant to support security transaction flow etcIdeally avoid any ldquoimplementationrdquo code
Proxy implementationConfig filesServiceHost wrapper
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
12
Hosting In-Process
demo
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
13
Per Operation Scope Extensions
Use an IDispatchMessageInspector to deal with ldquoper callrdquo concerns
Use an IServiceBehavior to apply the message inspector
I personally favour an attribute based approach
Add and reference your extensions from OperationContextCurrentExtensions
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
14
Tips for Data Contracts
General issues withWorking with OO mismatchesWorking with DataTables DataSetsDTO construction
Some useful advancements in 35 SP1Automatic support for graph serializationPOCO support for serialization
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
15
Operations Overloading Tips for Data Contracts
Cannot overload operations with services Can manually enable overloading
Use Name property to alias overloaded operations on service Generate proxy on client sideRename proxy methods to generate overloading Use Name property to alias overloaded methods on proxyMake calls on internal channel using the overloaded methods
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
16
Datasets and Tables Tips for Data Contracts
ADONET makes using DataSet and DataTable easy (too easy)Consider implications of passing dataset and data table
Inside layers of app probably fine Consider implications of publishing schema
Across technology boundaries consider returning arrays or other neutral representation
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
17
Tips for Data Contracts
demo
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
18
Fault Debugging
Two main desires for debuggingProviding detail of errors or exceptionsFlowing exceptions back to clients
Remember to use tracing informationExisting SDK tools help with this
SvcConfigEditorSvcTraceViewer
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
19
Providing Exception Details Fault Debugging
By default WCF will mask service exceptions Service exceptions returned as FaultExceptionThis is best practice (donrsquot leak)
However sometimes this is needed or usefulIncludeExceptionDetailInFaults property of ServiceBehavior attribute
Defaults to false Should only use in ldquodebugrdquo mode
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
20
Flowing Exceptions to the ClientFault Debugging
When debugging it is useful to flow exceptions
FaultExceptionltExceptionDetailgt class in the ServiceModel framework already caters for this
Initialized with original exceptionDetailType contains name of service exceptionMessage contains original exception message
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
21
Managing Faults
demo
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
22
Windows Forms and WCF
Form itself can be a serviceSimplifies reaching into the formSelf-hostedSubscriber to update events
Form needs to be a singletonUse InstanceContextModeSingle
Can get a bit messy to manage UI updates however
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
23
Windows Forms and WCF
demo
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
24
Hosting with IIS 7
Self HostedProcess
W3SVC
NET Worker
Service Host
HTTP
NETTCP
NETPIPE
NETM
SMQ
WAS
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
25
Hosting with IIS 7 WAS
demo
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
26
Configuration
Expose metadata at least on your test instancesSupports test clients and easier development
Look to understand and tweak bindings to suit requirements eg Security Transaction modes and Throttling
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
27
Throttling
Number of out of the box defaults for throttlingSessions 10Calls 16Instances 10
ldquoLimits We dont need no stinkin limitsrdquo
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
28
Managing the Throttle
demo
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
29
Summary
Useful ToolsSample Test Host and Client
Hosting In-ProcessInProcFactory pattern simplifies life
Per Operation ExtensionsData Contract tips
Overloading using Name on OperationContractEasier DTOs using NET 35 extensions
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
30
Summary
Fault DebuggingLeverage ExceptionDetail and flowing for debuggingRemember to switch off for release
Hosting inside Windows FormsFormHostltTgt pattern works quite well
Hosting under IIS 7 WASIIS 7 can host HTTP(s) TCP Named Pipes MSMQRemember to enable the protocolRemember to define the appropriate endpoints
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
31
Resources
Programming WCF ServicesJuval Lowy OReilly 2007
httpwwwidesignnetCode libraryCoding standards
My detailsjeremymindscapeconzhttpturtlenetnzblog
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
32
Q amp A
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
33
Resources
wwwmicrosoftcomteched TechmiddotTalks TechmiddotEd BloggersLive Simulcasts Virtual Labs
httpmicrosoftcomtechnet
Evaluation licenses pre-released products and MORE
httpmicrosoftcommsdn
Developerrsquos Kit Licenses and MORE
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION
34
copy 2008 Microsoft Corporation All rights reserved Microsoft Windows Windows Vista and other product names are or may be registered trademarks andor trademarks in the US andor other countriesThe information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation Because Microsoft must respond to changing market conditions it should not be interpreted to be a commitment on the part of Microsoft and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation MICROSOFT MAKES NO WARRANTIES EXPRESS IMPLIED
OR STATUTORY AS TO THE INFORMATION IN THIS PRESENTATION