Home > BizTalk Exception-Cause-Resolutions > Cannot locate document specification because multiple schemas matched the message type

Cannot locate document specification because multiple schemas matched the message type

Exception:

Cannot locate document specification because multiple schemas matched the message type “RootName#Namespace”.

Cause:

This happens when multiple schemas of the messagetype deployed.

MessageType is an important property that is used for evaluating subscriptions by BizTalk to identify where an incoming message has to be routed to.A MessageType(RootName#NameSpace) is a combination of a schema’s rootname and namespace.

If 2 schemas with the same MessageType(RootName#NameSpace) has been deployed, the XMLDisassembler will not understand which schematype the received message is of.So the exception “Cannot locate document specification because multiple schemas matched the message type “RootName#NameSpace” will be thrown.

Run the following Query against the BizTalkManagement Database. If it returns more than 1 row, then that should be the problem.

SELECT  msgtype
FROM bt_DocumentSpec
Where msgtype = ‘http://schemas.microsoft.com/Sql/2008/05/GenericTableOp/#ExecuteScalar’

Note:Replace “http://schemas.microsoft.com/Sql/2008/05/GenericTableOp/#ExecuteScalar” by “YourSchemasNameSpace#YourSchemasRootName”.

Resolution:

1.If you are using the same schema in different projects seperately, then

Move this schema to a common project and deploy it. Refer this common project in all other projects that you want this schema to be used in.This will resolve the issue.

2.If both the schemas are different and the namespace can be modified, then

Modify the namespace for any one of the schemas and deploy it.This will resolve the issue.

3.If both the schemas are different and the namespace cannot be changed, then

  • Create a custom receive pipeline and add an XmlDisassembler to it.
  • Set the “Document schemas” property of the XMLDisassembler by picking the schema(one among the 2 schemas with the same messagetype deployed) which you want to receive on this receive pipeline.
  • Use this receivepipeline on the receive location. This way we are forcing the XMLDisassembler to use the schema we have provided rather then it trying to match one in the DocumentSpec table.

Please post your comments or questions.

 

Advertisements
  1. Venu Gopal Sarla
    May 10, 2012 at 2:30 PM

    nice one.. 3 simple approaches to a simple problem.. generally when i get this error ,I try to look for the duplicate schema under Application Artifacts , delete it if it is not required. Your first solution will solve the problem.

    • May 10, 2012 at 6:11 PM

      Happy that this post has helped you.Thanks Venu!!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: