About Web Service

Overview
Web services provide software developers access to functionality over the Internet. In addition to The Finder web site, we also provide web services to businesses wishing to enhance their existing software offerings with real-time Ohio tax rate lookups. Developers seeking to use these services should have a background in web services development.

Registration
To use our web services, consumers will need valid user credentials from the Ohio Business Gateway (OBG). If you do not have existing OBG credentials, please register. These credentials are required when using our web services. OBG credentials are only used for controlling access to the service. We do not track any transaction information when consumers use the service.

Usage
The Finder web services are located at https://thefinder.tax.ohio.gov/OHFinderService/OHFinderService.asmx. Here you can view a directory of available methods and detailed information on how to call them. For those familiar with web service standards, we have also provided the detailed WSDL for these methods. In addition, we have provided a test application for you to try out. Although it is a web application, it still calls the web service to lookup rates.

WS-Security

We implement the WS-Security standard for authenticating users of our web services. Since we use Secure Sockets Layer (SSL) for our web services, consumers can rest assured that their credentials will remain secure.

With WS-Security, the username/password is sent in the SOAP header of a web service request. Following is what a sample SOAP header looks like with the information. The body of the request is different depending on whether you're looking up an address or zip code.

<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:si="http://soapinterop.org/xsd"
  xmlns:ns5925="https://thefinder.tax.ohio.gov/OHFinderService">
<SOAP-ENV:Header>
    <wsse:Security>
        <wsse:UsernameToken>
            <wsse:Username>USERNAME</wsse:Username>
            <wsse:Password Type="wsse:PasswordText">PASSWORD</wsse:Password>
        </wsse:UsernameToken>
    </wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
  ...
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Following are some additional resources on WS-Security:

  1. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnglobspec/html/ws-security.asp
  2. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwssecur/html/understw.asp
  3. http://www-106.ibm.com/developerworks/webservices/library/ws-secure/
  4. http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf

Sample code for .Net
To help developers get a head start in consuming the web services, we have provided some sample .Net C# code. Our web service implements the open standard of WS-Security for authentication. This code sample and instructions are provided for users of Visual Studio.Net. If you are using some other development tool, you will have to alter the instructions accordingly.
  1. Install the latest version of Microsoft's Web Services Extensions (WSE)
  2. Create a new project in Visual Studio.Net
  3. From within Visual Studio, add a web reference to https://thefinder.tax.ohio.gov/OHFinderService/OHFinderService.asmx.
    With WSE installed, it will also generate WSE versions of web service stubs.
  4. Try out the sample code, substituting valid login/address data for the values in [brackets].
// Create new instance of web service reference using WSE
OHFinderServiceWse finderService = new OHFinderServiceWse();

// Create authentication token
UsernameToken tkn = new UsernameToken("[username]", "[password]",
    PasswordOption.SendPlainText);

// Add authentication token to web service request
finderService.RequestSoapContext.Security.Tokens.Add(tkn);

// Create new date for method calls
DateTime todayDate = new DateTime();

// Tax rate lookup by address...
Finder.AddressReturn addressReturn = finderService.GetOHSalesTaxByAddress(
    "[address]", "[city]", "[state abbr]", "[postal code]", "US",
    [tax amount], todayDate, [true/false]);
// addressReturn.addressResponse contains the standardized address
// addressReturn.taxResponse contains an array of tax return values

// Tax rate lookup by zip code...
Finder.ZipCodeReturn zipReturn = finderService.GetOHSalesTaxByZipCode(
    "[postal code]", [tax amount], todayDate, [true/false]);
// zipReturn.zipResponse contains the original zip code queried
// zipReturn.taxResponse contains an array of tax return values

Sample Code for Java (using Apache Axis)

Apache Axis is an open source SOAP (Simple Object Access Protocol) implementation that bills itself as a "reliable and stable base on which to build web services". While it is used primarily in building web services, it can also be used at the client level to facilitate calling web services. Sample code utilizing this tool is provided as one example of how a Java client can call a web service. It is particularly noteworthy in Java to mention that different toolsets can provide alternative approaches to calling web services. Please consult with your toolset vendor if you have questions about whether it can call web services.

The following instructions are for Java developers who are familiar with setting up and configuring Java for their particular platform:

  1. Download and install JDK 1.4+ or later if you do not already have it.
  2. Add a PATH entry to point to the Java "bin" directory. (optional)
  3. Download Axis Apache and install files to directory.
  4. Download Axis-wsse Apache and install files.
  5. Add CLASSPATH entry to point to the individual jar files within the Axis Apache "lib" directory and to the Axis-wsse jar file.
  6. Call the WSDL2Java utility in wsdl4j.jar to generate stub classes off of the WSDL.
  7. Modify OHFinderServiceSoapStub.java to include authentication information (see below).
  8. Create a test client to call the web services (see below).

OHFinderServiceSoapStub.java:
...
// In each individual method call, for getOHSalesTaxByAddress
// and getOHSalesTaxByZipCode, insert...
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[N]);  // N=number generated by WSDL tool
_call.setUsername("[username]");     // ADD: inserts username into call
_call.setPassword("[password]");     // ADD: inserts password into call
_call.setUseSOAPAction(true);

// ADD: Pass username/password via wsse cleartext
_call.setProperty(WsseClientHandler.PASSWORD_OPTION,
     WsseClientHandler.PASSWORD_CLEARTEXT);
...

Put together a client (TestClient.java)
import java.util.Calendar;
import gov.ohio.tax.thefinder.OHFinderService.*;

public class TestClient {
  public static void main(String[] args) throws Exception {
    OHFinderServiceLocator locator = new OHFinderServiceLocator();
    OHFinderServiceSoap stub = locator.getOHFinderServiceSoap();
    Calendar cal = Calendar.getInstance();
    cal.clear();
    cal.set(2005,0,1);  // Or some other date

    // Get tax amount for zip
    ZipCodeReturn resp = stub.getOHSalesTaxByZipCode("[zipcode]", [amount],
        cal, [true/false]);
    System.out.println(
        resp.getTaxResponse().getTaxResponse(0).getTotalSalesTaxAmount());

    // Get tax amount for address
    AddressReturn resp2 = stub.getOHSalesTaxByAddress("[address]", "[city]",
        "OH", "[zipcode]", "US", [amount], cal, [true/false]);
    System.out.println(
        resp2.getTaxResponse().getTaxResponse(0).getTotalSalesTaxAmount());
  }
}
This is a simple test used to illustrate how to call the web services using Java and Apache Axis.


Availability and Support
The web service will be available 24x7 excluding standard maintenance activities.  Technical support will be available from the hours of 8am-5pm EST.  The Ohio Department of Taxation will provide high-level technical support for client implementation issues and general questions regarding web services. Technical support on web service development will not be provided by ODT.  To use this service, developers should have a background in web services development. Please eMail your technical support questions at TheFinderHelp@tax.state.oh.us.

Disclaimer
For sales and use tax purposes, in conformity with the Streamlined Sales Tax Agreement and the Mobile Telecommunications Sourcing Act, vendors and sellers may rely on this information for use in the collection of sales or use tax based on the date used for the search. By providing this information, neither the State of Ohio nor the Ohio Department of Taxation assumes any liability for any errors or omissions, or in any other respect. If you feel there is an error or have questions regarding the information you have received, please e-mail the Department of Taxation at TheFinderHelp@tax.state.oh.us.