Follow by Email

Service Contract (ServiceContract) Attributes/properties of WCF in framework 4.0

ServiceContract has about 6 properties/attributes.

Service Contract Attributes

1.      CallbackContract:

2.      ConfigurationName:

3.      Name: This is used to provide the name to the service contract by which client will call it.

4.      Namespace: The namespace property is really an XML term. It allows you to maintain uniqueness with elements. So you can have multiple elements of the same tag name but they are completely different as long as they have different namespaces.

5.      ProtectionLevel: it is System.Net.Security.ProtectionLevel which defines the protection level of 
       the service contract. It has three modes.
a.      EncryptAndSign: It ensures that data will be encrypted & signed before it is transmitted.
b.      None: Data will not be signed nor encrypted & it is transmitted as it is.
c.       Sign: Data will only signed before it is transmitted.
6.      SessionMode: It Specifies that whether service contracts supports session or not.
      It has three modes
a.       Allowed: It specifies that if incoming binding supports session then it supports the session.
b.      NotAllowed: It specifies that contract will never support session & the never support 
the binding that initiates the session.
c.       Required: It specifies that contract needs session & exception is thrown if binding do not support the session.


Post a Comment