Creating a Client-Server application using C# and Python - comments?
I want to move away from the myriad of excel sheets at work and develop a small application for asset tracking.
Initially I'd planned it as a web application, but have had comments from the primary users of the would-be application that they would muc开发者_开发百科h prefer a client application as they sometimes can't guarantee internet connectivity while on the road. This is fine.
I'm thinking of developing the server architecture as a RESTful service in Python and having a simple C# client on desktops to fetch and parse the JSON (which is then locally stored for offline access). I only really envisage a dozen people using it.
Can anyone see anything inherently wrong with this setup? I didn't want to have to develop my own socket server as I think further down the line it would be easier to develop other apps that utilise the API (phone apps, perhaps).
WCF Web API Anyone?
http://wcf.codeplex.com/wikipage?title=WCF%20HTTP
WCF Web API satisfies your needs quite well. Not only do you get first class support for .NET clients locally but you can run this REST service locally as a windows service.
[WebGet(UriTemplate = "")]
public List<Contact> Get()
{
var contacts = new List<Contact>()
{
new Contact {ContactId = 1, Name = "Phil Haack"},
new Contact {ContactId = 2, Name = "HongMei Ge"},
new Contact {ContactId = 3, Name = "Glenn Block"},
new Contact {ContactId = 4, Name = "Howard Dierking"},
new Contact {ContactId = 5, Name = "Jeff Handley"},
new Contact {ContactId = 6, Name = "Yavor Georgiev"}
};
return contacts;
}
精彩评论