开发者

WCF Ajax enabled for any client

开发者 https://www.devze.com 2023-02-12 05:00 出处:网络
I need to expose several WCF services, but these services have to be used from any client(WPF, Explorer,Chrome, AJAX) and the client generation to开发者_如何学Pythonols or the aspects related to secur

I need to expose several WCF services, but these services have to be used from any client(WPF, Explorer,Chrome, AJAX) and the client generation to开发者_如何学Pythonols or the aspects related to security must be applicable . I need an architectural/technical piece of advice about what would be the best approach: tools, architecture, etc... to solve this problem.

As I know, with WCF services there are many different options to do this, but if for instance, the data is exposed in an AJAX-enabled way, I dont know the side problems or limitations that this generates on the usage of the WCF for non-AJAX clients.

any suggestions are welcome.

Thanks in advance


In my opinion, AJAX really refers to how the client application accesses data. AJAX (async javascript and XML) isn't really AJAX anymore, as it seems that JSON is the preferred format of the payload instead of XML since it's more streamlined.

I think from your WCF service perspective, you really need to decide what data format or formats you will expose your data as. Will it be XML, JSON, some other text format? I'm not really sure what you mean by data exposed in an AJAX-enabled way, but if you're going for cross-platform access to your data, you probably want to expose your services as RESTful services. Take a look at the WCF Web HTTP (REST) features in the .NET 4 Framework (MSDN documentation here) to help guide you in developing RESTful services that lend themselves to a number of AJAX-enabled client frameworks.

Probably the biggest limitation with using the WCF Web HTTP model is that you don't have the WS-* features of security and messaging that you have with SOAP-based WCF programming. Again, you have to determine what your security and other needs are for your application. But those are the two main 'chunks' of WCF programming -- SOAP/WS-* and Non-SOAP/REST. (That's a generalization and I'm sure there are probably some exceptions.)

Exposing your services as RESTful services lends itself to a number of client-side frameworks, such as jQuery, the WCF Data Services (OData) client frameworks, Silverlight/WPF, etc. Lots of options and not tied to the .NET framework.

I hope this helps. Let me know if I need to clarify some points.

Thanks!

0

精彩评论

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