This question is about how to archive WCF services in order to simplify development over time. Its hard to get a depth of reaction to this without describing the problem.
Background
I am developing a large WCF services and clients system. The server side is "easily" updated, since there are only 10 servers running under this code.
Clients are very difficult to update, despite the high degree of automation, for 300,000+ WCF clients, updates are something that will always take time and only achieve a high update success rate in two to three weeks.
Data contracts
[DataContract]
public class MyContract
{
[DataMember]
public int Identity {get; set;}
[DataMember]
public string Name {get; set;}
}
DataContractIt is difficult to initialize and has a standard MyContractFactoryinitialization class to get the appropriate instance for your machine.
public class static MyContractFactory
{
public static MyContract GetMyContract()
{
}
}
ServiceContracts
DataContract -.
namespace MyPrefix.WebServicve1
{
[ServiceContract]
public class IMyInterface1
{
[OperationContract]
public void DoSomethingWithMyContract(MyContract data);
}
[ServiceContract]
public class IMyInterface2
{
[OperationContract]
public void DoSomethingDifferentWithMyContract(MyContract data);
}
}
Client
, , , .
1
( WCF) DataContract , ServiceContract .
,
MyWebService1.MyContract
MyWebService2.MyContract
MyContractFactory . DataContract , , DataContract, , .
2
DataContract, ServiceContracts , ServiceContract, ( ).
, DataContract ServiceContracts?
? , ? , .
, MyDataContract, , ServiceContract? , ? ?
?
, , , , .
, ( , ),
- ,
ServiceContract ( OperationContract "" ). , , , .
[OperationContract]
public void DoSomethingWithMyContract(MyContract data);
[OperationContract(Name = "DoSomethingWithMyDataByAdditionalData"]
public void DoSomethingWithMyContract(MyContract data, MyContract2 additionalData);
, . .. .
1
"schemaless", . , , , .
[ServiceContract(
Name = "IServiceContract",
Namespace = "http://myurl/2012/05")]
public interface IServiceContract1
{
}
[ServiceContract(
Name = "IServiceContract",
Namespace = "http://myurl/2012/06")]
public interface IServiceContract2
{
}
public class MyService : IServiceContract1, IServiceContract2
{
}
<service behaviorConfiguration="WcfServiceTests.ServiceBehavior"
name="Test.MyService">
<endpoint
address="2012/05"
binding="wsHttpBinding"
contract="Test.IServiceContract1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="2012/06"
binding="wsHttpBinding"
contract="Test.IServiceContract2">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
, , ,
http://myurl.com/MyService.svc/2012/05 http://myurl.com/MyService.svc/2012/06
, ServiceContract, , ?
2
, update 1. WSDL , , .