com.avalara.avatax.services.address
Interface AddressSvc

All Superinterfaces:
javax.xml.rpc.Service
All Known Implementing Classes:
AddressSvcLocator

public interface AddressSvc
extends javax.xml.rpc.Service

In the the Axis scheme, interface implemented by the object (AddressSvcLocator) that wraps the actual functional Address Service proxy (AddressSvcSoapStub).

See Also:
AddressSvcLocator, AddressSvcSoap, AddressSvcSoapStub

Method Summary
 AddressSvcSoap getAddressSvcSoap()
          Get a proxy for Avalara's Address Web Service (object implementing the AddressSvcSoap interface) using the default URL as coded in the class or programatically set.
 AddressSvcSoap getAddressSvcSoap(java.net.URL portAddress)
          Get a proxy for Avalara's Address Web Service using the specified URL.
 java.lang.String getAddressSvcSoapAddress()
          Retrieve as a String the default URL set for the Address Service to use.
 
Methods inherited from interface javax.xml.rpc.Service
createCall, createCall, createCall, createCall, getCalls, getHandlerRegistry, getPort, getPort, getPorts, getServiceName, getTypeMappingRegistry, getWSDLDocumentLocation
 

Method Detail

getAddressSvcSoapAddress

java.lang.String getAddressSvcSoapAddress()
Retrieve as a String the default URL set for the Address Service to use.

Returns:
Address service URL as a string.

getAddressSvcSoap

AddressSvcSoap getAddressSvcSoap()
                                 throws javax.xml.rpc.ServiceException
Get a proxy for Avalara's Address Web Service (object implementing the AddressSvcSoap interface) using the default URL as coded in the class or programatically set.

Example:

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

  AddressSvcSoap port = AddressSvc.getAddressSvcSoap();

  // 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));

 

Returns:
Throws:
javax.xml.rpc.ServiceException
See Also:
AddressSvcSoapStub, AddressSvcSoap

getAddressSvcSoap

AddressSvcSoap getAddressSvcSoap(java.net.URL portAddress)
                                 throws javax.xml.rpc.ServiceException
Get a proxy for Avalara's Address Web Service using the specified URL.

Example:

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

  AddressSvcSoap port = AddressSvc.getAddressSvcSoap(new URL("Enter Avatax URL"));

  // 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:
portAddress - URL to use for the AddressService.
Returns:
Throws:
javax.xml.rpc.ServiceException
See Also:
AddressSvcSoapStub, AddressSvcSoap