Moving DataSets through BizTalk
Posted
by EltonStoneman
on Geeks with Blogs
See other posts from Geeks with Blogs
or by EltonStoneman
Published on Thu, 06 May 2010 11:25:31 GMT
Indexed on
2010/05/11
2:55 UTC
Read the original article
Hit count: 323
[Source: http://geekswithblogs.net/EltonStoneman]
Yuck. But sometimes you have to, so here are a couple of things to bear in mind:
Schemas
Point a codegen tool at a WCF endpoint which exposes a DataSet and it will generate an XSD which describes the DataSet like this:
In a serialized instance, the element of type xs:schema contains a full schema which describes the structure of the DataSet – tables, columns etc. The second element, of type xs:any, contains the actual content of the DataSet, expressed as DiffGrams:
Put the XSD into a BizTalk schema and it will fail to compile, giving you error: The 'http://www.w3.org/2001/XMLSchema:schema' element is not declared. You should be able to work around that, but I've had no luck in BizTalk Server 2006 R2 – instead you can safely change that xs:schema element to be another xs:any type:
For an XML instance to pass validation through the schema, you'll also need to flag the any attributes so they can contain any namespace and skip validation:
You should now have a compiling schema which can be successfully tested against a serialised DataSet.
Transforms
If you're mapping a DataSet element between schemas, you'll need to use the Mass Copy Functoid to populate the target node from the contents of both the xs:any type elements on the source node:
This should give you a compiled map which you can test against a serialized instance. And if you have a .NET consumer on the other side of the mapped BizTalk output, it will correctly deserialize the response into a DataSet.
© Geeks with Blogs or respective owner