views:

288

answers:

2

I have a silverlight client accessing data through ado.net data services. One of my queries has a number of expand clauses, and gets back quite a number of entries. The xml response is enormous, and I'm looking for ways to make this more efficient.

I have tried:

  • Paging (not an option for this behaviour)
  • Http compression (some client pcs are running IE6)
  • Doing the expands as separate queries and joining the entities later (this improved things a little)

Is it possible to use JSON as a transport format with the silverlight client? I haven't found anything about this on the web...

+1  A: 

You can see the demonstration of using JSON in silverlight in the below link

http://timheuer.com/blog/archive/2008/05/06/use-json-data-in-silverlight.aspx

I am not sure how much performance gain is achieved by using JSON. I definitely remember that ado.net services does JSON.

CodeToGlory
ADO data services will happily serve json to any client.Silverlight will happily consume json from any server.My problem is that the ADO.Net Data Services Client for Silverlight appears to be tied to the ATOM format.
Rob Fonseca-Ensor
A: 

Well. I got a chance to talk to Tim Heuer about this, who awesomely went and asked Pablo Castro for me. Thanks Tim!

JSON can't be used by the Silverlight client, but Silverlight 3 will be using binary xml by default to talk to web services. Rawr.

One other thing i worked out for myself was that using expand can sometimes result in a lot more data than performing multiple requests. If you batch a few queries together and then hand-stitch the objects together, you can save quite a bit of xml.

Rob Fonseca-Ensor