dataset in webservice

  • Thread starter Thread starter tascien
  • Start date Start date
T

tascien

I want to return a dataset from my <WebMethod>.

Is a dataset a common type or it's just Microsoft data type only? I
want to make sure whoever connects to my service is able to understand
my webservice... being Java, php, etc...

Tascien
 
When a dataset is sent over the wire (barring encryption) it will look will
be in XML. Any language that can work with SOAP can work with the result
set, more over any language that can work with strings can deal with the
result set.

Other languages will be able to parse the dataset, but they may not natively
be able to reconstruct a "Dataset" from the resultset. Additionally, they
may not know how to also specify that the data has been modified (flagged
for insert, update or delete). Perhaps it would be better to provide a
mechanism to allow the consumer to specify what thier intents is with a
subset of the data. (update, insert, delete).

i.e

<webmethod> _
Public Function GetData() as dataset
return mData
'Call mdata.writexml("c:\somepath.txt") to see what the XML format of the
data is in.
End Function

<webmethod> _
Public Sub DeleteProduct(ProductID as integer)
MyClass.DeleteProduct(new integer() {ProductID})
End Sub

<webmethod> _
Public Sub DeleteProduct(ProductID() as integer)
dim sFilter as string
sFilter = string.format("ProductID={0}", intVal)
for each intVal as integer in ProductID
if mData.Products.Select(sFilter).Length > 0 then
dim dr as datarow
dr = mData.Products.Select(sFilter) (0)
dr.Delete
end if
next
UpdateData()
End Sub
 
Back
Top