G
George Vlahakis
To put simply:
I have a WebMethod I wish to be able to accept arbitary two-dimensional
tables generated from any client (not .NET only). I have in fact gone down
the path of creating a custom "ImportRequest" class which in effect has some
header information and then follows with the columns and rows of the table
that needs to be imported.
I do not need the table to conform to any specific schema as the database
table will be created on the fly, but I DO need to know the types for each
column. I thought of using some sort of enumeration for describe the type
but everytime I look at the issue again I keep getting the feeling I am
re-inventing the wheel.
It would be good if in my "ImportRequest" I could somehow have the type
embedded so that a table lets say :
<Counsil>
<Name>
Berkshire
</Name>
<Population>
89,098
</Population>
<SurveyDate>
01/01/2006
</SurveyDate>
</Council>
so I could (on the receiving side) determine that <Population> is a numeric
and that <SurveyDate> is a date.
Here is a sample of what I wish to do:
<WebMethod> Public Function ImportData( request As ImportRequest ) as
ImportResponse
...
End Function
Public Class ImportRequest
Public CustomerID As Long
Public Name As String
Public Description As String
Public Columns() As Column
Public Rows() As Row
End Class
Public Enum ColumnType
Text
Numeric
End Enum
Public Class Column
Public ColumnName As String
Public ColumnType As ColumnType
End Class
Public Class Row
Public Values() As String
End Class
The goal is to receive the "Values" and convert them to a specified type. I
tried using the DataSet and it also consumed XML with String types for
everything unless I used a Schema on the client side. The later I suspect
will be a bit too much to ask from the client to do so I am hoping that the
Value types can somehow be embedded in the XML ImportRequest.
Thanks in advance
George
I have a WebMethod I wish to be able to accept arbitary two-dimensional
tables generated from any client (not .NET only). I have in fact gone down
the path of creating a custom "ImportRequest" class which in effect has some
header information and then follows with the columns and rows of the table
that needs to be imported.
I do not need the table to conform to any specific schema as the database
table will be created on the fly, but I DO need to know the types for each
column. I thought of using some sort of enumeration for describe the type
but everytime I look at the issue again I keep getting the feeling I am
re-inventing the wheel.
It would be good if in my "ImportRequest" I could somehow have the type
embedded so that a table lets say :
<Counsil>
<Name>
Berkshire
</Name>
<Population>
89,098
</Population>
<SurveyDate>
01/01/2006
</SurveyDate>
</Council>
so I could (on the receiving side) determine that <Population> is a numeric
and that <SurveyDate> is a date.
Here is a sample of what I wish to do:
<WebMethod> Public Function ImportData( request As ImportRequest ) as
ImportResponse
...
End Function
Public Class ImportRequest
Public CustomerID As Long
Public Name As String
Public Description As String
Public Columns() As Column
Public Rows() As Row
End Class
Public Enum ColumnType
Text
Numeric
End Enum
Public Class Column
Public ColumnName As String
Public ColumnType As ColumnType
End Class
Public Class Row
Public Values() As String
End Class
The goal is to receive the "Values" and convert them to a specified type. I
tried using the DataSet and it also consumed XML with String types for
everything unless I used a Schema on the client side. The later I suspect
will be a bit too much to ask from the client to do so I am hoping that the
Value types can somehow be embedded in the XML ImportRequest.
Thanks in advance
George