The Washington Sales Tax Rate Library (WSRL) source code provides a sales tax rate lookup feature using the Department of Revenue's downloadable address and rate files. Its purpose is to provide a means of looking up tax rates using our downloadable files and can be used as a starting point for adding destination-based sales tax rate lookups to your application. For web applications such as shopping carts, you will need to develop a rate lookup service or extend the library to use a disk-based indexing scheme.
The following data files are required:
- address file
- ZIP+4 file short version
- rate file
Note: These files are available on our Download Sales Tax GIS Data page.
- NUnit, a test framework used by the library, is also required. NUnit can be downloaded and installed at http://nunit.org/documentation/.
Follow these steps to add the library to your Microsoft Visual Studio solution:
- From the File menu, add the library project to your solution by choosing File->Add->Add Existing Project.
- Navigate to the directory containing the WaRateFiles library and select the project file.
- In the Solution Explorer, right click on your project and select "Add Reference".
- Click on the project tab and add the WaRateFiles project.
To use the rate lookup library in your program, add "using WaRateFiles" to the file header. The rate lookup class is constructed as follows:
RateLookup lookup = new RateLookup(addressfileName, ratefileName, zipfileName, RateLookupEngine.STANDARDIZER, useShortcutEval);
|addressfileName||The path and filename of the address file.|
|ratefileName||The path and filename of the rate file.|
|zipfileName||The path and filename of the ZIP+4 file|
|RateLookupEngine||This enumeration has the values of SCAN, INDEX, or STANDARIZER. For SCAN and INDEX, the input address must be standardized to USPS format.|
|useShortcutEval||If true, the STANDARIZER lookup engine will not fully evaluate an address if all of the data for a ZIP or street have the same location code.|
The service will no longer halt if there is a problem with the update thread contacting the DOR GIS data download web page. ZIP codes of the form "-3" now return invalid argument instead of throwing an exception.
The changes in this release are mostly related to the service example. Result codes are more consistent and in some cases additional debugging information is returned. Custom performance counters can be enabled in the app.config file. Server statistic such as up time and requests processed can optional be remotely accessed.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.