70-503 Study Notes: Creating Services, Part I

Define Service Contracts

Service Contract – mechanisms by which capabilities and requirements are specified for its consumers:

-          Interface/class

-          Operations within that type

-          3 core .NET attributes

o    ServiceContractAttribute

o    OperationContractAttribute

o    MessageParameterAttribute

ServiceContractAttribute

-          Can be applied to either Interfaces or clases

-          If the interface or class inherits from another Service Contract, you must explicitly use the ServiceContractAttirbute to declare the subtype as well

Named Parameter Options

·         The ConfigurationName property specifies the name of the service element in the configuration file to use.

·         The Name and Namespace properties control the name and namespace of the contract in the WSDL <portType> element.

·         The SessionMode property specifies whether the contract requires a binding that supports sessions.

o    SessionMode.Allowed to specify that the service supports user session

o    SessionMode.Required to specify that the client must invoke the method within a session

·         The CallbackContract property specifies the return contract in a two-way (duplex) conversation.

·         The HasProtectionLevel and ProtectionLevel properties indicate whether all messages supporting the contract have a explicit ProtectionLevel value, and if so, what that level is.

OperationContractAttribute

Apply the OperationContractAttribute to a method to indicate that the method implements a service operation as part of a service contract

Named Parameter Options

Use the OperationContractAttribute properties to control the structure of the operation and the values expressed in metadata:

·         The Action property specifies the action that uniquely identifies this operation. WCF dispatches request messages to methods based on their action.

·         The AsyncPattern property indicates that the operation is implemented or can be called asynchronously using a Begin/End method pair.

·         The HasProtectionLevel property indicates whether the ProtectionLevel property has been explicitly set.

·         The IsOneWay property indicates that the operation only consists of a single input message. The operation has no associated output message.

·         The IsInitiating property specifies whether this operation can be the initial operation in a session.  Default is true.  Set to false to ensure a client uses an existing instance.

·         The IsTerminating property specifies whether WCF attempts to terminate the current session after the operation completes.  Default is false.

·         The ProtectionLevel property specifies the message-level security that an operation requires at run time.

·         The ReplyAction property specifies the action of the reply message for the operation.

MessageParameterAttribute

The MessageParameterAttribute controls how the names of any operation parameters and return values appear in the service description.

FaultContractAttribute

When a service implementation throws a FaultException, the WCF plumbing thereafter takes care of serializing that back to the consumer as a SOAP fault as follows:

-          FaultException is used to send untyped fault data back to the consumer.

-          FaultException<TDetail> is used to send typed fault data back to the client.  Clients catching the exception can access the detailed fault information by getting it from the exception objects’ Detail property.

This attribute can be applied to operations only and cannot be inherited.  It can be applied multiple times for multiple types of faults.

70-565 Passed

This morning I rolled the dice and wrote the 70-565 exam, Pro: Designing and Developing Enterprise Applications Using the Microsoft .NET Framework 3.5.

It was markedly different than the Fundamentals (70-536) exam that I sweated over last week.

This exam targeted the sort of knoweledge and instinct that you accumulate by building a variety of diverse systems on a MS platform.  If you have a wide breadth of experience, and have been keeping up with current techniques and technologies, then you likely have a pretty decent shot at passing this exam.

I can't offer any suggestions on study materials to use on this one, for obvious reasons.  I'd suggest reading over the exam summary, and if you find yourself thinking, "... done that... done that... done that... meant to do that.... done that... who doesn't do that? ... "  then I'll bet you're ready for this one.

70-536 Passed

Today I passed 70-536 Microsoft .NET Framework - Application Development Foundation.  It wasn't easy... but it wasn't hard either.

To study, I read the Microsoft Training Kit book cover to cover, and I used Transcender.  After I read a topic section, I used Transcender to test myself with all the questions the exam kit had for that particular section.

After I worked my way through all the material (about two weeks), I wrote the three pre-set exams in the Transcender kit.  I made general notes on what I missed, and went and wrote some code for each.

Finally, the night before the exam, I set Transcender to test me with every exam question I had previously gotten wrong. 

I got 76% on those questions.  It wasn't as high as I would have liked, and I was nervous about passing the real deal.  It all worked out.  Interestingly, I got 788/1000 on my exam... pretty much bang on with what I had been tracking in Transcender.

Even more interestingly... Last December I wrote the same exam without studying, just to see if I could do it.  I got 49%.  The night before, I wrote one of the practice exams, and got 48% on it.

So... anecdotal as it may be, in this particular case, those practice exams did an impressive job of predicting my actual test result.

In a few days, I'll clean up my study notes and post them here.  I find other peoples study notes to be useless, because the learning comes from organizing the information yourself, not from reading someone elses take on the material.  Nevertheless, please come back next week and have a look, and use them as you see fit.