com.avalara.avatax.services.tax
Class TaxSvcSoapStub

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

public class TaxSvcSoapStub
extends BaseSvcSoapStub
implements TaxSvcSoap

Axis-generated class that implements the proxy interface TaxSvcSoap for contacting the Avalara Tax 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 TaxSvcSoap interface via the TaxSvcLocator.getTaxSvcSoap(java.net.URL) method.

 Example:
 [Java]
 EngineConfiguration config = new FileProvider("avatax4j.wsdd");
 TaxSvcLocator taxSvcLoc = new TaxSvcLocator(config);

 TaxSvcSoap svc = taxSvcLoc.getTaxSvcSoap(new URL("http://www.avalara.com/services/"));

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

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


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
TaxSvcSoapStub()
          Initializes a new instance of the class; preferred usage is to obtain an instance of it (as a TaxSvcSoap interface via the TaxSvcLocator.getTaxSvcSoap(java.net.URL) method.
TaxSvcSoapStub(javax.xml.rpc.Service service)
          Initializes a new instance of the class; preferred usage is to obtain an instance of it (as a TaxSvcSoap interface via the TaxSvcLocator.getTaxSvcSoap(java.net.URL) method.
TaxSvcSoapStub(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 TaxSvcSoap interface via the TaxSvcLocator.getTaxSvcSoap(java.net.URL) method.
 
Method Summary
 AdjustTaxResult adjustTax(AdjustTaxRequest adjustTaxRequest)
          *
 ApplyPaymentResult applyPayment(ApplyPaymentRequest applyPaymentRequest)
          This method is used to apply a payment to a document for cash basis accounting.
 CancelTaxResult cancelTax(CancelTaxRequest cancelTaxRequest)
          Cancels a previously calculated tax; This is for use as a compensating action when posting on the client fails to complete.
 CommitTaxResult commitTax(CommitTaxRequest commitTaxRequest)
          Commits a previously posted tax.
 GetTaxResult getTax(GetTaxRequest getTaxRequest)
          Calculates taxes on a document such as a sales order, sales invoice, purchase order, purchase invoice, or credit memo.
 GetTaxHistoryResult getTaxHistory(GetTaxHistoryRequest getTaxHistoryRequest)
          Retrieves a previously calculated tax document.
 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.
 PostTaxResult postTax(PostTaxRequest postTaxRequest)
          Posts a previously calculated tax
 ReconcileTaxHistoryResult reconcileTaxHistory(ReconcileTaxHistoryRequest reconcileTaxHistoryRequest)
          Reconciles tax history to ensure the client data matches the AvaTax history.
 
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

TaxSvcSoapStub

public TaxSvcSoapStub()
               throws org.apache.axis.AxisFault
Initializes a new instance of the class; preferred usage is to obtain an instance of it (as a TaxSvcSoap interface via the TaxSvcLocator.getTaxSvcSoap(java.net.URL) method.

Throws:
org.apache.axis.AxisFault

TaxSvcSoapStub

public TaxSvcSoapStub(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 TaxSvcSoap interface via the TaxSvcLocator.getTaxSvcSoap(java.net.URL) method.

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

TaxSvcSoapStub

public TaxSvcSoapStub(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 TaxSvcSoap interface via the TaxSvcLocator.getTaxSvcSoap(java.net.URL) method.

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

getTax

public GetTaxResult getTax(GetTaxRequest getTaxRequest)
                    throws java.rmi.RemoteException
Description copied from interface: TaxSvcSoap
Calculates taxes on a document such as a sales order, sales invoice, purchase order, purchase invoice, or credit memo.
The tax data is saved Sales Invoice and Purchase Invoice document types GetTaxRequest.getDocType().

Specified by:
getTax in interface TaxSvcSoap
Parameters:
getTaxRequest - -- Tax calculation request
Returns:
GetTaxResult object
Throws:
java.rmi.RemoteException

getTaxHistory

public GetTaxHistoryResult getTaxHistory(GetTaxHistoryRequest getTaxHistoryRequest)
                                  throws java.rmi.RemoteException
Description copied from interface: TaxSvcSoap
Retrieves a previously calculated tax document.

This is only available for saved tax documents (Sales Invoices, Purchase Invoices).

A document can be indicated solely by the PostTaxRequest.getDocId() if it is known. Otherwise the request must specify all of PostTaxRequest.getCompanyCode(), see PostTaxRequest.getDocCode() and PostTaxRequest.getDocType() in order to uniquely identify the document.

Specified by:
getTaxHistory in interface TaxSvcSoap
Parameters:
getTaxHistoryRequest - a GetTaxHistoryRequest object indicating the document for which history should be retrieved.
Returns:
a GetTaxHistoryResult object
Throws:
java.rmi.RemoteException

postTax

public PostTaxResult postTax(PostTaxRequest postTaxRequest)
                      throws java.rmi.RemoteException
Description copied from interface: TaxSvcSoap
Posts a previously calculated tax

This is only available for saved tax documents (Sales Invoices, Purchase Invoices).

A document can be indicated solely by the PostTaxRequest.getDocId() if it is known. Otherwise the request must specify all of PostTaxRequest.getCompanyCode(), PostTaxRequest.getDocCode(), and PostTaxRequest.getDocType() in order to uniquely identify the document.

Specified by:
postTax in interface TaxSvcSoap
Parameters:
postTaxRequest - a PostTaxRequest object indicating the document that should be posted.
Returns:
a PostTaxResult object
Throws:
java.rmi.RemoteException

commitTax

public CommitTaxResult commitTax(CommitTaxRequest commitTaxRequest)
                          throws java.rmi.RemoteException
Description copied from interface: TaxSvcSoap
Commits a previously posted tax.

This is only available for posted tax documents (Sales Invoices, Purchase Invoices). Committed documents cannot be changed or deleted.

A document can be indicated solely by the CommitTaxRequest.getDocId() if it is known. Otherwise the request must specify all of CommitTaxRequest.getCompanyCode(), CommitTaxRequest.getDocCode(), and CommitTaxRequest.getDocType() in order to uniquely identify the document.

Specified by:
commitTax in interface TaxSvcSoap
Parameters:
commitTaxRequest - a CommitTaxRequest object indicating the document that should be committed.
Returns:
a CommitTaxResult object
Throws:
java.rmi.RemoteException

cancelTax

public CancelTaxResult cancelTax(CancelTaxRequest cancelTaxRequest)
                          throws java.rmi.RemoteException
Description copied from interface: TaxSvcSoap
Cancels a previously calculated tax; This is for use as a compensating action when posting on the client fails to complete.

This is only available for saved tax document types (Sales Invoices, Purchase Invoices). A document that is saved but not posted will be deleted if canceled. A document that has been posted will revert to a saved state if canceled (in this case CancelTax should be called with a CancelTaxRequest.getCancelCode() of PostFailed). A document that has been committed cannot be reverted to a posted state or deleted. In the case that a document on the client side no longer exists, a committed document can be virtually removed by calling CancelTax with a CancelCode of DocDeleted. The record will be retained in history but removed from all reports.

A document can be indicated solely by the CancelTaxRequest.getDocId() if it is known. Otherwise the request must specify all of CancelTaxRequest.getCompanyCode(), CancelTaxRequest.getDocCode(), and CancelTaxRequest.getDocType() in order to uniquely identify the document.

Specified by:
cancelTax in interface TaxSvcSoap
Parameters:
cancelTaxRequest - a CancelTaxRequest object indicating the document that should be canceled.
Returns:
a CancelTaxResult object
Throws:
java.rmi.RemoteException

reconcileTaxHistory

public ReconcileTaxHistoryResult reconcileTaxHistory(ReconcileTaxHistoryRequest reconcileTaxHistoryRequest)
                                              throws java.rmi.RemoteException
Description copied from interface: TaxSvcSoap
Reconciles tax history to ensure the client data matches the AvaTax history.

The Reconcile operation allows reconciliation of the AvaTax history with the client accounting system. It must be used periodically according to your service contract.

Because there may be a large number of documents to reconcile, it is designed to be called repetitively until all documents have been reconciled. It should be called until no more documents are returned. Each subsequent call should pass the previous results ReconcileTaxHistoryRequest.getLastDocId().

When all results have been reconciled, Reconcile should be called once more with ReconcileTaxHistoryRequest.getLastDocId() equal to the last document code processed and ReconcileTaxHistoryRequest.isReconciled() set to true to indicate that all items have been reconciled. If desired, this may be done incrementally with each result set. Just send Reconciled as true when requesting the next result set and the prior results will be marked as reconciled.

The TaxSvcSoap.postTax(com.avalara.avatax.services.tax.PostTaxRequest), TaxSvcSoap.commitTax(com.avalara.avatax.services.tax.CommitTaxRequest), and TaxSvcSoap.cancelTax(com.avalara.avatax.services.tax.CancelTaxRequest) operations can be used to correct any differences. TaxSvcSoap.getTax(com.avalara.avatax.services.tax.GetTaxRequest) should be called if any committed documents are out of balance (GetTaxResult.getTotalAmount() or GetTaxResult.getTotalTax() don't match the accounting system records). This is to make sure the correct tax is reported.

Specified by:
reconcileTaxHistory in interface TaxSvcSoap
Parameters:
reconcileTaxHistoryRequest - a Reconciliation request
Returns:
A collection of documents that have been posted or committed since the last reconciliation.
Throws:
java.rmi.RemoteException

ping

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

This replaces TestConnection and is available on every service.

Specified by:
ping in interface TaxSvcSoap
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: TaxSvcSoap
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, i.e. protects against phishing.

Example: isAuthorized("GetTax,PostTax")

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

adjustTax

public AdjustTaxResult adjustTax(AdjustTaxRequest adjustTaxRequest)
                          throws java.rmi.RemoteException
Description copied from interface: TaxSvcSoap
*

The AdjustTax operation allows user to Adjust document on the AvaTax system. Adjustment is allowed for Commited documents. If Document status is GetTaxResult.locked then system will not process any AdjustTax call. A valid AdjustTaxRequest.adjustmentReason is required for Adjusting a document.

Specified by:
adjustTax in interface TaxSvcSoap
Throws:
java.rmi.RemoteException

applyPayment

public ApplyPaymentResult applyPayment(ApplyPaymentRequest applyPaymentRequest)
                                throws java.rmi.RemoteException
Description copied from interface: TaxSvcSoap
This method is used to apply a payment to a document for cash basis accounting. Applies a payment date to an existing invoice

It sets the document PaymentDate and changes the reporting date from the DocDate default. It may be called before or after a document is committed. It should not be used for accrual basis accounting

Specified by:
applyPayment in interface TaxSvcSoap
Returns:
a ApplyPaymentResult object
Throws:
java.rmi.RemoteException