Applied web services and .Net remoting
A thesis submitted in partial fulfillment of the requirements for the degree of
Master of Computer Science
University of Bridgeport
2002
Instructor: Prof. Ausif Mahmood
student id: 0552563
name: wengda
University of Bridgeport
Abstract
Applied web services and .net remoting
by wengda
Supervised by: Professor Ausif Mahmood
Department of Computer Science
A thesis presented on applying web services and .net remoting technology on Internet businesses and services. By creating the web service technology based Universal Personal Information Service and the .net remoting based Fast Delivery System, this project demonstrates how to take the advantages from the .Net framework to make more convenience and more scalable Internet businesses.
Chapter 1 - Requirement Analysis
1.1 Universal Personal Information service
Chapter 2 - Design and implementation
2.1 The Universal Personal Information service
2.1.1 Development environment and tools
2.1.4 Implementation of database
2.1.5 Implementation of ASP.Net web service
2.2.1 Development environment and tools
2.2.4 Implementation of database
2.2.5 Implementation of Fast-Delivery server side
2.2.6 Implementation of order client side
2.2.7 Implementation of delivery client side
2.2.8 Implementation of administration and analysis tool
The author wishes to express sincere appreciation to Professor Mahmood for his guide on this project. In addition, special thanks to my sister Jean for providing multiple PCs with high speed Internet connection for development and testing. Also thanks to Ms. Liu Yanchun who took care many trivia for me so I can concentrated on this project.
As the electricity became a dependent part of our life, we can safely predict that Internet will become a must part of our lives in the nearly feature. More and more people using Internet to help them doing various kinds of things, there will be more services required on the Internet; who provides better services will win more customers on their businesses.
To make a business-to-customer Internet business, there are several aspects to consider about:
Fortunately, with .net framework and web services technology, all these considers as above now have a better solution than ever before. Since web services use the platform-neutral standards such as HTTP and XML which allows the web service can be integrated in any web site or application regardless which platform they are running at. Thus, a web services provider can let his services can be easily reached and consumed at anytime and anywhere through the Internet. On the contrary, an application or a web site can integrate as many as web services inside to become an omni-functionality product without knowing the implementation details behind those web services. Using the .net remoting technology, we can get the messages and events from remote places. Through the HTTP protocol, even the firewall is not an obstacle for the remote communication. That makes people can corporate while working on the different places and can give in time response to the remote side. With the mature secure technology such as SSL and the WS-Security (the technology co-authored by VeriSign, Microsoft, and IBM which put a secure layer on the SOAP message), we can keep our data safe while it is in transfer or exchange. Provider also can add the authentication and authorization on the web services to prevent abuse of their services.
There is two major parts in this project; one is the Universal Personal Information services (UPI Services) which is ASP.net web services based personal information service to allow the personal users to give their information such as address and credit card no to various web sites or applications without doing register process over and over; another part is the Fast-Delivery system which is n-tiers common business model based on web services and .net remoting technologies. The Fast-Delivery system has a order service to serve ordering clients and a delivery service to serve many delivery sites allocated at different places; the order web service allows customers make their purchases through web pages or windows applications, once a customer made an order, the delivery site which is closest to the order's destination will be notified immediately, so that the delivery operators can make the in-time response. Since the order-delivery system is an n-tiers model, the presentation tier, the business logical tier and the data tier are separated, it can suit different order-delivery businesses which have different data (in databases or XML files) and different presentation interface (web pages or applications) by giving slightly or no code modification on the business logic tier.
The technologies are used in this project including:
Chapter 1 - Requirement Analysis
Since this project is composed by two major parts, I'd like to give the descriptions one by one, first is the UPI Service, then the Fast-Delivery system.
1.1 Universal Personal Information Service:
The first part of the project a web services technology base Universal Personal Information service. The goal of this service is to deal with the problem that when people try to make purchases on every first-visited web site they have to register on each web site. In most situations, people need to provide their personal information includes address, contact information and credit card number to each web site, and then they need to maintain all of these user accounts corresponding to different web site. Once a customer's information has changed, for example, Peter relocated to another state; he has to go to each web site to modify his information. It is hard for a personal user to keep all his or her information consistent.
To solve this inconvenience, UPI Service takes the advantages from web services to build a personal information web service which is adaptable to every web site regardless the platforms they stand on. With the standard HTTP and SOAP protocol, the UPI Service could be consumed on every web site or even the regular applications build by all kinds of languages. So once a user registered a UPI Service account, he can sign in on every web site regardless if he visited the web site before or if he has registered an account for that web site, as long as those web sites integrated UPI Service, the user can direct sign in by providing his UPI account.
For the purpose I mentioned above, the UPI Service needs to have the following features and functions:
The next major part of this project is Fast Delivery System, which is a .net remoting and web services technology based n-tiers modeled order-delivery system. The goal of this system is to find a solution to provide a common model which could make those order-delivery businesses have the best efficiency on response customers' requests and help the managers to analyze the sales and marketing situations. The system should have features and functions as following:
Chapter 2 - Design and implementation
In this chapter, I would like to descript about the design and implementation about my project. Since there are two major parts ¨C the Universal Personal Information Service and the Fast-Delivery system in this project; the UPI Service is an independent part and the Fast-Delivery system integrate the UPI Service as a part of service it provides; I'll present them one by one, first the UPI service, then the Fast-Delivery system.
2.1 The Universal Personal Information Service
2.1.1 Development environment and tools
As the requirement I presented in the requirement analysis chapter, the UPI Service should use HTTP and SOAP protocol to compatible with all kinds of platforms and can be integrated and consumed by other web sites and applications. Since the web services technology can provide all these features that suit the requirements, I decide to build the UPI Service base on the web services technology. Currently there are many tools could be used to build web services, for example, Microsoft .net framework, Sun's java framework and some others company's products. Considered the following reasons I chose the MS .Net framework as the develop environment; first, the IIS server and the .Net SDK are free downloaded from Internet; second, the ASP.NET web services is easily created, the .Net framework could generate WSDL and implement SOAP automatically; third, it is easy to test and debug ASP.NET web services, the .Net framework automatically generated web pages for testing the remote methods; fourth, there are MSDN and tons other documents to be used as references.
The major language could work with ASP.NET is C# and Visual Basic.Net, they are all based on Common Language Runtime and has no big difference on functionalities but the syntax of C# is similar to Java and the VB.net's syntax is more like the Visual Basic. Personally I prefer C#, so I chose C# as the development language to work on all of the ASP.NET web applications and windows applications in this whole project.
Although through the ODBC interface, we can let our web applications or Windows applications work with different databases; but considered using MS database product can give the ASP.NET and C# Windows applications the best match and highest performance since they are the products of the same company, I decided to use SQL Server 2000 as the database for this project.
The UPI Service should provide a bunch of remote web methods to be called from remote places. These remote methods of UPI Service can only be called with a valid key. The web site or application who wants to consume UPI web service must obtain a unique license key from UPI Service as a certificate to use the UPI Service remote calls. This way, unauthorized call will be prevent, that protect the UPI Service personal user's information.
The UPI Service consumers (web sites or applications) handle their users' requests and pass to UPI service; so the personal user can register an account, add/remove his/her information, and change his/her credit cards information. The consumer can get the user's information as well. Since only the consumer has a valid license key can get the user's information, personal user needn't worry about their information will be accessed by un-trusted web sites or applications.

