0
votes

I have my silverlight calling my WCF service and its working great. This is a WCF (not ria) service that basically returns enitites or collection of entities.

I really don't have control over it to add additional items just for silverlight for example.

So i was thinking but maybe its bad performance or desgin..

But to have a local WCF Service hosted with the Asp.net website that hosts silverlight.. ANd i can use this wcf service for business logic that doesn't need to return entities. For example so silverlight can call to the server and then the server can do something with PURE .net.

Of course i still will need my silverlight to talk to my External WCF service that returns entities etc..

What would be the best way to implement this, if at all..

Silverlight calls local WCF service and "IF REQUIRED" local wcf service calls external WCF Service (which returns entities etc) and everything is returned back down the chain.

or Silverlight calls to local WCF service or to external WCF service depending on what is required.

There is a 3rd option but i am thinking aloud and maybe it wouldn't fit... But to have RIA services so silverlight could call this .... but again I CANNOT get rid of or have control over my other wcf service... So silverlight would need to call both OR ria services could call the wcf service ... But this is where i have a doubt... because RIA services normally return IQUERYABLE for example... My wcf service returns ILIST for example so if ria services called to my wcf service it would receive back an ILIST .. hence the [QUERY] attribute in ria services require me to return IQUERYABLE but it isn't possible because i am already in an ILIST.

I would really appreciate some feedback to weather i am completely missing the point or infact its a good idea.

The fact remains that silverlight sometimes needs to do standard stuff on the server but has nothing to do with dataaccess or entities... i have no control over the external wcf service so i can't just insert a new method specifically for silverlight when its needed..

Anybody use a similar system, PROS / CONS??

Thanks in advance

1

1 Answers

1
votes

I think your application should use only Ria Services and then Ria service should connect to the external service. Then all logic is on the server and your SL app has simple model of using services. You can think about is as all business logic is on the server.

What about returning IQueryable you always can "convert" list to IQueryable using linq, but I think you can return list from RIA Service - it shoudn't be a problem.