Verifying Schemas after deployment


After a developer builds and deploys the BizTalk application one verifies that the assembly of the application is present in the GAC. Sometimes when we test our solution we often get these errors below.

There was an error executing receive pipeline: Finding the document specification by
message type [MessageType] failed.Verify the schema deployed properly.

Or

There was a failure executing receive pipeline: Cannot locate document specification
because multiple schemas matched this message type [MessageType]

This error occurs when the BizTalk runtime cannot find the schema which conforms to the type of the message. To BizTalk the type of message is a combination of target namespace of the schema and the root node separated by pound (#) sign. for e.g. http://mycompany.schema#orders.

The BizTalkMgmtDb is the database where the application information is saved. The error mentioned above means that the schema is not deployed in BizTalk. The records of all the schemas that are deployed to BizTalk are in the bt_DocumentSpec table.  To check that the schema exists and is deployed properly open the query analyser on your BizTalk Server and use the BizTalkMgmtDb and run the query below. In the where clause place the correct target namespace and root node name which is being reported in the error log from the Event Viewer.

Select msgtype, assemblyid, clr_namespace, clr_assemblyname
from bt_documentspec
where msgtype = ‘http://mycompany.schema#orders’

If the record is present this verifies that the schema is deployed properly to BizTalk, if not the project containing the schema should be redeployed.