Changes on the configuration of WCF to use JSON
A long time ago I wrote a post on how to configure a WCF service so that it uses JSON as its serialization format. It seems like things change in the last CTP. I still didn't had the time to look into everything but it seems like now you don't add a <bindings> element in order to use JSON. So, what this means is that you'll need something like this to get JSON:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="TestBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="jsonBehavior" >
<enableWebScript/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="TestBehavior" name="Test">
<endpoint address="" binding="webHttpBinding" behaviorConfiguration="jsonBehavior" contract="ITest"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
If you compare this with the old post entry, you'll see that you no longer have the <bindings> element and we have also dropped the bindingConfiguration attribute on the <endpoint> element. Another thing I've noticed when I've re-run my old code is that now it seems like the return object is wrapped in another anonymous object which only has one property which points to the element that was returned from your service.
Still no time to investigate on why this is happening...if anyone knows, please put it in the comments since I won't really have much time to investigate into this...
Update: after receiving feedback from Christian Weyer, I've rerun my samples in a new project created with beta 2. Everything is working ok with this new project, so i think that the problem was with my old project...