Java: Get Details Of Uploaded Files Using GetUploadedFileDetails()

Download
Download our Java samples from this page.
Find this sample in directory /test/com/postalmethods/client
package com.postalmethods.client;
 
import static org.junit.Assert.assertEquals;
 
import java.util.List;
 
import org.junit.Before;
import org.junit.Test;
 
import com.postalmethods.client.api.GetUploadedFileDetailsResponse;
import com.postalmethods.client.model.FileDetails;
 
/**
 * Integration test that calls the GetUploadedFileDetails web method.
 * <p>
 * For details about PostalMethods.GetUploadFileDetails see
 * <a href="http://www.postalmethods.com/method/2009-02-26/GetUploadedFileDetails">the PostalMethods.GetUploadedFileDetails reference</a>
 */
public class GetUploadedFileDetailsTest {
 
    private PostalMethodsClient client;
 
    @Before
    public void setUp() {
        client = new PostalMethodsClientFactory().build();
    }
 
    @Test
    public void testGetUploadedFileDetails() {
        System.out.println("Making call to GetUploadedFileDetails...");
 
        GetUploadedFileDetailsResponse response = client.getUploadedFileDetails();
        System.out.println("Service call completed:\n" + response.getResult().toString());
 
        List<FileDetails> fileDetails = response.getFileDetailsList();
        for( FileDetails curr : fileDetails ) {
            System.out.println( curr );
        }
 
        int code = response.getResult().getCode();
        assertEquals(-3000, code); // success
    }
}