Pages

Men

rh

6/10/2012

What is Opearation Contract ?

The Operation contract attribute is defined in the System.ServiceModal namespace. it can be applied for only methods. It is used to declare the method as belonging to a service contract as with the Service Contract Attribute, The operation contract attribute  can be declared with the variety of named parameters that provides the control over the service description and message formats.

Named Parameters:-

Name :-
Specifies different namespace for the operation instead of using the default, which is the method name.

Action:-
Controls the action header for messages to this operation.

ReplyAction:-
Controls the action header for messages from the opearation.
IsOneway:-.
It indicates whether the operation is One way and has no reply. When the operation is One Way, Reply action is not supported.
ProtectionLevel:-
Enables the Service Contract to specify constraints on how messages to all operations in the contract are protected on the wire, that is whether they are signed and encrypted.

IsInitiating:-
It 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.

Example:-
[Servicecontract]
pubic interface SomeCrContact
{
   [OpearationContract(Isoneway = true) Action = "urn:crud:insert" ]
   void ProcessInsertMessage( Message message)

   [OpearationContract(Isoneway = true) Action = "urn:crud:Update" ]
   void ProcessUpdateMessage( Message message)

   [OpearationContract(Isoneway = true) Action = "urn:crud:Delete" ]
   void ProcessDeleteMessage( Message message)
}


No comments :

Post a Comment