Geeks With Blogs
Nigel Parker BizTalk 2004 Developer - Auckland, New Zealand,

I ran into an interesting problem this afternoon with one of my BizTalk soltuions that I was porting to SP1.

The problem was fairly generic so I thought I would share it.

In my solution I had a map that had two schema's on the left-hand side (described below) :

<xs:import schemaLocation="schema1" />
<xs:import schemaLocation="schema2" namespace="
http://schema2ns" />

The first schema was a trading partners schema (which I didn't have control over) and it didn't have a namespace...

After applying SP1 this map would no longer build; I started getting an error saying “Exception Caught: Cannot use a prefix with an empty namespace“.

I understand what this error is saying and yes I was using a prefix with and empty namespace but what got me was that before SP1, this solution built and compiled fine!

I developed a workaround by creating a new schema which did have a namespace and used this in the map in place of the initial schema, which worked fine but I'm no wiser as to why this behaviour has been changed by SP1...

I guess it is to be consistent with XSD standards; pre SP1 BizTalk didn't allow you to create schemas which imported other schemas that didn't have namespaces even though this behaviour was supported behind the scenes when adding multiple messages (possible without namespaces) to one side of the mapper.

Hopefully I have shed some light on the issue for anyone else out there who is experiencing a similar problem. It makes me wonder what else I might come up against ;)

Nigel.

Posted on Wednesday, February 2, 2005 1:46 PM BizTalk Tips & Tricks | Back to top


Comments on this post: My solution won't compile after applying BizTalk Server 2004 Service Pack 1 (SP1) - Exception Caught: Cannot use a prefix with an empty namespace

# re: My solution won't compile after applying BizTalk Server 2004 Service Pack 1 (SP1) - Exception Caught: Cannot use a prefix with an empty namespace
Requesting Gravatar...
Thanks for sharing Nigel.

Do you know why we still cannot import 2 XSD's of the same namespace in a tird schema?

Isn't this basic XSD design?

best regards

Bernard Lenssens
Left by Bernard Lenssens on Feb 02, 2005 7:25 PM

# re: My solution won't compile after applying BizTalk Server 2004 Service Pack 1 (SP1) - Exception Caught: Cannot use a prefix with an empty namespace
Requesting Gravatar...
Hi Bernard,

From my knowledge BTS uses a combination of namespace and root node name to reference a schema in the database. When more than one schema is deployed with the same namespace (or lack of)/root node combination, BTS doesn't know which schema to use. You can overcome this by using specific pipelines identifing which schema to use (which is best practice) but this does not explain the problem of multiple import statements and XSD's... I'm not too sure why BTS behaves a with import schemas the way it does.

I was working on a project that used the <a href="http://www.xcbl.org/xcbl40/xcbl40.html">(xCBL), version 4.0 schema</a> and it was a nightmare to get it to work with BizTalk 2004.

The schema uses recursive references which when I attempted to open in BizTalk it couldn't resolve. I had to remove the circular references to get the schema to load.

I asked someone at MS about this and their response was that their interpretation of the w3c schema design was such that circular references were not allowed...
Left by Nigel Parker on Feb 04, 2005 8:18 AM

# re: My solution won't compile after applying BizTalk Server 2004 Service Pack 1 (SP1) - Exception Caught: Cannot use a prefix with an empty namespace
Requesting Gravatar...
I ran into the same problem but it was pre-SP1. If I remember correctly, I got the same error but only when I actually ran the map. It would compile and build just fine. I was also trying to move the map outside of the Orchestration project to a new project so I thought that had something to do with it.

I solved the problem that same way you did with the additional map. Did you actually have this map working before SP1? Maybe they just added a check for this at compile time?

Stephen W. Thomas
Left by Stephen W. Thomas on Feb 08, 2005 3:15 AM

# re: My solution won't compile after applying BizTalk Server 2004 Service Pack 1 (SP1) - Exception Caught: Cannot use a prefix with an empty namespace
Requesting Gravatar...
Hi Stephen, yeah I did have the map working before SP1 it compiled and ran fine.

It's possibly got something to do with the XM GDR update; as I applied this at the same time as I installed SP1.

Nigel
Left by Nigel Parker on Feb 09, 2005 8:05 AM

# re: My solution won't compile after applying BizTalk Server 2004 Service Pack 1 (SP1) - Exception Caught: Cannot use a prefix with an empty namespace
Requesting Gravatar...
In relation to Bernard's original question about importing XSD's I have made another post here http://www.geekswithblogs.net/nparker/archive/2005/02/11/22632.aspx
Left by Nigel Parker on Mar 04, 2005 8:51 AM

Your comment:
 (will show your gravatar)


Copyright © Nigel Parker | Powered by: GeeksWithBlogs.net