diagram 2-1
In this project, UPI Service has its own web site. From there, the other web sites or applications may get their unique license keys to become valid UPI Service consumers. Each time an consumer makes a remote request to UPI Service, it must provide it's own license key; after the license has been verified, UPI Service may give a proper response to the request. Also personal users can register UPI account and modify all their information at the web site. The diagram is shown as below:

diagram 2-2
The functions we need here are:
The implementation of these functions is in chapter 2.1.3 ¨C 2.1.5.
There are four tables for UPI Service, the detail description listed as below:
• UserInfo Table: The table is used to store personal users' information including UPI account login name and password, actual name, address and contact information. The "LoginName" field is the primary key.
|
Field |
Type |
Description |
|
LoginName |
varchar(20) PK |
The login name of the UPI account |
|
LoginPass |
varchar(20) |
The login password of the UPI account |
|
|
varchar(50) |
The Email address of the user |
|
RegDate |
datetime(8) |
The time user create an account |
|
FirstName |
varchar(20) |
The First Name of the user |
|
MiddleName |
varchar(20) |
The Middle Name of the user |
|
LastName |
varchar(20) |
The Last Name of the user |
|
Street |
varchar(50) |
The street name of user's address |
|
City |
varchar(20) |
The city name of the user's address |
|
State |
varchar(2) |
The abbreviation of the states name |
|
Zip |
varchar(5) |
The zip code of the user's address |
|
Phone |
varchar(15) |
The user's phone number |
|
Mobile |
varchar(15) |
The user's mobile number |
• CardInfo Table: The table is used to store users' credit cards information.
|
Field |
Type |
Description |
|
Id |
int(4) id |
The identifier field |
|
LoginName |
varchar(20) FK |
The login name of the UPI account |
|
CardType |
char(1) |
The abbreviation of credit card type |
|
CardNo |
varchar(50) |
The credit card number |
|
Expiration |
datetime(8) |
The expiration date of the credit card |
|
HolderName |
varchar(20) |
The holder name of the credit card |
|
LastName |
varchar(20) |
The Last Name of the user |
• CardAG Table: The table is used to map the credit card type abbreviation to the full name of credit card type
|
Field |
Type |
Description |
|
cardtype |
char(1) PK |
The abbreviation of credit card type |
|
Fullcardtype |
varchar(20) |
The full name of credit card type |
• License Table: The table is used to store the license key for the UPI Service consumers. The "LicenseNo" field generator a unique id for every new registered company.
|
Field |
Type |
Description |
|
CompanyName |
varchar(50) PK |
The name of consumer of UPI Service |
|
LicenseNo |
uniqueidentifier(16) |
The license key corresponding to the consumers. The default value is created by newid() function. |
The following diagram shows the relationship between tables of UPI Service database:

