developing an information server

  • Thread starter Thread starter Tom Leylan
  • Start date Start date
T

Tom Leylan

I'd like to find/have a discussion about the various ways an application
server could be implemented. So the upsides and downsides can be discussed.
In case I'm using the term wrong by "app server" I mean a centralized
"business information service" that could be readily accessed by client
software. Initially this would be on a LAN but (like everything) the
requirements would likely grow to permitting general Internet access.

It shouldn't require .Net to exist on the client and ideally it shouldn't
even require .Net to exist on the server. I'd like to use .Net to write it
but it doesn't "have to" hook into everything that .Net offers. I'd just
like the ability to accept requests for information and send it back.

(Don't know if I should go on until I get a response... but I probably
haven't provided enough information yet... so)

Generally speaking the server would return data fetched from a database but
of course where the information came from shouldn't be important to the
client requesting it. So let me provide a few simples examples. Naming the
server "myserver" it should be possible to request the following (but not
necessarily using this syntax):

myserver.WhatTimeIsIt
and the time on the server would be returned

myserver.GetClientsList
and a list of the clients (the details "name, address, etc." of which are
defined by the server) would be returned

myserver.GetClient(12345)
and information related to clientID 12345 would be returned

To be clear the client would not control the format of the returned data.
The server has certain information available, it publishes the format that
it will be in and the client simply requests it.

Additionally the server should accept information (for example):
myserver.UpdateClient(ProperlyFormattedClientData)

I'm probably just describing a "server" (sorry about that but everybody asks
"what do you want to do")

So it could be done with a webserver I suppose, it could be done with DCOM
right? It could be done with services that .Net have introduced I'm sure
but some solutions are hard, some cost a lot, some are very limited, some
are proprietary, etc., etc. I was hoping for cheap, fast, powerful, easy
and non-proprietary :-)

Is this a good place for such discussion? If not anybody have an idea where
a good spot would be? I'm looking for a discussion rather than a heated
argument.

Thanks,
Tom
 
How about a webservice?

..NET includes support for webservices. The easiest way to get started is to
use an ASP.NET webservice. The web service will be accessible via open
protocols, such as http, soap, xml. Any client technology supporting these
protocols will be able to access the "information service".

Using ASP.NET to implement your service, you would use an ASMX file. A
simple service might look like this:

<%@ WebService Language="C#" Class="PhoneInfo" %>

using System;
using System.Web.Services;

[WebService(Namespace="http://ionic.dyndns.org/webservices/")]
public class CustInfo: System.Web.Services.WebService {

[WebMethod(Description="retrieves customer Id for the given telephone
number. ")]
public int GetCustomerId(String phone)
{
int Id = DbLookupPhone(phone); // insert your db query logic here
return Id;
}
}

Using ASP.NET means you do need .NET installed on the server, but you do not
need .NET to be installed on client machines. (In general, if you are using
..NET to write an app, then you will need to have the .NET runtime installed
where you run the app.) The server app doesn't have to hook into everything
that .NET offers - just use what you want. If you use ASP.NET then you will
probably also use IIS to host the app. "Clients" can run on true desktop
machines (running Windows, or something else), and "clients" can run on
other server machines, so you can have server apps calling other server
apps, via the open web services protocols.

Your service can return custom types. The example above returns a plain
integer, but you could modify it to return any type you specify, eg
CustomerInfo, which might look like:

public class CustomerInfo {
public string FirstName;
public string LastName;
public string Address1;
public int CustomerId;
// etc
public int[] AccountNumbers;
public CustomerProfile Profile; // another (nested) custom type
}


The development of web services with .NET is fairly simple. The cost to run
them is not more than the cost of running a Windows Server.

For more information on web services,
http://msdn.microsoft.com/webservices/understanding/webservicebasics/default.aspx
 
Dino Chiesa said:
How about a webservice?

Dino: Thanks for your reply. I spent the weekend searching the Internet
and concluded this is probably what I was describing. I'm going to run out
and get books on XML-RPC and SOAP.
Using ASP.NET to implement your service, you would use an ASMX file. A
simple service might look like this:

<%@ WebService Language="C#" Class="PhoneInfo" %>

Even an example, thanks again. I'm going to read all about it, I'll get
something running in order to experiment but one concern is that if it
requires a separate ASMX file for every service then maintenance can become
bothersome. Considering all the information a typical business wants to
process (clients, orders, products, invoices, payments, etc.)

It seems to me that there has to be a single way in to the server such that
it can handle whatever request is sent to it. Maybe it will make more sense
when I read about it more.
The development of web services with .NET is fairly simple. The cost to run
them is not more than the cost of running a Windows Server.

Thanks again for all the info, I've bookmarked the link you provided and I'm
on my way to the bookstore.

Tom
 
Back
Top