I am having an issue with the ListObjectResponse class in my program it keeps throwing an exception that tells me about something wrong in the XML document, does not stipulate which one.
I am using .NET framework 4.5 with EMC.ViPR.DataServices.AWSSDK v1.0.0 - I don't know whether these clash.
Exception message below:
System.InvalidOperationException: There is an error in XML document (12, 54). ---> System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.ParseExactMultiple(String s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style)
at System.DateTime.ParseExact(String s, String[] formats, IFormatProvider provider, DateTimeStyles style)
at Amazon.S3.Model.S3Object.set_LastModified(String value)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderListObjectsResponse.Read6_S3Object(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderListObjectsResponse.Read7_ListObjectsResponse(Boolean isNullable, Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderListObjectsResponse.Read8_ListObjectsResponse()
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
at Amazon.S3.AmazonS3Client.processRequestResponse (HttpWebResponse httpResponse, S3Request request, Type t, T& response, Exception& cause)
at Amazon.S3.AmazonS3Client.getResponseCallback (IAsyncResult result)
at Amazon.S3.AmazonS3Client.endOperation (IAsyncResult result)
at Amazon.S3.AmazonS3Client.EndListObjects(IAsyncResult asyncResult)
at Amazon.S3.AmazonS3Client.ListObjects(ListObjectsRequest request)
at ObjectStore1.frmStart.btnGetData_Click(Object sender, EventArgs e) in c:\Users\Chuma\Documents\Visual Studio 2012\Projects\ObjectStore1\ObjectStore1\Form1.cs:line 124
Are you working with the source code for ViPR Data Service SDK? There is an issue in the S3Object class with hose the lastAccessed property is getting formatted. I was able to get it to work with the following tweak:
However, is there any specific reason you're using this specific SDK as it's quite outdated. Can you instead reference the Amazon.S3 nuget package directly in your solution and work with the object store through that SDK instead? Please use the link below to locate the AWS SDK using .NET.
benschumacher
1 Rookie
•
75 Posts
673
0
Posted December 8th, 2016 14:00
Are you working with the source code for ViPR Data Service SDK? There is an issue in the S3Object class with hose the lastAccessed property is getting formatted. I was able to get it to work with the following tweak:
this.lastModified = DateTime.ParseExact(
value,
"yyyy-MM-ddTHH:mm:ssZ",
//new string[] { AWSSDKUtils.ISO8601DateFormat, AWSSDKUtils.GMTDateFormat },
CultureInfo.InvariantCulture,
DateTimeStyles.None
);
However, is there any specific reason you're using this specific SDK as it's quite outdated. Can you instead reference the Amazon.S3 nuget package directly in your solution and work with the object store through that SDK instead? Please use the link below to locate the AWS SDK using .NET.
Getting Started with ECS SDKs
Thanks,
Ben