I'm creating a web service with a variety of classes, many of which can contain references to other classes. Sometimes these "sub classes" have the same name (e.g. Customer and Customer), but are actually different, so I've placed these in different namespaces (e.g. MyRoot.Sub1, MyRoot.Sub2, etc.)
When I build the service, the generated WSDL places all of these classes at the top level, without specifying any delineation by sub-namespace. Therefore, it will define two versions of "Customer". Curiously, it doesn't complain during the build process.
When I host the service and try to reference it with a browser, I get the following error:
The top XML element 'Customer' from namespace 'RE: http://...' references distinct types MyRoot.Sub1.Customer and MyRoot.Sub2.Customer. Use XML attributes to specify another XML name or namespace for the element or types.
I looks like I could use XmlTypeAttribute TypeName to provide an unique class name, but this makes documentation quite a hassle, as everything's going to have two names. Considering the differentiation is already specified by the namespaces, is there any way to utilize that information? I haven't tried using TypeName="Sub1.Customer", etc., but none of the examples that I've seen use this notation, so I'm skeptical.
Is there something else obvious that I'm missing?