No way to map to an envelop schema without use of orchiestration.

来源:互联网 发布:淘宝积分有什么用 编辑:程序博客网 时间:2024/05/01 16:04

It looks it is a BizTalk mapping bug and the bug exists till BizTalk 2006 R2. Not sure if BizTalk 2009 fixed this bug:

 

---The detail:

Suppose you have a doc schema defines xml like this <Document xmlns="urn:MyDoc" ID="1" />

You need combine multiple these documents into a envelop like this:

<Env xmlns="urn:MyEnv">

    <Document xmlns="urn:MyDoc" ID="1" />

    <Document xmlns="urn:MyDoc" ID="2" />

..............

</Env>

 

So you defined a env.xsd and import the document.xsd to env.xsd. Then you use  this env.xsd as the output schema in a mapping file  to build this enveloped document, Compile is ok, Deploy successfully. You create a send port and binding this mapping to the send port output mapping.

    When the document comes to this send port and the mapping tries to work, an error like this will popup:

 

Document type "uri:MyDoc#Document" does not match any of the given schemas.

 

A 2004 posted blog  descriped the same bug, Clearly, the bug exists at least since BizTalk 2004.  After two major version upgrade( 2006 and 2006 R2), this same bug still exist.

What else can I say?