Usage Reports C# Code Snippet

//Add a service to your application
DOTSUsageReportsSoapClient Client = new DOTSUsageReportsSoapClient()
Response = Client.GetDOTSTransactionDetailsByDateRange(inputLicenseKey.Text, inputEmailAddress.Text, inputBeginDate.Text, inputEndDate.Text);
if (response.Error != null)
    //Process Error
    //Process Response     

Usage Reports Java Code Snippet

// Declare Result Object
ReportTransactionDetailUsage Response = null;
ReportDailyUsage usage[] = null;
// Create client through proxy class
DOTSUsageReportsLocator locator = new DOTSUsageReportsLocator();
// Handle request to client
DOTSUsageReportsSoap ur = locator.getDOTSUsageReportsSoap();
// Handle any errors in response
Error error;
Response = soap.getDOTSTransactionDetailsByDateRange(LicenseKey, Email, BeginDate, EndDate);
usage = Response.getDailyUsage();
error = Response.getError();
if(error !=null && error.getNumber() == "3")
throw new Exception(); 
//Process Results
if(error == null){
    //DOTS Usage Reports Results   
//Process Errors
    //DOTS Usage Reprots Error Results 

Usage Reports PHP Code Snippets

// Set these values per web service <as needed>
$wsdlUrl = "";
$params['LicenseKey']   = $LicenseKey;
$params['Email']        = $Email;
$params['BeginDate']    = $BeginDate;
$params['EndDate']      = $EndDate;
$soapClient = new SoapClient($wsdlUrl, array( "trace" => 1 ));
$result = $soapClient->GetDOTSTransactionDetailsByDateRange ($params);
$result= $response->GetDOTSTransactionDetailsByDateRangeResult
$result= $response->GetDOTSTransGetDOTSTransactionDetailsByDateRangeResult;
if (!isset($result->Error)) {
    foreach($result as $k=>$v) {
        echo $k . ", " . $v;
} else {
    foreach($result->Error as $k=>$v) {
        echo $k . ", " . $v;

Usage Reports RoR SOAP Code Snippets

#Formats inputs into a hash to pass to Soap Client
    #Hash Keys must be named as they are shown here.
    message =   {
                "LicenseKey" => @request.licensekey,
                "Email" =>,
                "BeginDate" => @request.begindate,
                "EndDate" => @request.enddate
    #Implemented to make the code more readable when accessing the hash        
    @urresponse = :get_dots_transaction_details_by_date_range_response
    @urresult = :get_dots_transaction_details_by_date_range_result
    @urdailyusage = :daily_usage
    @urerror = :error
    #Set Primary and Backup URLs here as needed
    dotsURPrimary = ""
    dotsURBackup = ""
        #initializes the soap client. The convert request keys global is necessary to receive a response from the service.
        client = Savon.client(  wsdl: dotsURPrimary)
        #Calls the operation with given inptus and converts response to a hash.
        response =, message: message).to_hash
        #Checks to see what results came back from the service
    #If an error occurs during the call, this will use backup url and attempt to retrieve data.
    rescue Savon::Error => e
        backupclient = Savon.client(wsdl: dotsURBackup)
        #Sets the response to the backclient call to the operation and converts response to a hash.
        response =, message: message).to_hash
        #If backup url failed, this will display the error received from the server
        rescue Savon::Error =>error
def processresults(response)   
        #Processes Error Response from soap Client     
        #Processes Valid response from soap client 

Usage Reports Python Code Snippet

mEmail = Email.get()
if mEmail is None or mEmail == "":
    mEmail = " "
mBeginDate = BeginDate.get()
if mBeginDate is None or mBeginDate == "":
    mBeginDate = " "
mEndDate = EndDate.get()
if mEndDate is None or mEndDate == "":
    mEndDate = " "
mLicenseKey = LicenseKey.get()
if mLicenseKey is None or mLicenseKey == "":
    mLicenseKey = " "
#Set Primary and Backup URLs here as needed
primaryURL = ''
backupURL =''
#calling web service and print results
    client = Client(primaryURL)
    result = client.service.GetDOTSTransactionDetailsByDateRange(Email=mEmail, BeginDate=mBeginDate, EndDate=mEndDate, LicenseKey=mLicenseKey)
    #Handel response and check for errors
#failover to backupURL
        client = Client(backupURL)
        result = client.service.GetDOTSTransactionDetailsByDateRange(Email=mEmail, BeginDate=mBeginDate,EndDate=mEndDate, LicenseKey=mLicenseKey)
        #Handel response and check for errors
    #If the backup call failed then this will display an error to the screen
        Label(swin.window, text='Error').pack()
        print (result)