c# - 2 WCF services, 1 common interface, multiple headaches -


I have 2 WCF services which apply an interface to a different library. Interface methods are not marked with the WebGet or WebInvoke attribute, but one service is going to handle the POST request, while the other GET is handling the request. So it looks like this:

Service 1: All posts request handles the request is in JSON, the response is in JSON all methods inherited from the interface and they are marked with WebInvoke

< P> Service 2: All GET handles the request The request is in JSON, the response is JSONP with all methods inherited from the interface and are marked with WebGet

So far so good Now let's fire these people. I think the error Is:

  In Operation 'SomeMethod' contract, 'IServiceContract' contains both WebGetAttribute and WebInvokeAttribute; Only one can exist  

Hmmm, it would be understandable that the actual interface was already marked with one or both attributes, but it is not.

Double Hmmmm: This setup works perfectly well. If you create a WCF service through VS then apply the other service and markup all the methods.

Triple Hmmmmmmmm: If I only remove WebGet attribute from my JSONP service (leaving WebNew on JSON service), it works. This is what happens if I remove the WebInvoc attribute from my JSON service.

Edit : Another strange thing, only one service throws this error (my JSON / GET service), while the regular JSON / POST service works.

Have you tried to extract references to the project in which the agreement (interface) and adding it again

I am thinking that this is a project reference you are using?


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -