c# - Strange error when trying to start my WCF service with webHttpBinding -


i'm getting strange error when try connect wcf webhttpbinding service from web browser:

sendera:actionnotsupportedthe message action '' cannot processed @ receiver, due contractfilter mismatch @ endpointdispatcher. may because of either contract mismatch (mismatched actions between sender , receiver) or binding/security mismatch between sender , receiver. check sender , receiver have same contract , same binding (including security requirements, e.g. message, transport, none).

my app.config:

<services>   <service name="mynamespace.myservice">     <host>       <baseaddresses>         <add baseaddress="http://localhost:9091/myservice/" />       </baseaddresses>     </host>     <endpoint address="" binding="webhttpbinding" contract="mynamespace.imyservice" />   </service> </services> 

my method looks this:

[webget(uritemplate = "foo/{id}")] public string getfoo(string id) { ... 

ok - expect you're missing endpoint behavior needed - try config:

<behaviors>   <endpointbehaviors>     <behavior name="web">       <webhttp/>     </behavior>   </endpointbehaviors> </behaviors>     <services>   <service name="mynamespace.myservice">     <host>       <baseaddresses>         <add baseaddress="http://localhost:9091/myservice/" />       </baseaddresses>     </host>     <endpoint          address=""          behaviorconfiguration="web"         binding="webhttpbinding"          contract="mynamespace.imyservice" />   </service> </services> 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -