Tuesday, February 16, 2010

WCF

3 core type of contracts maps to Web-Services:
  • Service contracts map to WSDL
  • Data contracts map to XSD
  • Message contracts map to SOAP
namespace : System.ServiceModel

Options for ServiceContractAttribute:
Name : Specifies a different name for the contract instead of the default.
Namespace : Specifies a target namespace in WSDL for the service. The default namespace is http://tempuri.org
CallbackContract : Associate another service contract as a Callback Contract.
Protection Level : Enables service contract to specify constraints on how message to all operations in the contract are protected on wire.
ConfigurationName:
SessionMode : Specifies whether sessions should be enabled by the endpoint exposing this Service contract.

Options for OperationContractAttribute provide control over service description and message formats:
Name : Other than default
Action : Controls the action header for messages to this operation.
ReplyAction : Controls the action header for response message from this operation.
IsOneWay :
ProtectionLevel :
IsInitiating : Indicates whether invoking the operation initiates a new session between the caller and the service.
IsTerminating :Indicates whether invoking the operation terminates an existing session between the caller and the service.

MessageParameterAttribute namespace System.ServiceModel

Controls how the name of any operation parameters and return values appears in the service description.
Name :

Fault Contract

WCF FaultException Class

FaultException
FaultException


The FaultContractAttribute

The attribute can be applied to oerationis only.
No Inherited.

Message Exchange Patterns


Request/Response
void method mean empty SOAP body.

OneWay
Declare IsOneWay property on the OperationContractAttribute to true.

Cannot be used in conjunction with the FaultContract attribute.
Cannot be used to return transaction contexts.
With queued message delivery this is only choice.
This does not conform to the asynchronous, send-and-forget semantics.
Duplex
 

No comments: