I’ve created a simple WCF service inside of WebApplication project.
[ServiceContract(Namespace = "http://my.domain.com/service")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class MyService
{
[OperationContract]
public string PublishProfile(out string enrollmentId, string registrationCode)
{
enrollmentId = null;
return "Not supported";
}
built – everything is compiled successfully
After that I’ve tried to open service in browser, I’ve got the following error:
Operation ‘PublishProfile’ in contract ‘MyService’ specifies an ‘out’ or ‘ref’ parameter. Operations with ‘out’ or ‘ref’ parameters are not supported
Can’t I use ‘out’ parameters?
What is wrong here?
Thanks
P.S. I use VS2008 SP1, .NET 3.5
The problem in my case was that default service configuration created in my ASP.NET application with Visual Studio wizard was a service type. Endpoint binding was “webHttpBinding”. As far as I understand now it is binding for REST services, and they just don’t have physical ability to work with out parameters. For them out parameter is not supported. And what I actually needed was a ‘basicHttpBinding” that allows to work with out parameters.
Many thanks to everybody who helped me to figure out that.