Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anyone using XML diffgrams to/from middle tier?
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
XML
Titre:
Anyone using XML diffgrams to/from middle tier?
Divers
Thread ID:
00876309
Message ID:
00876309
Vues:
76
I'm using an existing VFP middle-tier COM DLL that was designed to do data transfer via Xml Diffgrams. Internally, it uses VFP 8's XMLAdapter to serve and consume the Xml data.

I can communicate with this DLL just fine in C# .NET code using COM Interop. When I run a class method from the DLL that returns an XML diffgram, I have no problem reading that Xml into a Dataset and using the data.

Where I run into a problem is when I need to generate a diffgram with my changes and send it back to the middle-tier DLL's save method. The Xml that I get by calling DataSet.WriteXml with XmlWriteMode.DiffGram passed as the XmlWriteMode parameter does not contain the schema nor the header line. That by itself may not be that much of a problem, however the VFP middle-tier component does not see a record for some reason when I send it that way. I need to do some testing to see whether VFP's XMLAdapter causes that or the specific code in the VFP component is somehow causing this (I didn't write it).

Regardless, while I check into that, I thought that I would ask whether anyone here who's doing n-tier development in .NET is using Xml DiffGrams as the data transfer mechanism and, if so, are you doing anything special to create a DiffGram that contains the schema and Xml header? I did try using WriteSchema and stringing together an Xml document with that and the DiffGram, but that requires some kludgy code to get the schema inside the outer node (e.g., ) of the DiffGram plus pre-pending a hard-coded header line. I could do this, but whenever I go down that kind of road, I get the feeling that I must be doing something wrong. Shouldn't passing Xml diffgrams between tiers be easier than that? If so, what am I doing wrong?

Here's the code I'm currently using to generate the Xml diffgram that the VFP component doesn't seem to like (it seems to see no records, and again the resulting Xml differs from what I get from that component by (1) not having a schema and (2) not having the line at the top -- otherwise, they are identical):
StringWriter sw = new StringWriter();
dataSet.WriteXml(sw, XmlWriteMode.DiffGram);
string xmlDataUpdates = sw.ToString();
sw.Close();

if (myMiddleTier.Save(xmlDataUpdates))
...
Is there some other way to generate an Xml diffgram from a Dataset that I'm missing?

Thanks.
Kelly
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform