Receiving arbitary 2-dimensional tables in a WebService method

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top