FreeJobAlert

FreeJobAlert.Com

Government Jobs | Results | Admit Cards

Advertisement

Explain the MessageParameterAttribute with example

The MessageParameterAttribute, defined in the System.ServiceModel namespace, controlshow the names of any operation parameters and return values appear in the service description. This attribute has only one property, the Name property [OperationContract()] [return: MessageParameter(Name = "responseString")]string SomeOp([MessageParameter(Name = "string")]string s); In the above code MessageParameterAttribute is used with this parameter to control how both the parameter and return values are serialized to XML requestand response elements at the transport layer. You need to use the Name property because the variable name as is cannot be used in the target programming language

Tags: wcf basics, wcf interview questions, wcf in .net, wcf service, wcf endpoint, wcf endpoint contract, wcf service contract, wcf operationcontract