com.avalara.avatax.services.address
Interface AddressSvcSoap

All Superinterfaces:
BaseSvcSoap, java.rmi.Remote
All Known Implementing Classes:
AddressSvcSoapStub

public interface AddressSvcSoap
extends BaseSvcSoap

Proxy interface for the Avalara Address Web Service. Requires a Web Service Deployment Descriptor (WSDD) configuration file at creation time named (for example the sample file avatax4j.wsdd) in the same directory as the project is running. The values in the file will be loaded as the default configuration information.

Example:

 [Java]
  EngineConfiguration config = new FileProvider("avatax4j.wsdd");
  AddressSvc AddressSvc = new AddressSvcLocator(config);

  AddressSvcSoap port = AddressSvc.getAddressSvcSoap(new URL("http://www.avalara.com/services/"));

  // Set the profile
  Profile profile = new Profile();
  profile.setClient("AddressSvcTest,4.0.0.0");
  port.setProfile(profile);

  // Set security
  Security security = new Security();
  security.setAccount("account");
  security.setLicense("license number");
  port.setSecurity(security);

 

See Also:
EngineConfiguration, FileProvider

Method Summary
 IsAuthorizedResult isAuthorized(java.lang.String operations)
          Checks authentication of and authorization to one or more operations on the service.
 PingResult ping(java.lang.String message)
          Verifies connectivity to the web service and returns version information about the service.
 ValidateResult validate(ValidateRequest validateRequest)
          Validates an address and returns a collection of possible ValidAddress objects in a ValidateResult object.
 
Methods inherited from interface com.avalara.avatax.services.base.BaseSvcSoap
getProfile, getSecurity, setProfile, setSecurity
 

Method Detail

validate

ValidateResult validate(ValidateRequest validateRequest)
                        throws java.rmi.RemoteException
Validates an address and returns a collection of possible ValidAddress objects in a ValidateResult object.

The ValidateRequest object includes a TextCase property that determines the casing applied to a validated address. It defaults to TextCase.Default.

Example:

 [Java]
  EngineConfiguration config = new FileProvider("avatax4j.wsdd");
  AddressSvcLocator AddressSvc = new AddressSvcLocator(config);

  AddressSvcSoap port = AddressSvc.getAddressSvcSoap(new URL("http://www.avalara.com/services/"));

  // Set the profile
  Profile profile = new Profile();
  profile.setClient("AddressSvcTest,4.0.0.0");
  port.setProfile(profile);

  // Set security
  Security security = new Security();
  security.setAccount("account");
  security.setLicense("license number");
  port.setSecurity(security);

  ValidateRequest request = new ValidateRequest();
  Address address = new Address();
  address.setLine1("900 Winslow Way");
  address.setLine2("Suite 130");
  address.setCity("Bainbridge Is");
  address.setRegion("WA");
  address.setPostalCode("98110-2450");
  request.setAddress(address);
  request.setTextCase(TextCase.Upper);

  ValidateResult result;
  result = port.validate(request);
  Address[] addresses = result.getValidAddresses().getValidAddress();
  System.out.println("Number of addresses returned is " +
         addresses == null ? "0" : Integer.toString(addresses.length));

 

Parameters:
validateRequest - a ValidateRequest object containing address data to be validated.
Returns:
a ValidateResult object containing a collection of zero or more validated addresses.
Throws:
java.rmi.RemoteException

ping

PingResult ping(java.lang.String message)
                throws java.rmi.RemoteException
Verifies connectivity to the web service and returns version information about the service.

NOTE:This replaces TestConnection and is available on every service.

Parameters:
message - for future use
Returns:
a PingResult object
Throws:
java.rmi.RemoteException

isAuthorized

IsAuthorizedResult isAuthorized(java.lang.String operations)
                                throws java.rmi.RemoteException
Checks authentication of and authorization to one or more operations on the service.

This operation allows pre-authorization checking of any or all operations. It will return a comma delimited set of operation names which will be all or a subset of the requested operation names. For security, it will never return operation names other than those requested (no phishing allowed).

Example:
isAuthorized("GetTax,PostTax")

Parameters:
operations - a comma-delimited list of operation names
Returns:
IsAuthorizedResult object
Throws:
java.rmi.RemoteException