Martijn's blog - E-Commerce, EAI, BizTalk and .NET

2004/08/13

XmlDTDValidator pipeline component

Ever tried using DOCTYPE declarations in your inbound messages? The XML Disassembler does not validate against DTDs, only schemas. If you have DOCTYPE declarations in your inbound message, BizTalk uses the standard XmlResolver for reading in the message and will log about four error messages into the EventViewer, of which one will state:

There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive" Source: "mscorlib" Receive Location: "c:\test\input\*.xml" Reason: Could not find file "C:\WINDOWS\system32\MyDTD.DTD".

I can imagine situations in which you can't alter the messages coming in on forehand and need the message to be both validated and processed by BizTalk, without having to store your DTD files in C:\WINDOWS\system32.

I've written a pipeline component which both validates the inbound message against it's DOCTYPE, having a design-time property in which you specify where your DTD files reside, and removes the DOCTYPE declaration in order for BizTalk to process the message. (by the way, the framework was built using my Pipeline Component Wizard)

Ofcourse, a design-time property setting the folder in which your DTDs reside, might not be the best option, it's for example use only. In a production environment, you want this value to come from the App.Config file or another place you can alter real-time without having the redeploy your pipeline.

I hope you have fun with this component and would love to hear any comments, flames, what not (see this page for my e-mail address)

2 Comments:

  • Hi Martjin,
    I can not found your XML DTD Validator the link is broken?
    When Can i get the code of your pipline
    Younes

    By Anonymous Anonymous, at 6:09 PM  

  • For me the link is also dead ...
    Can you update the link? I'm very interested

    By Anonymous Anonymous, at 5:12 PM  

Post a Comment

<< Home