-
Book Overview & Buying
-
Table Of Contents
WCF Multi-layer Services Development with Entity Framework - Fourth Edition
By :
In the previous sections, when we were trying to retrieve a product, but the product ID passed in was not a valid one, we just threw an exception. Exceptions are technology-specific and therefore are not suitable for crossing the service boundary of SOA-compliant services. Thus, for WCF services, we should not throw normal exceptions.
What we need are SOAP faults that meet industry standards for seamless interoperability.
The service interface layer operations that might throw fault exceptions must be decorated with one or more FaultContract attributes, defining the exact fault exception.
On the other hand, the service consumer should catch specific fault exceptions to be in a position to handle the specified fault exceptions.
We will now wrap the exception in the GetProduct operation with a FaultContract type.
Before we implement our first FaultContract type, we need to modify the App.config file in the LayerNorthwindService project...
Change the font size
Change margin width
Change background colour