Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetObjectRequest - Error unmarshalling response back from AWS #18

Open
lrighetti68 opened this issue Oct 21, 2024 · 5 comments
Open

GetObjectRequest - Error unmarshalling response back from AWS #18

lrighetti68 opened this issue Oct 21, 2024 · 5 comments

Comments

@lrighetti68
Copy link

Hello,

using aw-sdk-delphi TGetObjectRequest I have the error "Error unmarshalling response back from AWS" with any bucket and any object. It's ok using standard delphi component TAmazonConnectionInfo (see attachment)

get.txt

Thanks for your great job!

@wlandgraf
Copy link
Contributor

Are you able to send code that we can reproduce at our side? Maybe a small console project that reads a public S3 bucket?

@lrighetti68
Copy link
Author

here it is
Example4AwsSdkDelphi.zip
Screenshot 2024-10-21 170913

@wlandgraf
Copy link
Contributor

In your demo, lower button raises error 403. Upper button raises this error:

image

@wlandgraf
Copy link
Contributor

"Access key you provided is not in our database".
I cannot reproduce the problem with your project.

@lrighetti68
Copy link
Author

I think I understand where the problem is:
The S3 response contains the datetime "Wed, 23 Oct 2024 07:21:43 GMT"
but we are in Italy and the month names are different ("October" -> "Ottobre").

The datetime is checked in TAWSSDKUtils.TryRfc822ToDateTime() calling the function TryStrToDateTime(Copy(S, 5, 20), D, FRFC822FormatSettings);

FRFC822FormatSettings is created in the TAWSSDKUtils.Create class constructor with:
FRFC822FormatSettings := TFormatSettings.Create; without any parameters -> "Initialize a TFormatSettings record with the current default values ​​provided by the operating system" (Italy settings)

To validate the date in a different region we need to create FormatSettings with the parameter 'en-US':
FRFC822FormatSettings := TFormatSettings.Create('en-US');

By doing so I can use the function without any problems.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants