When declaring complex types in XML schema definition, I have grown accustomed to suffix the type name with “_Type”. This allows me to easily distinguish a complex type from a global type when viewing the definition in a graphical design tool such as XML Spy. However, it has unintended consequences when incorporating such schema into a web service.
When using Microsoft’s Web Service proxy class generator (wsdl.exe) , the generator uses the type name for the names of the classes it generates. Which means you’ll end up with something like this:
WS.Employee_Type employee = new WS.Employee_Type();
Not as readable as this:
WS.Employee employee = new WS.Employee();
Also, avoid using the “any” type, as it produces a blank class. If you cannot avoid it, you must hand tweak the generated class to use a string type instead.