Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Bug in BizTalk, .NET XML implementation, or my brain…
- This topic has 2 replies, 1 voice, and was last updated 9 years, 5 months ago by
community-content.
-
AuthorPosts
-
-
August 22, 2006 at 8:40 PM #15420
Hello,
According the XML schema definition rules, you can create schemas that have no targetNamespace attribute. This allows including schemas to impose their namespace onto the included types. If your include hierarchy is linear, BizTalk doesn’t complain. If your include hierarchy has multiple references to the same XSD, BizTalk raises an error, stating that certain types are not defined. This behaviour appears to be a bug from my point of view. If you manually add the include statement (say via the VS.NET XML Schema Editor or Notepad) in the top level hierarchy, all the types become reusable; you can even use the \”Validate Schema\”, \”Validate Instance\”, and \”Generate Instance\” functions. Unfortunately, if you create a pipeline and try to set the Document Schema property, BizTalk will complain about the missing types. This is very inconsistent behaviour.
I’ve created a sample project to demonstrate this quirk. After unzipping the solution, follow these steps to reproduce the error:
1. Open the solution
2. Open DeliveryEvent.xsd
3. In the Properties window, click the ellipsis beside \”Imports\”.
4. In the Imports dialog box, select \”XSD Include\” and click \”Add…\”
5. Browse to the AddressTypes schema, select it, and press OK.BizTalk will complain that the some of the types in the AddressTypes schema aren’t defined, even though they are:
[img:d99170b310]http://www.ourteacheronline.com/downloads/docs/schemaIncludeError.jpg[/img:d99170b310]
The goal is to set the data type of DeliveryEvent\\Address to the AddressType type, located in AddressTypes.xsd.
The include hierarchy is:
AddressTypes.xsd includes:
PersonTypes.xsd
BaseTypes.xsdPersonTypes.xsd includes:
BaseTypes.xsdIf my knowledge of XML schemas isn’t faulty, DeliveryEvent [b:d99170b310]should[/b:d99170b310] be able to include AddressTypes.xsd.
If I assign a namespace to the various \”type library\” schemas and use import (instead of include) from DeliveryEvent.xsd, everything works. Unfortunately, I do not want to assign a namespace to my reusable type schemas and I shouldn’t have to.
Thank you in advance.
[b:d99170b310]Download the sample from:[/b:d99170b310]
[url]http://www.ourteacheronline.com/downloads/docs/TestSchemaReuse.zip[/url]
-
August 23, 2006 at 6:26 AM #15421
[quote:5c74183633=\”Stephen W. Thomas\”]Don’t really have an answer for you, but I have always had problems importing schema. Even more problems when missing namespaces.[/quote:5c74183633]
It’s unfortunate because we are trying to showcase BizTalk as the \”easy to use\” integration & messaging hub for a national (Canadian) initiative. We inherited a load of schemas from another group that touted ebXML and an Oracle product as the way to go. As it so happens, all of their schemas are defined without a targetNamespace (which makes sense.) I must admit that I’m really surprised that BizTalk chokes on these schemas.
Ah well, I guess we have to start modifying the schemas. 🙂
-
-
August 23, 2006 at 5:39 AM #15419
Don’t really have an answer for you, but I have always had problems importing schema. Even more problems when missing namespaces.
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.