Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XML & D8 (mismatch in datapacket)

164 views
Skip to first unread message

nisbus

unread,
Aug 30, 2004, 3:29:57 PM8/30/04
to
Hi all,

I've written a simple WebService in D8 that sends back XML files and String.

This is what I getting back from the Web Service:

<string xmlns="http://tempuri.org/"><NewDataSet>
<BankarKey>
<CompID>ELIA</CompID>
<CompName>ELIA Bankar</CompName>
</BankarKey>
<BankarKey>
<CompID>ELIT</CompID>
<CompName>ELIT Bankar</CompName>
</BankarKey>
</NewDataSet>
</string>

Now comes the problem of loading it into the client application.
I've tried to load it into TXMLDocument and it goes active without a hitch.
Then I tried loading it into a TClientDataSet with this statement:

ClientDataSet1.XMLData := XMLDocument1.ToString;

I've also tried loading it into a Memo and from there to the ClientDataSet
but I get the same error.

Mismatch in datapacket.

What other components do I need to read the XML as a Table?

regards,
nisbus


Petr Vones

unread,
Sep 4, 2004, 6:11:25 AM9/4/04
to
"nisbus" <v...@elea.is> wrote in message news:413387a1

> This is what I getting back from the Web Service:
>
> <string xmlns="http://tempuri.org/"><NewDataSet>
>
> ClientDataSet1.XMLData := XMLDocument1.ToString;

If I understand it correctly you are trying to use .NET DataSet returned from
.NET web service with TClientDataSet component (in Win32 application).

Microsoft and Borland have different format of XML data/schema for their
dataset components so you can assign them directly. You need to convert them.

You can use XML Transformation (available in Enterprise+ edition only) to
create individual transformation for particular dataset. But if its format
changes in the future you would need to recreate the transformation again.

To solve this I wrote code which can do (to some extent only) automatic
transformation between .NET DataSet diffgram format and ClientDataSet
DATAPACKET format. I can send you current version (for Delphi 7) if you want.

Petr.


0 new messages