Does WCF (dotnet 4) require webHttpBinding to be able to easily return JSON?

bennieblanco

New Member
My service will be consumed by another application on the same box (Adobe AIR as it happens), and I can't run a server. I'm currently running a WCF service as a Windows service on the box to achieve this. No server means no REST (please do correct me if I'm wrong with any of this), but I still want my service to be able to return JSON.I've been doing research on this, and finding lots of people using REST services with webHttpBinding and then setting a JSON behaviour in the config, however for reasons above I believe I can't use REST. So with that as a background, my question is: Can a WCF service running as either basicHttpBinding, or WSHttpBinding (would like to avoid due to the overheads) return JSON without me having to hand roll it?If so, would someone be good enough to explain how?Here are the current details of my app.config for the service\[code\]<configuration><system.serviceModel><services> <service name="WcfProjectLibrary.ProjectService"> <endpoint address="" binding="wsHttpBinding" contract="WcfProjectLibrary.IProjectService"> <identity> <dns value="http://stackoverflow.com/questions/6662903/localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfProjectLibrary/ProjectService/" /> </baseAddresses> </host> </service></services><!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>--><behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="True"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="False" /> </behavior> </serviceBehaviors></behaviors></system.serviceModel></configuration>\[/code\]Thanks
 
Top