diagram 2-3
2.1.4 Implementation of database
For the better performance purpose, all SQL queries are pre-build as stored procedures store in UPI database. The stored procedures' SQL scripts and descriptions are listed below:
|
-- ============================================= -- Create CheckEmail procedure -- ============================================= -- Check if thers exists a same Email when user tries -- to change his email address. -- @ifexist return a integer number greater than 0 -- when there exists same Email, otherwise -- return 0. CREATE PROCEDURE CheckEmail @LoginName varchar(20), @Email varchar(50), @IfExists INT OUTPUT AS SELECT @IfExists = 0 SELECT @IfExists = COUNT(LoginName) FROM UserInfo WHERE LoginName <> @LoginName and Email = @Email GO |
|
-- ============================================= -- Create CheckLicense procedure -- ============================================= -- Check if there the consumer provides valid license key -- If license key is valid, then return an integer number greater -- than 0, otherwise return 0. CREATE PROCEDURE CheckLicense @LicenseNo varchar(50), @IfExists INT OUTPUT AS SELECT @IfExists = 0 SELECT @IfExists = COUNT(CompanyName) FROM License WHERE CAST(LicenseNo AS VARCHAR(50)) = @LicenseNo GO |
|
-- ============================================= -- Create DeleteCard procedure -- ============================================= -- Delete credit card by given cardid CREATE PROCEDURE DeleteCard @CardId int AS DELETE CardInfo WHERE id = @CardId GO |
|
-- ============================================= -- Create DeleteUser procedure -- ============================================= -- Delete a user from database by given user login name CREATE PROCEDURE DeleteUser @LoginName varchar(20) AS DELETE CardInfo WHERE (LoginName = @LoginName) DELETE UserInfo WHERE (LoginName = @LoginName) GO |
|
-- ============================================= -- Create procedure GetCreditCard -- ============================================= -- Get a user's all credit card information by given the user' login name CREATE PROCEDURE GetCreditCard @Loginname varchar(20) AS SELECT CardInfo.id AS CardId, CardAG.fullcardtype AS CardType, CAST(MONTH(Expiration) AS VARCHAR(2)) + '/' + CAST(YEAR(Expiration) AS VARCHAR(4)) AS Expiration, CardInfo.CardNo, CardInfo.HolderName FROM CardInfo INNER JOIN CardAG ON CardInfo.CardType = CardAG.cardtype WHERE CardInfo.LoginName = @Loginname GO |
|
-- ============================================= -- Create GetLicense procedure -- ============================================= -- Check if there exists a match with the consumer's name, return -- empty string if exists the match. Otherwise insert the consumer's -- name into database, generate and return an unique license key -- to consumer CREATE PROCEDURE GetLicense @CompanyName varchar(50), @LicenseNo varchar(50) OUTPUT AS BEGIN IF((SELECT COUNT(CompanyName) FROM License WHERE CompanyName = UPPER(@CompanyName)) = 0) BEGIN INSERT INTO License (CompanyName) VALUES (UPPER(@CompanyName)) SELECT @LicenseNo = CAST(LicenseNo AS VARCHAR(50)) FROM License WHERE CompanyName = @CompanyName END ELSE SELECT @LicenseNo = '' END GO |
|
-- ============================================= -- Create procedure GetUserInfo -- ============================================= -- Get user's information includes user name, address and contact -- information by given account name and password CREATE PROCEDURE GetUserInfo @LoginName varchar(20), @LoginPass varchar(20) AS SELECT Email, FirstName, MiddleName, LastName, Street, City, State, Zip, Phone, Mobile FROM UserInfo WHERE LoginName = @LoginName and LoginPass = @LoginPass GO |
|
-- ============================================= -- Create InsertCard procedure -- ============================================= -- Insert a credit card's information into database CREATE PROCEDURE InsertCard @LoginName varchar(20), @CardType char(1), @CardNo varchar(50), @Expiration datetime, @HolderName varchar(20) AS INSERT INTO CardInfo (LoginName, CardType, CardNo, Expiration, HolderName) VALUES (@LoginName, @CardType, @CardNo, @Expiration, @HolderName) GO |
|
-- ============================================= -- Create InsertUser procedure -- ============================================= -- Create an new user account and insert all user's information. CREATE PROCEDURE InsertUser @LoginName varchar(20), @LoginPass varchar(20), @Email varchar(50), @FirstName varchar(20), @MiddleName varchar(20), @LastName varchar(20), @Street varchar(50), @City varchar(20), @State char(2), @Zip char(5), @Phone varchar(15), @Mobile varchar(15) AS INSERT INTO UserInfo (LoginName, LoginPass, Email, RegDate, FirstName, MiddleName, LastName, Street, City, State, Zip, Phone, Mobile) VALUES (@LoginName, @LoginPass, @Email, GETDATE(), @FirstName, @MiddleName, @LastName, @Street, @City, @State, @Zip, @Phone, @Mobile) GO |
|
-- ============================================= -- Create InsertUserAccount procedure -- ============================================= -- Create an user account CREATE PROCEDURE InsertUserAccount @LoginName varchar(20), @LoginPass varchar(20) AS INSERT INTO UserInfo (LoginName, LoginPass, RegDate) VALUES (@LoginName, @LoginPass, GETDATE()) GO |
|
-- ============================================= -- Create UniqueEmail procedure -- ============================================= -- Check if thers exists a same Email when user is creating an -- new account. -- Return an integer number greater than 0 when there exists -- same Email address, otherwise return 0. CREATE PROCEDURE UniqueEmail @Email varchar(50), @IfExists INT OUTPUT AS SELECT @IfExists = 0 SELECT @IfExists = COUNT(LoginName) FROM UserInfo WHERE Email = @Email GO |
|
-- ============================================= -- Create UniqueLoginName procedure -- ============================================= -- Check if thers exists a same LoginName. -- Return an integer number greater than 0 when find a match, -- otherwise return 0. CREATE PROCEDURE UniqueLoginName @LoginName varchar(20), @IfExists INT OUTPUT AS SELECT @IfExists = 0 SELECT @IfExists = COUNT(LoginName) FROM UserInfo WHERE LoginName = @LoginName GO |
|
-- ============================================= -- Create procedure InsertUserInfo -- ============================================= -- Update an user's information CREATE PROCEDURE InsertUserInfo @LoginName varchar(20), @Email varchar(50), @FirstName varchar(20), @MiddleName varchar(20), @LastName varchar(20), @Street varchar(50), @City varchar(20), @State char(2), @Zip char(5), @Phone varchar(15), @Mobile varchar(15) AS UPDATE UserInfo SET Email = @Email, FirstName = @FirstName, MiddleName = @MiddleName, LastName = @LastName, Street = @Street, City = @City, State = UPPER(@State), Zip = @Zip, Phone = @Phone, Mobile = @Mobile WHERE LoginName = @LoginName |
|
-- ============================================= -- Create procedure UpdateUserPass -- ============================================= -- Change user password CREATE PROCEDURE UpdateUserPass @LoginName varchar(20), @LoginPass varchar(20) AS UPDATE UserInfo SET LoginPass = @LoginPass WHERE LoginName = @LoginName GO |
|
-- ============================================= -- Create VerifyAccount procedure -- ============================================= -- Check if thers exists a same LoginName. -- Return an integer number greater than 0 -- when find a match, otherwise return 0. CREATE PROCEDURE VerifyAccount @LoginName varchar(20), @LoginPass varchar(20), @IfExists INT OUTPUT AS SELECT @IfExists = 0 SELECT @IfExists = COUNT(LoginName) FROM UserInfo WHERE LoginName = @LoginName and LoginPass = @LoginPass GO |
2.1.5 Implementation of ASP.Net web service
There are eight remote methods that could be called by remote consumers. The details of these remote methods are listed below:
|
AddCreditCard Method: Add a new credit card for a given account. public string AddCreditCard( string licenseno, string loginname, string cardtype, string cardno, string expiration, string holdername ); Parameterslicenseno The specified license key to access UPI web method. loginname The user name of the account to add a credit card. cardtype The credit card type. Take "A" as "American Express", "D" as "Discovery", "M" as "Master", "V" as "Visa". cardno The credit card number. expiration The expiration date of the credit card. Take a formatted string as "MM/YY" or "MM/YYYY". holdername The credit card's holder name. Return ValueA blank string if the new credit card added successfully, otherwise return a string contains the error message. ExampleThe following example demonstrates how to add a credit card for the account whose user name is "dragonfly". The credit card's card type is "Master", card number is "1234567890123456", expiration date is "Augest/2005", holder name is "Tom White". The license key is "09CEFFC3-7118-4E98-8F73-2B85C7D5F293". UPIService.CreateUserAccount("09CEFFC3-7118-4E98-8F73-2B85C7D5F293", "dragonfly", "M", "1234567890123456","08/05","Tom White"); |
|
CreateUserAccount Method: Create a new user account by given user name and password. public string CreateUserAccount( string licenseno, string loginname, string loginpass ); Parameterslicenseno The specified license key to access UPI web method. loginname The user name of the account to be created. loginpass The password of the account to be created. Return ValueA blank string if the new account created successfully, otherwise return a string contains the error message. ExampleThe following example demonstrates how to add a new user account which takes "dragonfly" as user name and "time2000" as password. The license key is "09CEFFC3-7118-4E98-8F73-2B85C7D5F293". UPIService.CreateUserAccount("09CEFFC3-7118-4E98-8F73-2B85C7D5F293", "dragonfly", "time2000"); |
|
DeleteCreditCard Method: Delete a specified credit card from database. public string DeleteCreditCard( string licenseno, string cardid ); Parameterslicenseno The specified license key to access UPI web method. cardid The id number corresponding to the credit card to be deleted. Return ValueA blank string if the credit card deleted successfulyl, otherwise return a string contains the error message. RemarkUse GetCreditCart method to get a user's credit card id. ExampleThe following example demonstrates how to delete a credit card from database. In this sample, the credit card id is "30". The license key is "09CEFFC3-7118-4E98-8F73-2B85C7D5F293". UPIService.CreateUserAccount("09CEFFC3-7118-4E98-8F73-2B85C7D5F293", "30"); |
|
DeleteUserAccount Method: Delete an user account by given user name and password. public string DeleteUserAccount( string licenseno, string loginname, string loginpass ); Parameterslicenseno The specified license key to access UPI web method. loginname The user name of the account to be deleted. loginpass The password of the account to be deleted. Return ValueA blank string if the account deleted successfully, otherwise return a string contains the error message, . ExampleThe following example demonstrates how to delete an user account which takes "dragonfly" as user name and "time2000" as password. The license key is "09CEFFC3-7118-4E98-8F73-2B85C7D5F293". UPIService.DeleteUserAccount("09CEFFC3-7118-4E98-8F73-2B85C7D5F293", "dragonfly", "time2000"); |
|
GetCreditCard Method: Get all credit cards information of given user. public DataSet GetCreditCard( string licenseno, string loginname ); Parameterslicenseno The specified license key to access UPI web method. loginname The given user name to get his or her credit cards information. Return ValueA DataSet which contains all credit cards information of the given user. RemarkThe datafields in the dataset are "Card id", "Card Type", "Card Number", "Expiration Date", "Holder Name" in sequence. In C#, use following code to get each field's content: DataRow row1 = dataset1.Tables[0].Rows[0]; string cardid = row1["id"].ToString(); string cardtype = row1["CardType"].ToString(); string cardnumber = row1["CardNo"].ToString(); string expiration = row1["Expiration"].ToString(); string holdername = row1["HolderName"].ToString(); Example[Visual Basic, C#]The following example demonstrates how to get all credit cards information of an user whose user name is "dragonfly". The license key is "09CEFFC3-7118-4E98-8F73-2B85C7D5F293". UPIService.CreateUserAccount("09CEFFC3-7118-4E98-8F73-2B85C7D5F293", "dragonfly"); |
|
GetUserInfo Method: Create a user's infomation by given user name and password. public DataSet GetUserInfo( string licenseno, string loginname, string loginpass ); Parameterslicenseno The specified license key to access UPI web method. loginname The user name of the user to get his/her information. loginpass The password of the user to get his/her information. Return ValueA DataSet contains user's information. RemarkThe datafields in the dataset are "E-mail address", "First Name", "Middle Name", "Last Name", "Street", "City", "State", "Zip", "Phone Number", "Mobile Number" in sequence. In C#, use following code to get each field's content: DataRow row1 = dataset1.Tables[0].Rows[0]; string email = row1["Email"].ToString(); string firstname = row1["FirstName"].ToString(); string lastname = row1["LastName"].ToString(); string middlename = row1["MiddleName"].ToString(); string street = row1["Street"].ToString(); string city = row1["City"].ToString(); string state = row1["State"].ToString(); string zip = row1["Zip"].ToString(); string phone = row1["Phone"].ToString(); string mobile = row1["Mobile"].ToString(); ExampleThe following example demonstrates how to add a new user account which takes "dragonfly" as user name and "time2000" as password. The license key is "09CEFFC3-7118-4E98-8F73-2B85C7D5F293". UPIService.CreateUserAccount("09CEFFC3-7118-4E98-8F73-2B85C7D5F293", "dragonfly", "time2000"); |
|
UpdatePass Method: Update a user's password. public string UpdatePass( string licenseno, string loginname, string loginpass ); Parameterslicenseno The specified license key to access UPI web method. loginname The user name of the account to be updated password. loginpass The password string to be updated. Return ValueA blank string if the new password updated successfully, otherwise return a string contains the error message. ExampleThe following example demonstrates how to update a new user's password. In this example the user name is "dragonfly" and new password is "time2000". The license key is "09CEFFC3-7118-4E98-8F73-2B85C7D5F293". UPIService.CreateUserAccount("09CEFFC3-7118-4E98-8F73-2B85C7D5F293", "dragonfly", "time2000"); |
|
UpdateUserInfo Method: Update a user's information. public string UpdateUserInfoCard( string licenseno, string loginname, string email, string firstname, string middlename, string lastname, string street, string city, string state, string zip, string phone, string mobile ); Parameterslicenseno The specified license key to access UPI web method. loginname The user name of the account to be updated his/her information. E-mail address. firstname The user's first name. middlename The user's middle name. lastname The user's last name. street Street of user' address. city City of user's address. state State of user's address, only abbreviation accepted. For example, only accept "CT" for "Connecticut". zip Zip code of user's address. phone User' phone number. mobile User's mobile number. Return ValueA blank string if the user's information updated successfully, otherwise return a string contains the error message. ExampleThe following example demonstrates how to update a user's information whose user name is "dragonfly", email address is "dragonfly@msn.com", real name is "Tom White", address is "682 Atlantic street, Bridgeport, CT, 06604", phone number is "203-3326180". The license key is "09CEFFC3-7118-4E98-8F73-2B85C7D5F293". UPIService.UpdateUserInfo("09CEFFC3-7118-4E98-8F73-2B85C7D5F293", "dragonfly", "dragonfly@msn.com", "Tom", "", "White", "682 Atlantic street","Bridgeport","CT","06604","2033326180"); |
2.1.5 Implementation of ASP.Net user controls
To make the presentation part and coding part of UPI Service be separated logically, to let the consumers of UPI Service who use ASP.NET technology in their web sites can integrate and update UPI Service easy and fast, there are six ASP.Net user controls ready to work. The consumer can modify these user controls' style to suit their web sites without modify any inside code. An example we can see is the Fast-Delivery's web site, it integrated UPI Service in the web site and take the advantage of the reusable of ASP.Net user controls ¨C just drag the user controls on to the web pages and specify some simple arguments for them.
The detail descriptions for UPI Service ASP.Net user controls are listed below:
|
Name: register.ascx: used for to create an new user account. Screenshot:
Arguments: AddUserInfoUrl: The relative URL of the page which contains the userinfo user control. After user clicked the "Submit" button, the page contains the register user control will be redirected to the URL which specified by the AddUserInfoUrl string. |
|
Name: login.ascx used for an personal user login to access his or her information. Screenshot:
Arguments: ModifyUserInfoUrl: The relative URL of the page which contains the userinfo user control. After user clicked the "Submit" button, the page contains the login user control will be redirected to the URL which specified by the ModifyUserInfoUrl string. AddNewUserUrl: The relative URL of the page which contains the register user control. After user clicked the "New User? " link, the page contains the login user control will be redirected to the URL which specified by the AddNewUserUrl string. |
|
Name: userinfo.ascx used for personal user modifying his/her information. Screenshot:
Arguments: ChangeCreditcardUrl: The relative URL of the page which contains the changecreditcard user control. After user clicked the "Add/Remove Credit Card" link, the page contains the userinfo user control will be redirected to the URL which specified by the ChangeCreditcardUrl string. ChangePassUrl: The relative URL of the page which contains the changepassword user control. After user clicked the "Change Password" link, the page contains the userinfo user control will be redirected to the URL which specified by the ChangePassUrl string. SignoutUrl: The relative URL of the page which will be shown after user sign out. After user clicked the "Sign Out" button, the page contains the userinfo user control will be redirected to the URL which specified by the SignoutUrl string. |
|
Name: changecreditcard.ascx used for personal user add or delete his/her credit card information Screenshot:
Arguments: ChangeUserInfoUrl: The relative URL of the page which contains the userinfo user control. After user clicked the "Change user information" link, the page contains the changecreditcard user control will be redirected to the URL which specified by the ChangeUserInfoUrl string. SignoutUrl: The relative URL of the page which will be shown after user sign out. After user clicked the "Sign Out" button, the page contains the changecreditcard user control will be redirected to the URL which specified by the SignoutUrl string. |
|
Name: changepassword.ascx allow user change his/her login password. Screenshot: Arguments: ChangeUserInfoUrl: The relative URL of the page which contains the userinfo user control. After user clicked the "Change user information" link, the page contains the changepassword user control will be redirected to the URL which specified by the ChangeUserInfoUrl string. SignoutUrl: The relative URL of the page which will be shown after user sign out. After user clicked the "Sign Out" button, the page contains the changepassword user control will be redirected to the URL which specified by the SignoutUrl string. |
|
Name: deleteuser.ascx allow user cancel their UPI account. Screenshot:
Arguments: (None) |
UPI Service has its own web site at http://jasduke.remoteserver.org/UPIWebSite/.
This web site itself is a good example for consuming UPI web services and ASP.Net user controls. Besides a consumer can get a license key from it and personal user can register and use his/her account, this web site also provides all documents and source code of UPI Service.
The web service description (WSDL) for UPI Service is located at http://localhost/UPIService/UPIService.asmx?WSDL.
2.2.1 Development environment and tools
As the requirement of Fast-Delivery System I presented in the requirement analysis chapter, the Fast-Delivery System is a multi-tiered system and there will be frequent network communication between different tiers of this system. I chose .Net framework as the platform for this system because: first, so far .Net framework provides the best support for RPC (remote procedure call) technology; second, it's integrated HTTP protocol and TCP protocol inside and can generate SOAP messages automatically; third, it provides the best support for distribution system development; fourth, since the assemblies of .Net need not to be registered in Windows system, it is easier for develop and debug; the application domain concepts allows a server use different application domains to contact different clients with different protocols; the using of configuration files allows the system suit different environment without recompile but switch the setting files.
The develop language is C# and the database is SQL Server 2000. Besides the advantage I mention in 2.1.1, C# also can take advantages for ADO.NET, and SQL Server 2000 can give a perfect match for that.
The use case diagram for Fast-Delivery could be very simple: customers order some items from Fast-Delivery system, after the Fast-Delivery system verify user's UPI account and get user's information from UPI Service, the order will be sent to the proper operator, then the operator delivery items to customers.

