Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing data from a VFP app to a .NET web service
Message
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Divers
Thread ID:
00870973
Message ID:
00871071
Vues:
16
This message has been marked as the solution to the initial question of the thread.
Hi Franco,

You can also use the VFP XMLAdapter class. It allows you more control of the output of the XML and the ability to work with multiple tables. I wrote an article about it a while ago in Code Magazine. Here is the link:

http://www.code-magazine.com/Article.aspx?quickid=0301092

When you need to take the string and turn it into a .NET DataSet, you use the ReadXml method of the DataSet. Here is an example:
DataSet ds = new DataSet();
// cXML is the string of XML to read
ds.ReadXml(New StringReader(cXML));
Once you have the data into a DataSet, you can create either create a DataAdapter to connect to SQL Server and update from the DataSet, or manually read each record in the DataTable and perform the updates, using the SqlCommmand object.


>I need to create a VB.NET web service that must be used from a VFP application.
>The vfp application must pass a cursor to the web service which update an SQL Table
>I would like to know how to pass the data from the VFP app to the .NET web service, and how to put this data into a .NET dataset so I can update the sql server table.
>Actually I'm converting the vfp cursor into xml, then sending the xml string to the web service, but here I'm having some trouble.
>
>In the VFP application I have something like:
>
>use table in 0 shared
>cursortoxml("table","myxml")
>oWS = CREATEOBJECT("MSSOAP.SoapClient")
>oWS.MSSoapInit("http://theserver/ws.wsdl")
>oWs.UpdateRow(myxml)
>release oWs
>
>In the webservice I have a webmethod as following:
>
>WebMethod(Description:="Update row", EnableSession:=False) _
> Public Sub UpdateRow(ByVal lcStr As String)
>
> ' in this method I'd like to Fill the dataset with the data contained in the lcStr parameter
> ' and update the SQL-Server table
>
> End Sub
>
>How can I do?
>Thanks in advance
>
>Franco
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform