• Feeds

    Subscribe in a reader

  • Ads

WebHttpBehavior vs WebScriptBehavior

If you want to use the [WebGet]/[WebInvoke] programming model in WCF, you need an endpoint with the right binding and the right endpoint behavior.

The binding is the out-of-the-box WebHttpBinding. The endpoint behavior can be either WebHttpBehavior or WebScriptEnablingBehavior.

What's the difference between the two?

The WebHttpBehavior is a general-purpose behavior that supports UriTemplate dispatch and POX/JSON/byte stream formats on the wire. Use it for general purpose HTTP/REST/Web-Style services.

The WebScriptEnablingBehavior is a "profile" of the WebHttpBehavior functionality designed specifically for interop with ASP.NET AJAX clients. It adds in some AJAX-isms like the ability to automatically generate ASP.NET AJAX client proxies.

#1 Stefan S. on 9.04.2007 at 3:37 PM

steve thanks for you informations. will try out it sometimes.

#2 Sean Gahan on 9.17.2007 at 9:54 PM

I have an off topic question; the other day I wrote a WCF application in aspnetcompatibilitymode=”true” and if I made a request via my asp.net project the WCF would see the cache, but if I made the same request via a forms application the WCF application would not see the cache.I know this is a bit off topic from your post, but what do you think?Best regards,Sean Gahanhttp://seangahan.net