problem with diffgram

  • Thread starter Thread starter Eirik M.
  • Start date Start date
E

Eirik M.

Hi,

I've written a C#-based webservice that receives updates from clients based
on diffgrams. When the diffgram is generated from a typed DataSet on the
client, the web-service has no problems reading in the diffgram into a
similar typed dataset. The problem occurs when I try to call ReadXml with a
diffgram generated by a Java-based client. After calling ReadXml with
XmlReadMode.diffgram the dataset contains one table, but that table has no
rows. There's no exception being thrown when calling ReadXml ().

Here is the diffgram I'm sending from the Java-client:

<?xml version='1.0' encoding='UTF-8'?>
<diffgr:diffgram xmlns:msdata='urn:schemas-microsoft-com:xml-msdata'
xmlns:diffgr='urn-schemas-microsoft-com:xml-diffgram-v1'>
<Testdata xmlns='http://tempuri.org/Testdata.xsd'>
<TABLE_WITH_TIMESTAMP diffgr:id='TABLE_WITH_TIMESTAMP1'
msdata:roworder='0' diffgr:hasChanges='modified'>
<PKId>1</PKId>
<description>allay</description>
<plu>2003098</plu>
<timestamp>AAAAAAAAA+w=</timestamp>
</TABLE_WITH_TIMESTAMP>
</Testdata>
<diffgr:before>
<TABLE_WITH_TIMESTAMP diffgr:id='TABLE_WITH_TIMESTAMP1'
msdata:roworder='0' xmlns='http://tempuri.org/Testdata.xsd'>
<PKId>1</PKId>
<description>allay</description>
<plu>9920063</plu>
<timestamp>AAAAAAAAA+w=</timestamp>
</TABLE_WITH_TIMESTAMP>
</diffgr:before>
</diffgr:diffgram>

As far as I've been able to tell, this diffgram is exactly the same as the
one generated by the DataSet, except for the very first line, i.e. the line
<?xml version='1.0' encoding='UTF-8'?> which does not appear in the DataSet
generated diffgram.

I hope someone can help me with this as it will solve a major
interoperability issue for me.

TIA.

-- norgie
 
Have you checked out the knowlege base articles for
bugs? There are a few related to DiffGrams, some of
which have fixes.
 
James Cadd said:
Have you checked out the knowlege base articles for
bugs? There are a few related to DiffGrams, some of
which have fixes.

Ok. Thanks. Will do.

Eirik
 
Found only three articles, none pertaining to this problem. So I guess I'm
on my own here. Gee, I wish I had only simple problems to deal with.

Eirik M.
 
Hah! Found the culprit. This line contains an error

xmlns:diffgr='urn-schemas-microsoft-com:xml-diffgram-v1'

it should say

xmlns:diffgr='urn:schemas-microsoft-com:xml-diffgram-v1'

i.e. a colon (':') should come after urn and not a dash.

Changed it and the .Net-based web-service updated the database as expected.

Morale: always read the small print

Eirik M.
 
Back
Top