|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
IntroductionBeing a big advocate of learning by doing, I decided to teach myself ASP.NET and ASP.NET Web Services by writing a simple application. This article walks through the process of designing a simple ASP.NET Web Service to address a business need. A Disclaimer or TwoDisclaimer #1 - The information provided in this article and computer code has been gathered from publicly available sources, including the United States Social Security Administration Website. I make no warranties, express or implied, as to the accuracy of this information. Disclaimer #2 - SSN information is highly confidential. It should not be transmitted electronically in a non-secure format. This application is for educational purposes only. Using the codeTo use the Web Service, just add a Web Reference to it in your Project. After you've added the Web reference, you can use it just like any other class: Imports SsnValid
' ...
' Create a new SsnValidator object
Dim MyValidator As New SsnValid.SsnValidator
' Get the Results in an SsnResult variable
Dim MyResults As SsnValid.SsnResult = MyValidator.ValidateSsn(txtSsn.Text)
Step 1: Begin at the BeginningMy first step in designing this Web Service was to define the business problem. For this example, I decided to validate the structure of Social Security Numbers (SSN's). I began by researching the subject thoroughly on the Social Security Administration Website. The SSA provides quite a lot of information for employers to use in determining the validity of SSN's. Step 2: Define the RulesI used the information available on the SSA website to determine the rules for SSN validity. This information includes:
Step 3: Anticipated ResultsNow we decide what information we want to return. Based on the information available via the SSA website, I've decided on four fields:
Step 4: ImplementationThe implementation of the Web Service is simple in nature, and the code is well-documented. I won’t go too deeply into it, other than to provide a simplified flowchart of the logic for the
I’ve created an Access Database called Ssn.mdb which must be located in the project’s \bin directory. It contains information updated from the SSA website, effective 2/1/2004. Points of InterestFor me, the greatest point of interest was implementing the convoluted logic the government uses when assigning new SSN's. It made for some interesting development. Overall, I was pleasantly surprised at how easy it was to create a Web Service using ASP.NET. Originally I designed this Web Service to run against a SQL Server database, but downgraded it to Access to make this demonstration more portable. If there's enough interest, I can post the SQL Server/MSDE-capable version at a later date. History
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||