com.avalara.avatax.services.address
Class AddressSvcSoapStub

java.lang.Object
  extended by org.apache.axis.client.Stub
      extended by com.avalara.avatax.services.base.BaseSvcSoapStub
          extended by com.avalara.avatax.services.address.AddressSvcSoapStub
All Implemented Interfaces:
AddressSvcSoap, BaseSvcSoap, java.rmi.Remote, javax.xml.rpc.Stub

public class AddressSvcSoapStub
extends BaseSvcSoapStub
implements AddressSvcSoap

Axis-generated class that implements the proxy interface AddressSvcSoap for contacting 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. Note: This class is not meant to be instantiated directly. Instead the preferred usage is to obtain an instance of it (as a AddressSvcSoap interface via the AddressSvcLocator.getAddressSvcSoap(java.net.URL) method.

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

Field Summary
 
Fields inherited from class com.avalara.avatax.services.base.BaseSvcSoapStub
PASSWORD_TEXT_TYPE, WSSE_NAMESPACE
 
Fields inherited from interface javax.xml.rpc.Stub
ENDPOINT_ADDRESS_PROPERTY, PASSWORD_PROPERTY, SESSION_MAINTAIN_PROPERTY, USERNAME_PROPERTY
 
Constructor Summary
AddressSvcSoapStub()
          Initializes a new instance of the class; preferred usage is to obtain an instance of it (as a AddressSvcSoap interface via the AddressSvcLocator.getAddressSvcSoap(java.net.URL) method.
AddressSvcSoapStub(javax.xml.rpc.Service service)
          Initializes a new instance of the class; preferred usage is to obtain an instance of it (as a AddressSvcSoap interface via the AddressSvcLocator.getAddressSvcSoap(java.net.URL) method.
AddressSvcSoapStub(java.net.URL endpointURL, javax.xml.rpc.Service service)
          Initializes a new instance of the class; preferred usage is to obtain an instance of it (as a AddressSvcSoap interface via the AddressSvcLocator.getAddressSvcSoap(java.net.URL) method.
 
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 class com.avalara.avatax.services.base.BaseSvcSoapStub
getProfile, getSecurity, setProfile, setSecurity
 
Methods inherited from class org.apache.axis.client.Stub
_createCall, _getCall, _getProperty, _getPropertyNames, _getService, _setProperty, addAttachment, clearAttachments, clearHeaders, extractAttachments, getAttachments, getHeader, getHeaders, getPassword, getPortName, getResponseHeader, getResponseHeaders, getTimeout, getUsername, removeProperty, setHeader, setHeader, setMaintainSession, setPassword, setPortName, setPortName, setTimeout, setUsername
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.avalara.avatax.services.base.BaseSvcSoap
getProfile, getSecurity, setProfile, setSecurity
 

Constructor Detail

AddressSvcSoapStub

public AddressSvcSoapStub()
                   throws org.apache.axis.AxisFault
Initializes a new instance of the class; preferred usage is to obtain an instance of it (as a AddressSvcSoap interface via the AddressSvcLocator.getAddressSvcSoap(java.net.URL) method.

Throws:
org.apache.axis.AxisFault

AddressSvcSoapStub

public AddressSvcSoapStub(java.net.URL endpointURL,
                          javax.xml.rpc.Service service)
                   throws org.apache.axis.AxisFault
Initializes a new instance of the class; preferred usage is to obtain an instance of it (as a AddressSvcSoap interface via the AddressSvcLocator.getAddressSvcSoap(java.net.URL) method.

Parameters:
endpointURL -
service -
Throws:
org.apache.axis.AxisFault

AddressSvcSoapStub

public AddressSvcSoapStub(javax.xml.rpc.Service service)
                   throws org.apache.axis.AxisFault
Initializes a new instance of the class; preferred usage is to obtain an instance of it (as a AddressSvcSoap interface via the AddressSvcLocator.getAddressSvcSoap(java.net.URL) method.

Parameters:
service -
Throws:
org.apache.axis.AxisFault
Method Detail

validate

public ValidateResult validate(ValidateRequest validateRequest)
                        throws java.rmi.RemoteException
Description copied from interface: AddressSvcSoap
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));

 

Specified by:
validate in interface AddressSvcSoap
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

public PingResult ping(java.lang.String message)
                throws java.rmi.RemoteException
Description copied from interface: AddressSvcSoap
Verifies connectivity to the web service and returns version information about the service.

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

Specified by:
ping in interface AddressSvcSoap
Parameters:
message - for future use
Returns:
a PingResult object
Throws:
java.rmi.RemoteException

isAuthorized

public IsAuthorizedResult isAuthorized(java.lang.String operations)
                                throws java.rmi.RemoteException
Description copied from interface: AddressSvcSoap
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")

Specified by:
isAuthorized in interface AddressSvcSoap
Parameters:
operations - a comma-delimited list of operation names
Returns:
IsAuthorizedResult object
Throws:
java.rmi.RemoteException