diagram 2-4
The more detail things about Fast-Delivery system will like the diagram I drew below: There is an order client which actually is an asp.net web site to be accessed by customers to order items. This order client runs in its own application domain which could be at remote place. There are delivery clients run in their own application domains also; in this project, the delivery client is a Windows application. The order-delivery server has two application domains, one for order service and one for delivery service. The order service use HTTP protocol to communicate with order client so that the order service could works as a web service that compatible with other platforms; the delivery service use TCP protocol to communicate with delivery clients so that there will be more efficient transfer in the network inside the company. The order service notifies delivery service when an order comes. The database service serves both order and delivery service and communicate with the database.

diagram 2-5
According diagram 2-5, I split the Fast-Delivery system into several assemblies, shown as the following diagram 2-6:

diagram 2-6
In the diagram 2-6, we can see, the DataAccess assembly and Orders assembly are two independent assemblies. The DataAccess assembly is used to manipulate the data in database. In Orders assembly, there are two modules ¨C Order and Order Detail; the order includes a list of items and each order detail of an oreder corresponding to an item in the list.
The Order Service assembly and Delivery Service assembly depend on Orders assembly and DataAccess assembly. The Order Service and Delivery Service should be called remotely, and the Order instance and Order Detail instance should be remote objects which could be passed in the network.
The Order-Delivery Server is a host for Order Service and Delivery Service.
The Fast-Delivery web site need Order Service, Orders and UPI assembly to work. The Delivery client needs the Delivery Service and Orders assemblies as well.
There is also an administration and data analysis tool, it could be build as a remote application though. This tool should be used by system administrator and/or manager of the order-delivery business. It is an independent part of the Fast-Delivery system. Shown as the following diagram:

diagram 2-7
There are totally five tables in Fast-Delivery system, the diagram of the relationship between them showed as below:

diagram 2-8
The details of these tables are listed as below:
• Order Table: The table is used to store the information including the customer's UPI account, the receiver's address and contact information, the time of the order arrived and the time of the order has been processed(delivered).
|
Field |
Type |
Description |
|
OrderId |
Int(4) PK |
The identifier for an order |
|
LoginName |
varchar(20) |
The login name of the UPI account |
|
FullName |
varchar(50) |
The receiver's name |
|
Street |
varchar(50) |
The street name of receiver's address |
|
City |
varchar(20) |
The city name of the receiver's address |
|
State |
varchar(2) |
The abbreviation of the states name |
|
Zip |
varchar(5) |
The zip code of the receiver's address |
|
|
varchar(50) |
The Email address of sender |
|
Phone |
varchar(15) |
The phone number of sender |
|
OrderInTime |
datatime(8) |
The time of order arrived |
|
OrderOutTime |
datatime(8) |
The time of order has been processed |