0
我們創建並部署了各種第三方正在使用的WCF服務。在不影響客戶端的情況下更改WCF項目的名稱空間
但是,我們現在想要更改該特定項目中類的名稱空間。無論如何沒有第三方必須做出任何改變才能達到目的?
實施例:
namespace Test.Service
{
[ServiceContract]
public interface MyService
{
[OperationContract]
List<People> GetPeople();
}
public class MyService : IMyService
{
public List<People> GetPeople()
{
// Logic here
}
}
}
namespace Test.Service.DTO
{
[DataContract]
public class Person { }
}
到
namespace Something.Different
{
[ServiceContract]
public interface MyService
{
[OperationContract]
List<People> GetPeople();
}
public class MyService : IMyService
{
public List<People> GetPeople()
{
// Logic here
}
}
}
namespace Something.Different.DTO
{
[DataContract]
public class Person { }
}
它實際上似乎是一個問題主要與命名空間對於在所述WDSL產生的DTO的。
他們是從
http://schemas.datacontract.org/2004/07/Test.Service.DTO
這似乎是導致從調用的結果(不出錯)不反序列化,因此名單最終被更改爲
http://schemas.datacontract.org/2004/07/Something.Different.DTO
空。