Java Fax – Get Information about a Submitted Fax with FaxStatusEx

This code sample retrieves information about one or more submitted Java faxes, using the method FaxStatusEx.

This code sample is also available as part of the ZIP file above (see the green ‘Download’ box), under the path interfaxJavaSamples > src > GetStatusWithFaxStatusEx.

The Java fax API snippet below displays information for a number of submitted faxes using FaxStatusEx:


import net.interfax.outbound.FaxItemEx;
import net.interfax.outbound.FaxStatusEx;
import net.interfax.outbound.FaxStatusExResponse;

public class GetStatusWithFaxStatusEx {

    /******** Begin settings ********/
    static String USERNAME = "";      // Enter your Interfax username here
    static String PASSWORD = "";      // Enter your Interfax password here
    static int TRANSACTION_ID = 999999999;           // Enter the transaction ID for which data
                                                     // is to be retrieved, or 999999999 for 
                                                     // the most recent transaction(s)
    static int MAX_ITEMS = 10;                       // How many transactions to return information for
    /******** End settings ********/

    public static void main(String[] anArgs) {
        try {
            net.interfax.outbound.InterFaxSoapStub theBinding = (net.interfax.outbound.InterFaxSoapStub)new net.interfax.outbound.InterFaxLocator().getInterFaxSoap();
            theBinding.setTimeout(60000);

            FaxStatusEx params = new FaxStatusEx(
                    USERNAME,
                    PASSWORD,
                    TRANSACTION_ID,
                    MAX_ITEMS,
                    0,    // totalCount
                    0,    // listSize
                    0     // resultCode
            );

         FaxStatusExResponse response = theBinding.faxStatusEx(params);

         FaxItemEx[] theResults = response.getFaxStatusExResult();

         System.out.println("faxStatusEx call succeeded.");
         for (int i=0;i