I have a WCF recreation service with two OperationContracts as follows:
[OperationContract] [WebGet(UriTemplate = "ping/")] Message PingServer(); [OperationContract] [WebGet(UriTemplate = "files/")] Message AddFile(string accessKey);
When I am http: //localhost/rest.svc/ping/ , it works fine, and if I am http: //localhost/rest.svc/files/ it works fine.
However, if I come directly to http: //localhost/rest.svc , it throws the following error:
System.InvalidOperationException: The exception was caused by a WSDL export extension call: System.ServiceModel.Description.DataContractSerializerOperationBehavior contract: http://tempuri.org/:IRest ----> System.InvalidOperationException: the AddFile operation could not be loaded because it has a parameter or return type of type System.ServiceModel.Channels.Message or a type that has MessageContractAttribute and other parameters of different types. When using System.ServiceModel.Channels.Message or types with MessageContractAttribute, the method must not use other types of parameters.
I understand the error, but wondered how to fix / suppress it so that it displays the default WCF endpoint page. I just use WCF for REST only.
Thanks!
Jeffrey Kevin Pry
source share