tags:

views:

98

answers:

1

Hello,

For some reason, I have the idea that a client can ask a WCF service for the request to be of a certain format. Is this possible or do I need to create the same method with different signatures for each different response type?

For instance, if a Silverlight client accesses my WCF service, I want to using binary encoding. However, if my WCF service is called via JQuery or ASP.NET AJAX, I want to return JSON. Is this possible?

Thank you!

+1  A: 

You are talking about the binding used, and yes, it is possible to host using multiple bindings. If you're talking about hosting in IIS, and you want binary serialised output, you'll need to be running on Windows Server 2008 and use Windows Process Activation Services (WAS).

You'd be accessing a different endpoint address in each case (e.g. net.tcp://... versus http://...).

David M