I have defined a table storage entity with single precision floating data type as follows:
public class MyEntity : TableServiceEntity {
public float value { get; set; }
<other properties>
}
I saw following error while trying to save batch of the entities:
System.Net.WebException was caught
Message=The remote server returned an error: (400) Bad Request.
Source=System
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at System.Data.Services.Client.DataServiceContext.SaveResult.BatchRequest(Boolean replaceOnUpdate)
at System.Data.Services.Client.DataServiceContext.SaveChanges(SaveChangesOptions options)
<my code stack>
A quick search on Internet yielded no meaningful result for such an exception with Azure table storage. I fired fiddler to dig deeper. I noticed following *cryptic* error message in response to the batch request:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>InvalidInput</code>
<message xml:lang="en-US">One of the request inputs is not valid.</message>
</error>
This error message did not help in any way to reach root cause of the exception. Fortunately, I stumbled across this(http://msdn.microsoft.com/en-us/library/windowsazure/dd179338.aspx)
page that *does not list* 'float' or System.Single as supported data type.
Ideally, I would expect storage client library to report that 'float' data type is not supported. AFAIK, the library does report such error for enums. Is it a known issue that storage client library does not tell about unsupported 'float' data type?
On sideline, the REST response in this case is of almost no help. Please make is helpful to developers. And also the exception thrown by storage client library while saving entities with 'float' data could be more elaborate.
Thanks in advance.
~Zendu