Here's the scenario:
Let’s say you have a XSD called Foo.XSD that has a namespace of
“http://myfoo/foo”
You create a contract first wsdl file with operation of “AddFoo” which takes
Foo as a parameter. It generates the code for Foo.cs, etc.
Now, in a client app, if you make a reference to the service and instantiate
a “Foo” object…What happens is that you get one without a namespace…the
http://myfoo/foo is not in the XML when you serialize the object.
If you take the exact same Foo.cs file from the service code and add that to
the client project and instantiate that Foo object…you get the Foo object
with the namespace in tact.
A simple thing yet important….why doesn’t the first instantiation have the
namespace? It’s the exact same XSD AND cs file.