.net - Setting WCF DataContract namespace using ContractNamespace attribute -


In designing my service, I decided that I want to customize those namespaces that resulted in WSDL as a result.

For data contracts, I came to the attribute, which was a good shortcut option for setting explicitly the same namespace for each data contract. My initial effort looks like this:

  [Assembly: Agreement Name ("http://types.mycompany.com/2010/08/03")] Namespace My Companion.MyContractes {[DataContract ] / / ... lots of datacrunch classes}  

To my surprise, it was not working after a lot of tinkering, I was successful only when I finally < The CLUE> ClrNamespace property is set to be equal to my CLR namespace (example MyCompany.MyContracts). Such a thing

  [assembly: contract name ("http://types.mycompany.com/2010/08/03", ClrNamespace = "MyCompany.MyContracts")]  < / Pre> 

My question is: why did not it go first? I was hoping that by specifying not the CLR namespace, this feature would affect all assembly-wide datacontractions.

If I am not mistaken, if ClrNamespace is terminated , Then the contract namespace setting applies to the object in the global namespace.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -