When adding the service reference to some WCF based service, it can happen that generated reference does not contain any or some of operations. To illustrate this take a look on following contract definition.
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] [ServiceContractAttribute(Namespace="http://schemas... /", ConfigurationName="ServiceReference1.MyService")] public interface IMyService { [OperationContractAttribute(Action="http://schemas/MyOperation”, ReplyAction="*")] OperationResponse MyOperation(OperationRequest request); } |
The services IMyservice defines the operation with name MyOperation. If you try to add the service reference to this service, the reference will be created, but without operation.
The problem is in definition of Reply Action attribute, which is defined for operation. In this case the action is defined as:
ReplyAction="*"
To workaround the problem replace the “*” with “”.
Finally the operation contract should look like:
[OperationContractAttribute(Action="http://schemas/MyOperation”, ReplyAction="")]
OperationResponse MyOperation(OperationRequest request);
This issue happens when you create the contract definition from WSDL and then create the service from created contract definition.
Posted
Aug 30 2011, 06:25 PM
by
Damir Dobric