problem with diffgram

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
 
J

James Cadd

Have you checked out the knowlege base articles for
bugs? There are a few related to DiffGrams, some of
which have fixes.
 
E

Eirik M.

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
 
E

Eirik M.

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.
 
E

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top