Reputation: 568
I have created EF Data Services before but I'm receiving this message everytime I try and create a EF5 - WCF Service Application.
The operation 'ProcessRequestForMessage' 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 any other types of parameters.
When i try and debug I get the message. I am using VS2012
It was a while ago since i've used Data Services but looking at my old VS2010 project that works I have modified web.config to include a service with an endpoint with "System.Data.Services.IRequestHandler" as the contract.
I also tried it again aswell as changing the binding to a "webHttpBinding" That didn't seem to work either. Any ideas?
If all else fails i guess i can use Open Access ORM with its built in service generation tools because I can atleast get that working.
Best Regards
Chris Leach
Upvotes: 0
Views: 2061
Reputation: 31
I had the same error but I noticed that "Factory" attribute is missing in my service host markup file. So, click on your Data Service file and select "View Markup" and check is there Factory attribute and it is correct:
Before:
<%@ ServiceHost Language="C#" Debug="true"
Service="ServiceNamespace.ServiceClassName"
CodeBehind="ServiceClassName.svc.cs" %>
After:
<%@ ServiceHost Language="C#" Debug="true"
Service="ServiceNamespace.ServiceClassName"
Factory="System.ServiceModel.Activation.WebServiceHostFactory, System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
CodeBehind="ServiceClassName.svc.cs" %>
Upvotes: 1
Reputation: 4725
Add: Factory="System.Data.Services.DataServiceHostFactory, Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Upvotes: 3
Reputation: 568
Didn't figure this out directly however I downloaded the Demo Project from this website http://code.msdn.microsoft.com/windowsdesktop/WCF-Data-50-for-OData-v3-53074189 and modified the Data service then Voala. No more errors
Hope this helps others
Cheers for trying guys.
Upvotes: 0