开发者

WCF using REST, having some binding questions

开发者 https://www.devze.com 2022-12-29 01:54 出处:网络
I am really confused right now and I can\'t get any right answers anywhere. My confusions are: 1) Isn\'t wsHttpBinging (which is beefed up basicHttpBinding) used in SOAP instead of REST and REST onl

I am really confused right now and I can't get any right answers anywhere.

My confusions are:

1) Isn't wsHttpBinging (which is beefed up basicHttpBinding) used in SOAP instead of REST and REST only uses webHttpBinding?

2) Also, DOES silverlight 4 with WCF (REST) support wsHttpBinding (VS2010)? I read that it does not everywhere on the net but I some how got silverlight 4 working with REST using wsHttpBinding. NOTE: I am using Factory="System.ServiceModel.Activation.WebServiceHostFactory". Is this factory setting somehow bypassing my web.config setting for wsHttpBinding t开发者_Go百科o make it work with webHttpBinding and i am thinking by my wsHttpBinding is working?

Thank you.


WCF uses SOAP by default - all binding except the webHttpBinding use SOAP.

If you want to do REST, you need to use the webHttpBinding.

1) Isn't wsHttpBinging (which is beefed up basicHttpBinding) used in SOAP instead of REST and REST only uses webHttpBinding?

Yes - wsHttpBinding is a SOAP-based protocol - webHttpBinding is REST

2) Also, DOES silverlight 4 with WCF (REST) support wsHttpBinding (VS2010)?

Silverlight 4 supports basicHttpBinding (SOAP), netTcpBinding (new in SL4 - SOAP) and webHttpBinding (REST).

NOTE: I am using Factory="System.ServiceModel.Activation.WebServiceHostFactory". Is this factory setting somehow bypassing my web.config setting for wsHttpBinding to make it work with webHttpBinding and i am thinking by my wsHttpBinding is working?

Yes, if you use the WebServiceHostFactory in your SVC file, then you're really getting the webHttpBinding (REST) implicitly. The WCF runtime will not look at your web.config for infos - it has all the information and settings it needs when you use WebServiceHostFactory - and you get webHttpBinding.

0

精彩评论

暂无评论...
验证码 换一张
取 消