During my Christmas vacation I have been preparing for the Windows Communication Foundation Development with Microsoft .NET Framework 4, as part of a quest at work to have four people obtain the Windows Azure Developer title, which in return will grant us some partner benefits.
I have previously been preparing for the WCF certification, but as I find the topic super boring (although very useful) I never actually took the exam, but since the upside is bigger this time I will take the exam.
Before I started on reading up, I had a decent amount of real-life experience with WCF (without being an expert), so if you are a complete beginner this reading material might not be sufficient.
Anyway my reading material has been:
- MCTS Self-Paced Training Kit (Exam 70-503): Microsoft® .NET Framework 3.5—Windows® Communication Foundation: Microsoft .Net Framework 3.5
- Programming WCF Services: Mastering WCF and the Azure AppFabric Service Bus
- Web Pages
- TS: Windows Communication Foundation Development with Microsoft .NET Framework 4 – Skills measured
- A Developer’s Introduction to Windows Communication Foundation 4
- Introducing WCF WebHttp Services in .NET 4 (REST)
- WCF Feature Details (MSDN)
- Windows Communication Foundation Samples
- WCF Extensibility
- Reliable sessions
I was finally able to take the exam today after it got rescheduled a week – and yeah I passed. The extra week was great because there is a lot of material, and a lot of stuff to remember, even if you have worked with WCF for a while. After the exam I still feel like I can improve in some areas I purposely didn’t spend too much time on during the preparation. So when I feel like reading more WCF, I will dive deeper into the security aspects and routing.
ServiceBehaviorAttribute.InstanceContextMode defaults to PerSession, other options are: Single (only one instance of service exists unless ConcurrencyMode equals Multiple), PerCall (new instance of services is created for each request).
Default values for the realiableSession binding element.
When creating custom bindings the order of the binding elements are important read more here,
- Transaction Flow (Not Required)
- Reliable Messaging (Not Required)
- Message Security (Not Required)
- Composite Duplex (Not Required)
- Message Encoding (Required)
- Transport Security (Not Required)
- Transport (Required)
Possible transport protocols:
If message contracts are used they must be used for both request and reply. Message contract provides more control of the SOAP message making it possible to define which fields go in the header, with MessageHeader attribute and MessageBodyMember for fields that must go in the SOAP body.
the Routing Service evaluates all filters at the highest priority level first
logEntireMessage defaults to false, when set to true body is logged also.
The WebHttpBehavior is a general-purpose behavior that supports UriTemplate dispatch and POX/JSON/byte stream formats on the wire. Use it for general purpose HTTP/REST/Web-Style services.
The WebScriptEnablingBehavior is a “profile” of the WebHttpBehavior functionality designed specifically for interop with ASP.NET AJAX clients. It adds in some AJAX-isms like the ability to automatically generate ASP.NET AJAX client proxies.
The following operationcontract is allowed to declared private. And the exception will not be returned to the sender.
public class OneWay
private void DoWork(DataStore ds)
throw new Exception(“error”);
Rules for orderings:
- If a data contract type is a part of an inheritance hierarchy, data members of its base types are always first in the order.
- Next in order are the current type’s data members that do not have the Order property of the DataMemberAttribute attribute set, in alphabetical order.
- Next are any data members that have the Order property of the DataMemberAttribute attribute set. These are ordered by the value of the Order property first and then alphabetically if there is more than one member of a certain Order value. Order values may be skipped.