FFLNearYou
FFLNearYou.asmx
This
web service provides a method to return FFL extension records based on the
distance of a zip code. This can be useful when trying to find the
nearest FFL licensee that accepts drop shipments. The distance is calculated based on the
latitude and longitude values in the zip code table. The latitude and longitude
in the zip code table represent the geo location center of the zip code area.
Therefore, the calculated distance of a customer or ship-to to a particular zip
code is not 100% correct but it is good enough for most situations.
A configuration switch controls whether only FFL holders that accept transfers are returned. This is set through the FindFFLOnlyAcceptTransfer key.
FindFFL
This method uses the relational engine to execute SQL commands and retrieve FFL holders based on the zip code in a certain distance range.
Usage:
FindFFLResult = A.FindFFL(UserName, UserPassword, ZipCode, MaxDistance, GetAttribute, AttributeWebFlag, GetNotes, NotesWebFlag, GetLinks, GetEcontact, OrderBy, AdditionalWhere, AdditionalParameters)
Parameters UserName and UserPassword are not used at this moment.
Input Parameter
Parameter |
Type |
Detail |
zipCode |
String |
Required. Must be a valid 5-digit zip code in the United States. |
maxDistance |
Double |
Required. Indicates the return FFL licensee records must be within the maximum distance from the zip code. |
getAttribute |
String |
Specify Y to retrieve the corresponding attributes for the FFL e Extension records. This can be helpful if you have certain attribute information to return on the searching result. Do not indicate “Y” unless you need the data. Otherwise, performance can slow down unnecessarily. |
attributesWebFlag |
String |
If you specify Y to previous parameters, this specifies the criteria that the attribute must be a web attribute before being returned. |
getNotes |
String |
Similar to getAttribute, but for notes. This can be helpful if you have notes that describe the FFL holder to return on the search result. Do not indicate “Y” unless you need the data. Otherwise, performance can slow down unnecessarily. |
notesWebFlag |
String |
Similar to attributesWebFlag but for notes. |
getLinks |
String |
Specify “Y” to retrieve links. Do not indicate “Y” unless you need the data. Otherwise, performance can slow down unnecessarily. Indicating “Y” will also return any images on file for the FFL extension record. |
getEcontact |
String |
“Y” to retrieve eContacts. Do not indicate “Y” unless you need the data. Otherwise, performance can slow down unnecessarily. |
orderBy |
String |
This is the additional order by clause. Specify the FFL extension dataset columns. If you wish to sort by distance, specify “DISTANCE.” The data is sorted by “ARFFLEXT_SEARCH_RANK, DISTANCE” by default. |
additionalWhere |
String |
This is the additional where clause when retrieving data from the FFL licensee file or the FFL extension file. |
additionalParameters |
String |
Not used at this time. |
FindResellerResult Structure
Property |
Type |
Detail |
ReturnCode |
Integer |
Contains return code. Zero means OK; for other return codes, please see “EliloginService Return Code” section. |
AttributeTemplates |
Dataset |
|
ShipToFFLs |
DataSet |
Contains the following datasets: Ffl, Attributes, EContacts, Links, Notes, and Images. For detail information of the dataset table, please refer to the following section. |
AttributeTemplates Structure
When getAttribute = “Y.” This table contains the same column heading as SYATRFIL table. It will contains all attribute code records if the return dataset when you set getAttribute = “Y.”
Property |
Detail |
SYATRFIL_CODE |
|
SYATRFIL_DESC_1 |
|
SYATRFIL_DESC_2 |
|
SYATRFIL_REF_1_FLAG |
|
SYATRFIL_REF_1_LIT |
|
.. |
|
SYATRFIL_REF_5_FLAG |
|
SYATRFIL_REF_5_LIT |
|
SYATRFIL_DATE_1_FLAG |
|
SYATRFIL_DATE_2_LIT |
|
… |
|
SYATRFIL_AMT_1_FLAG |
|
SYATRFIL_AMT_1_LIT |
|
… |
|
ShipToFFLs Structure
Property |
Detail |
Ffl |
Dataset with return records and columns in ARFFLEXT and ARFFLFIL tables. |
Attributes |
Dataset with return records and columns in SYATTRIB table. |
EContact |
Dataset with return records and columns in SYCONREL and SYCONTCT tables. |
Links |
Dataset with return records and columns in SYLNKFIL table. |
Notes |
Dataset with return records and columns in NOTES table. |
Images() |
Structure with image file name and binary data representing the images associated with the FFLX link. |
Ffl Structure
Property |
Detail |
ARFFLEXT_FFL_NO |
8-digit FFL number. |
ARFFLFIL_FFL_NO |
15-digit FFL number. |
ARFFLFIL_LIC_NAME |
FFL licensee name. |
ARFFLFIL_BUS_NAME |
FFL licensee business name. |
ARFFLFIL_PREM_STREET |
FFL licensee premises street. |
ARFFLFIL_PREM_CITY |
FFL licensee premises city. |
ARFFLFIL_PREM_ST |
FFL licensee premises state. |
ARFFLFIL_PREM_ZIP |
FFL licensee premises zip code. |
ARFFLFIL_PHONE_NO |
FFL licensee phone number. |
FFL_EXP_DATE_ON_FILE |
FFL expiration date on file from the FFL extension file. |
BATF_EXP_DATE |
Expiration date derived from the 15-digit FFL number. |
ARFFLEXT_COMMENT1 |
Comment 1 |
ARFFLEXT_COMMENT2 |
Comment 2 |
ARFFLEXT_COMMENT3 |
Comment 3 |
ARFFLEXT_COMMENT4 |
Comment 4 |
ARFFLEXT_COMMENT5 |
Comment 5 |
ARFFLEXT_ACCEPT_TRSF |
Whether the FFL Licensee accepts drop ship orders: Y=Yes, N=No, Space = Undetermined. |
DISTANCE |
Distance from the zip code specified in the passing parameters. |
Images Structure
Property |
Detail |
FileName |
File name of the image file including extension. |
ImageBytes |
This field contains the image from the FFL extension link. Even though image is binary in nature, the web services are based on XML and can’t directly transmit binary data. Therefore, you will convert byte array to the image’s binary format in order to display it. |
Code Example
The following sample codes will return customers’ records within a 20-mile distance from zip code 91789.
Dim Service As New webServicesReseller.FFLNearYou
Dim Result As New webServicesReseller.FindFFLResult
Result = Service.FindFFL("", "", "91789", 20, "", "", "", "", "", "", "DISTANCE", "", "")
If Result.ReturnCode = 0 Then
lblResult.Text = "FFLs Found"
Else
lblResult.Text = "Error! Error code: " + Result.ReturnCode.ToString
End If
FFLNearYou Return Code
0 = OK (No Error),
30000 = Database Error
30001 = No Record Found
30002 = General Error
CLS