How to valdisate XSD against DTD

Home Page Forums BizTalk 2004 – BizTalk 2010 How to valdisate XSD against DTD

Viewing 1 reply thread
  • Author
    Posts
    • #20196

       Hello,

       I am quite new with BizTalk, Visual Studio and .NET.

       I am using BizTalk Server 2006 R2.

       I have generated a XML and validate with DTD.

      But when I try to validate this instance against my schema Using biztalk  I obtain this error:

       Warning BEC2004: For security reasons DTD is prohibited in this XML document. To enable this DTD process, you must setup ProhibitedDtd property in XmlReaderSettings as false and pass it to XmlReader.Create method.

       Error BEC2004: the schema Test.xsd could not been validated.

       I think I have two posibilities:

       1.- Change the property ProhibitDtd to false. The problem is that I have no idea where and how I can modify this property.

       2.- Try to ignore the validation against DTD.

       Please I will be grateful if someone could help me.

       Thank you in advance.

      – Dhaval M.

    • #20199

      Dhaval,

      I would just suggest that you ignore the DTD and get rid of the declaration from the Xml message. IMHO, DTD’s are old technology (super-seeded by XSD’s) and are not used in BizTalk.By all-means create an XSD from the DTD, but then use your XSD exclusively.

      Rgds, Nick.

      • #20204

         Hi Nick,

        I appreciate your suggestion. but i have one EXE which ll create XML validate against one DTD.

        Even when i try create xsd file using Add Generated Item -> Document type -> DTD Schema

        It gives me following error.

        Error parsing DTD:Value cannot be null.
        Parameter name: name

        Now I have created that XSD using well-formed XML. Using Add Generated Item

        Now when i deployed my project in production. i put one xml file in to receive folder i got following error.

        There was a failure executing the receive pipeline: “Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35” Source: “XML disassembler” Receive Port: “ReceiveNistevoXML” URI: “D:\TestingFolders\ProdData\*.xml” Reason: Could not find file ‘C:\WINDOWS\system32\Shipment.dtd’

        I have put shipment.dtd in system32 folder but the error is same. problem is in my XML following tag create error

        <!DOCTYPE ShipmentTransaction PUBLIC “Shipment” “Shipment.dtd”>.

        If i remove this line everything works fine but i cant remove this line as this line as i upload that file on FTP other system need this file with the same formate.

         I am not sure. but Is there any poslibility to create one custome pipeline and get xml from there.

        Please suggest me any good solution for this problem.

        Regards,

        – Dhaval M.

        • #20207

          Dhaval,

          Looks like I had a similar problem back in 2006 when working with BizTalk 2004…..

          I had a customer that needed to receive messages that included the DTD DOCTYPE declaration so wrote a Send Pipeline component (see http://www.modhul.com/2006/12/28/add-doctype-declaration-component/ for source code) to add the DOCTYPE back into the message based on the MessageType (the message coming out of BizTalk did not include the DOCTYPE declaration).

          You will need a similar Receive Pipeline decode component that removes the DOCTYPE as the message is received into BizTalk so it doesn’t break the Xml Disassembler – you could perform this with a simple RegEx replace for example.

          HTH, Nick.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.