Question of the Day: what is the action for my OperationContract?
Answer: if not set explicitly, the action is contractNamespace + contractName + “/” + operationName. For responses, tack on “Response” at the end of this string.
By default, contractNamespace == “http://tempuri.org/”, contractName == class name, and operationName == method name. These names can be specified explicitly through ServiceContractAttribute.Namespace, ServiceContractAttribute.Name, and OperationContractAttribute.Name respectively.
As an example, if you have the following operation:
ServiceContract
]class
MyService{
OperationContract
]public string
SampleHello(string
name){
return string
.Format(“Hello {0}.”, name);}
}
the request action is http://tempuri.org/MyService/SampleHello
, and the response action is http://tempuri.org/MyService/SampleHelloResponse
.
Alternatively, you can specify the action(s) of your method with the Action and ReplyAction parameters to OperationContract (i.e. [OperationContract
(Action=”myAction”, ReplyAction=”myReplyAction”)]
Pingback: mattonsoftware.com : .NET Resources
Pingback: kennyw.com » Blog Archive » Using Overloaded Operations in your ServiceContract