开发者

quick and dirty client/server communication in Silverlight

I'm building a few small prototypes in Silverli开发者_StackOverflowght and have quite a bit of .NET experience, but Ive never had the need to contact the server from Silverlight.

Im really just after a really quick solution for the purposes of prototyping and I'll be needing to call the server and do a few things, like serve a generated image from the server using post data, receive basic responses from the server, but nothing too fancy.

Is .NET RIA Services the best way to do this or is it overkill?

The documentation for RIA Services is huge, 1 hour long video introductions, 26-part series blogs, etc... seems like its overkill.

Is there a quick REST based project I could create, or should RIA services be the way to go?


If you want to just do basic HTTP you can use the WebClient class to GET and POST data. If you need more control over the requests you can use HttpWebRequest but this is somewhat of a pain if you don't need the extra control.

There are some features of WCF that allow you to create services that are easily callable by HTTP clients but this is not it's main goal.

If your server operations are very simple (or are already implemented as REST/HTTP) I would stick with that and use WebClient or HttpWebRequest. But if you want the convenience of client-side proxy classes that are used more like method calls, I would use the WCF infrastructure but WCF RIA services is probably not all that necessary.

Unless... you are working on a line of business application that uses things like validation rules, data binding, CRUD operations, etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