Look Up Taxes
- Enter Code
Enter the following code in a file named ‘Lookup.cs’:
using System;using TaxControls;class Test{ public static void Main(){ try { CTaxControl tc = new CTaxControl(); String url="http://localhost:8000"; // using Plus Codes: String work="VXX7+39 Washington, DC 20500"; String home="VWCV+PF Washington, DC 20301"; String nexus="VA MD DC"; String taxes=tc.TaxQuery( work, home, url, nexus); foreach(String t in taxes.Split(",")){ Console.WriteLine(t); } } catch (TaxControlException e) { Console.WriteLine(e.Message); } }}
Enter the following code in a file named ‘Lookup.java’:
import com.boondocks.taxcontrols.TaxControl;import com.boondocks.taxcontrols.TaxControlException;public class Lookup{ public static void main(String[] args){ TaxControl tc = new TaxControl(); try{ String url="https://localhost:8443"; // using Plus Codes: String work="VXX7+39 Washington, DC 20500"; String home="VWCV+PF Washington, DC 20301"; String nexus="VA MD DC"; String taxes=tc.getTaxQuery( work, home, url, nexus); for (String t: taxes.split(",")){ System.out.println(t); } } catch (TaxControlException e){ e.printStackTrace(); } }}
Compile
Compile the code at the command prompt by executing the following:
csc /reference:TaxControls.dll Lookup.cs
javac -classpath .;bigloo_u.zip;TaxControls.jar Lookup.java
Start TaxQuery
Start up the TaxQuery container if it’s not already running:
docker run -p 8443:8443 calibertechnology/taxquery
The -p 8443:8443
argument tells the image to listen for an https connection on port 8443.
Run
Run the code by typing:
Lookup
java -classpath .;bigloo_u.zip;TaxControls.jar Lookup