Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No DATASET update
Message
 
À
25/02/2002 11:16:49
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Divers
Thread ID:
00622307
Message ID:
00626062
Vues:
18
Uhm, no not exactly. It returns the object in XML representation, which is just the same as DataSet.GetXML() (or the updategram version thereof). The difference is that it's not a string, but an internal schema'd XML document.

You get a nodelist if you use the SOAP toolkit. Nodelists are difficult to work with because it doesn't give you a top level node that gets you the whole document, rather you have to walk the list and parse yourself or alternately you can provide a schema to let the SOAP toolkit know what's coming. Both approaches are braindead.

(later)
Ok, I looked at this again just now, and you can get the data out easily enough I suppose:
o = CREATEOBJECT("MSSOAP.SoapClient")
o.mssoapinit("http://westwindserver/codeservice/codewebservice.asmx?wsdl")
loResult = o.GetAuthorData("")

loDom = loResult.item(0).parentNode
lcXml = loDom.Xml
But XMLTOCURSOR doesn't deal with the with the recordset. I can use wwXML for this though:
CREATE CURSOR Temp (au_id c(15),au_lname c(20),pk I)
oXML = CREATEOBJECT("wwXML")
oXML.DataSetXmltocursor(lcXML,"Temp")
BROWSE
Frankly if you do round tripping with DataSets, using anything but .NET on both ends is not worth the effort. You can do this but it would basically involve reverse engineering how data set updates work, which is not worth it, IMHO. In that case you might as well re-design whatever the front end is using .NET because you're already redesigning the app to work with the full offline paradigm.

That's not to say DataSets are not useful in VFP->.NET communication, but in a more traditional data transfer mode.

+++ Rick ---

>Hi Rick,
>
>>http://www.west-wind.com/presentations/dotnetwebservices/DotNetWebServicesData.asp
>
>I have a comment about that article:
>
>You mention in the article that DataSets are internally represented as XML and the implication of this is that returning a DataSet from a .NET WebService is like returning XML ... however, that DataSet cannot be easily consumed in anything other than another .NET application. Trying to call that WebService in VFP doesn't work quite so easily ... what actually gets returned is not an XML string, but an object ... and it is a pain to get to the XML from there (it can be done, but it's a PITA). If the WebService takes that DataSet and instead of returning it as is, returns oDS.GetXML() it will then return an XML string, which can easily be consumed by VFP. I recommend that WebServices return this rather than a DataSet.
>
>~~Bonnie
>
>
>
>>
>>It talks quite a bit about passing datasets over .NET Web Services and things you need to watch out for.
>>
>>+++ Rick ---
>>
>>>Hi,
>>>
>>>Using VS.NET release candidat 2, and XP Pro, and MSSQLserver (Light one).
>>>
>>>I do have a small WEB services, is main function is to accept one DATASET as parameters, and then update is own copy of the database and table in SQLSERVER.
>>>
>>>I can see from the NT logevent trace, that I did receive the DATASET with 2 rows (dsdataset), then I open and fill another DATASET (dsRemoteDataset) with 1 row.
>>>
>>>Then I do merge the first one (dsdataset) with the second dataset (dsRemoteDataset).
>>>
>>>From the NT logevent trace, I can see just prior to close the dsRemoteDataset that I actually end up with 3 rows, which is ok.
>>>
>>>But after I close it with the "dsRemoteDataset = Nothing", and go back directly in SQLSERVER, the table still the same with no update. I think I am missing one step related to the way of closing the merge.
>>>
>>>Can any one help in this behavior??
>>>
>>>Thanks in advance.
>>>
>>>Carl
>>>
>>>Here is the main code of the services,
>>>
>>> Public Function AcceptUpdate(ByVal dsdataset As DataSet) As Boolean
>>>
>>>Dim strerror As String
>>>Dim dsRemoteDataset As DataSet = New DataSet()
>>>Dim strSQL As String
>>>Dim strconn As String
>>>Dim objDA As SqlClient.SqlDataAdapter
>>>strconn = "Initial Catalog=ItemsRemote;Data Source=CBCINC-XP\VSTE;User ID=administrator;Integrated Security=SSPI;"
>>>strSQL = "SELECT * FROM Items"
>>>Try
>>> objDA = New SqlClient.SqlDataAdapter(strSQL, strconn)
>>> objDA.Fill(dsRemoteDataset, "Items")
>>>
>>> logevent("ItemsRemote : items : " & dsRemoteDataset.Tables("Items").Rows.Count.ToString())
>>>
>>>logevent("ItemsLocale : items : " & dsdataset.Tables("Items").Rows.Count.ToString())
>>>
>>>dsRemoteDataset.Merge(dsdataset, True)
>>>dsRemoteDataset.AcceptChanges()
>>>
>>>logevent("ItemsRemote : items : After merge : " & dsRemoteDataset.Tables("Items").Rows.Count.ToString())
>>>
>>>dsRemoteDataset = Nothing
>>>Catch objException As Exception
>>>
>>> 'Display the exception message
>>> strerror = objException.Message
>>> If Not IsNothing(objException.InnerException) Then
>>> strerror += objException.InnerException.Message
>>> End If
>>> logevent(" Exception error : " & strerror)
>>>
>>>End Try
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform