Should a strict WCF service namespace be unique to a contract?

I specify Name and Namespace for each contract in my WCF services, as indicated in Microsoft Service Versioning . However, in their example, for each Namespace contract, there is always a suffix with the Name value, for example:

 [DataContract( Name = "PurchaseOrder", Namespace = "http://examples.microsoft.com/WCF/2005/10/PurchaseOrder")] public class PurchaseOrderV1 : IPurchaseOrderV1 { [DataMember(...)] public string OrderId {...} [DataMember(...)] public string CustomerId {...} } 

Why is PurchaseOrder a suffix for Namespace ? Isn't that redundant? Shouldn't Namespace reflect the entire immutable contract?

If I want my DataContracts and ServiceContracts be strictly versioned together, should the Namespace value not be http://examples.microsoft.com/WCF/2005/10/ ?

+4
source share
1 answer

It `s naturally.

http://examples.microsoft.com/WCF/2005/10/ defines the general value corresponding to the product version. Just as you have finer-grained namespaces in your C # code, you will do the same with WCF namespaces.

At the end of the day, a namespace is just a namespace and this kind of naming is only an agreement .

+4
source

All Articles