long startTime = System.currentTimeMillis();
AmazonS3_ServiceLocator locator = new AmazonS3_ServiceLocator();
AmazonS3SoapBindingStub binding = new AmazonS3SoapBindingStub(new URL(locator.getAmazonS3Address()), locator);
result = binding.getObject(getBucketName(),
key,
false,
true,
false,
access.getAccessKey(),
access.getAccessCalendar(),
access.generateSignature("GetObject"),
null);
long endTime = System.currentTimeMillis();
/* Get the attachments. Note, the getAttachments() method will ONLY return the object[] on the first call. Subsiquent calls will return null */
Object[] attachments = binding.getAttachments();
if (attachments.length != 1)
{
throw new Exception("The S3 Object returned [" + attachments.length + "] when we expected exactly 1");
}