Archive

Posts Tagged ‘two schemas with same messagetype’

Cannot locate document specification because multiple schemas matched the message type

March 24, 2011 2 comments

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