Download all files referenced in an xsd locally (+ Possible fix for BizTalk CS0013 compilation error)

September 30, 2010 / Comments Off on Download all files referenced in an xsd locally (+ Possible fix for BizTalk CS0013 compilation error)

Well if you ever end up like me with a XSD that has about a zillion includes (schemaLocation), maybe this tool is something for you.

It is a pretty simple tool. You give it an XSD, and it will download all files that are referenced to your local system. It will parse the file names a bit and set them all to the local download folder.
This way you can simply include the folders and downloaded schema’s in your BizTalk Project.

For example take the schema’s from UNECE like http://www.unece.org/uncefact/data/standard/Acknowledgement_4p0.xsd

It can be pretty frustrating to download all the schema’s manually and link them together again with a correct import. IncludeSchemaDownloader.exe comes to the rescue.. Below is a screenshot of this tool.

The workings are quite simple. Follow these steps to get the all the schema’s on yoyr local machine.

  1. Download the Toplevel XSD to a work folder.
  2. Point the Toplevel XSD to that working folder.
  3. Point the StoreFolder to the desired location where the xsd’s will be stored (typically schema’s folder of a BizTalk Project
  4. Hit the process button !
  5. Done
  6. Now include this folder in your BizTalk project
  7. Hit the Validate button… (should work)

Now these XSD schemas that you get from UNECE are full with usefull comments and annotations. And if your schema’s get too large you cannot compile them anymore. (there seems to be a limit in the size of the dll the BizTalk compile can handle). You would get an error message like this:

error CS0013: Unexpected error writing metadata to file ‘<somedrive><somefolders><yourproject>.dll’

 

To solve this you would have to break up your huge XSD project into smaller projects. This would solve the problem but in my case VisualStudio was soo busy reflectoring all the DLL’s it hardly had time for me. (You know opening a map would take ages….).

When I looked into the XSD’s they were all beautifully documented with lots and lots of annotations and comments. But wait a minute….. I only had to send these documents. So i only have to validate the documents. So I don’t need all those comments and annotations. That’s why the tool has the option to strip comments and annotations.

When I tried to compile the XSD’s with comments and annotations (size on disk roughly 12 megabytes) I got the dreaded  CS0013 compilation error.

I ran the tool again (size on dis now about 1.5 megabytes) I ended up with a DLL only 4 MB in size. And if reference this DLL in a map or whatever it’s way faster than the other solution(you know several projects / dll’s)

You can download the tool >>HERE <<

If I import the schema http://www.unece.org/uncefact/data/standard/Acknowledgement_4p0.xsd

The output of the tool will be  :

Starting with D:TempDemoAcknowledgement_4p0.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/data/standard/UnqualifiedDataType_7p0.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/IANA_CharacterSetCode_20070514.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/IANA_MIMEMediaType_20090304.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/identifierlist/standard/ISO_ISOTwoletterCountryCode_SecondEdition2006VI-4.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/ISO_ISO3AlphaCurrencyCode_20090305.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/UNECE_CharacterSetEncodingCode_40106.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/UNECE_MeasurementUnitCommonCode_5.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/UNECE_AgencyIdentificationCode_D08B.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/data/standard/QualifiedDataType_6p0.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/data/standard/UnqualifiedDataType_7p0.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/IANA_CharacterSetCode_20070514.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/IANA_MIMEMediaType_20090304.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/identifierlist/standard/ISO_ISOTwoletterCountryCode_SecondEdition2006VI-4.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/ISO_ISO3AlphaCurrencyCode_20090305.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/UNECE_CharacterSetEncodingCode_40106.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/UNECE_MeasurementUnitCommonCode_5.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/UNECE_AgencyIdentificationCode_D08B.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/EDIFICASEU_AccountingAccountType_D08B.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/EDIFICASEU_AccountingAmountType_D08B.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/EDIFICASEU_AccountingEntryCategory_D08B.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/EDIFICASEU_AccountingEntryLineCategory_D08B.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/EDIFICASEU_AccountingEntryLineSource_D08B.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/EDIFICASEU_AccountingEntryProcessing_D08B.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/EDIFICASEU_AccountingVoucherMedium_D08B.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/EDIFICASEU_AlternateCurrencyAmount_D08B.xsd
getting all imports
Loading file :http://www.unece.org/uncefact/codelist/standard/EDIFICASEU_TaxExemptionReason_D08B.xsd
This list goes on and on and on

 Below are some results:

 

 

 

 

My BizTalk infrastructure design baseline

September 28, 2010 / Comments Off on My BizTalk infrastructure design baseline

Today I found a great post about a nice BizTalk infrastructure baseline. It’s always hard to specify what you need and why you need it.
In an excellent blogposting Johan Hedberg explains what he needs and (more important why).

Follow >>this link<< to have a read of his excellent post by Johan.

 

 

 

Strange COM exception in BizTalk

September 27, 2010 / Comments Off on Strange COM exception in BizTalk

A while ago I had serious problems with BizTalk. For some obscure reason the BizTalk engine would throw some XLANG errors and stop processing all messages. A restart of the hosts would fix the problem for a while but after some time the same problem would occur and BizTalk would effectively stop processing. (orchestrations would be marked as  active but nothing happens)

The funny thing is, these orchestrations were deployed on the BizTalk Server a long time ago and they never gave any problem. All of a sudden these problems started to appear. So I think the blame is probably in some kb^*&^(& hotfix somewhere.

I had a case with MS-Support (and for sure they had never seen this error) and even google will not tell you that much about it.
However, until now I have had two people contact me with exactly the same problem.
So I know I was not alone ! Since googling on this gives me very poor results I will put some details about what happened in this post.

Unable to cast COM object of type ‘System.__ComObject’   followed by No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

When this happens you will find a lot of references to the guid 6C90EC05-4918-11D3-A242-00C04F60A533 (see bottom)

I have mentioned both MSDN threads that have this problem. The things we have in common are:

  • Usage of the classic SQL adapter 
  • Typically, this problem occurs when the orchestration engine reaches a Call Orchestration shape or a Start Orchestration shape.

To isolate this problem we added a specific SQL Host that does all the work for the SQL Adapter. We hoped the next time we saw the error, we could see if it was caused by orchestrations or really by the SQL adapter. Cause then onlu the SQL Host would have a problem. We had everything set up to debug the BizTalk environment with the tools provided by MS and we were waiting for the event to happen. But unfortunately after we added a dedicated SQL host the problem never re-occurred. So the supportcase is closed now (without a definitive answer).

If you have had a similar experience please give a response to this post.

  • Recent Posts
  • Recent Comments
  • Archives
  • Categories
  • Meta