In our production environment, our WCF services are serialized using XMLSerializer. To do this, our service interfaces have the [XMLSerializerFormat] attribute. Now we need to switch to the DataContractSerializer, but we must remain compatible with our existing customers. Therefore, we must expose each service using serializers.
We have one limitation: we do not want to redefine each contract interface twice, we have 50 contract service interfaces, and we do not want to have
IIncidentServiceXml
IIncidentServiceDCS
IEmployeeServiceXml
IEmployeeServiceDCS
IContractServiceXml
IContractServiceDCS
How can we do this?
Additional Information
This is a description of what we have tried so far, but I am ready to try completely different approaches:
ServiceHostFactory. . , WCF , , ContractDescription. , ContractDescription.
:
, ContractDescription. , (IIncidentService), :
http:
http:
, :
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.XmlSerializerOperationBehavior
contract: http://ourcompany.cs/XML:IUserServiceWCF
at System.ServiceModel.Description.XmlSerializerMessageContractExporter.ExportFaults(Object state)
at System.ServiceModel.Description.MessageContractExporter.ExportMessageContract()
at System.ServiceModel.Description.XmlSerializerOperationBehavior.System.ServiceModel.Description.IWsdlExportExtension.ExportContract(WsdlExporter exporter, WsdlContractConversionContext contractContext)
at System.ServiceModel.Description.WsdlExporter.CallExtension(WsdlContractConversionContext contractContext, IWsdlExportExtension extension)