Xml Namespace Collision from Common Schema



I've run into a frustrating situation with ASP.NET web services. I
have an XML Schema (xsd) which is run through the "xsd.exe" tool to
generate strongly-typed, and XML serializable data object classes.
This is compiled into a standalone DLL assembly and placed in the GAC
which makes these common data structure definitions available to a lot
of different code. I then have many different applications and
assemblies referencing this schema-generated assembly and passing
around these data structures.

On top of this architecture I have constructed several different
ASP.NET web services which are designed to run behind our firewall.
These web services all reference the common data structures from the
GAC assembly and pass them around as parameters and return values.
Each web service provides services for different data domains in our
enterprise and each has unique functionality, but each is using the
common types from the GAC assembly for things like reference lists and
error message reporting.

Recently I had to construct a new web service which was designed to
sit outside our firewall and act as a "proxy" to a small number (but
more than one) of the internal web services used in our applications.
The idea was to expose a small subset of functionality outside the
firewall with a custom SOAP header for authentication. This small web
service had no real logic in it other than to authenticate with the
custom SOAP head and then pass the call through the firewall to the
appropriate web internal web service.

This new web service compiles and deploys just fine, but when the ASMX
is queried (either in the debugger or directly from IIS) an exception
is thrown stating that one of my common data structures (from the GAC
assembly) is declared in more than one of my web references (to the
internal web services) with the same name and the same XML namespace.
This is declared to be an Xml Namespace Collision and my external web
service is DOA. The exception indicates that my only resolution is to
use XML attributes to change the XML namespace of one of the
declarations (which I can't do since the XML namespace is coming from
the common GAC dll).

I understand Xml Namespace Collisions and why different data
structures with the same name need to reside in different XML but this
has me frustrated. In this case the underlying "collision" is, in
fact, a reference to a common Xml Namespace and a data structure which
is identical. The ASP.NET Web Service parser is complaining that I've
called the same data structure by the same name in the same Xml


Kent Jones
Sr. App. Dev.
Bain Capital, LLC

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Latest member

Latest Threads