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.
Note: These files are available on our Download Sales Tax GIS Data page.
Follow these steps to add the library to your Microsoft Visual Studio solution:
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);
|The path and filename of the address file.
|The path and filename of the rate file.
|The path and filename of the ZIP+4 file
|This enumeration has the values of SCAN, INDEX, or STANDARIZER. For SCAN and INDEX, the input address must be standardized to USPS format.
|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 check for available updated database files is now case insensitive.
An optimization was made with the file updates check to reduce the number of calls to the file download page.
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.
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.