WCF Beta 1 to Nov CTP Breaking Changes



My name is Ed Pinto.  I work on the team delivering the Windows Communication Foundation (WCF).  Part of my responsibility is to focus on the usability of WCF.  In an effort to make the transition to the Nov/05 CTP a little easier we've put together a list of breaking changes that describes changes you are most likely to run into when porting your app.  Feel free to contact me, or ask questions on the WCF forum.


Major changes














































































































































Beta1 Nov/05 CTP
Config
Binding Names changed: Dropped ‘Profile’ and made transport naming consistent
wsProfileBinding wsHttpBinding
wsProfileDualBinding wsDualHttpBinding
netProfileTcpBinding netTcpBinding
netProfileDualTcpBinding netTcpBinding
netProfileNamedPipeBinding netNamedPipeBinding
netProfileMsmqBinding netMsmqBinding
msmqIntegrationBinding msmqIntegrationBinding
basicProfileBinding basicHttpBinding
Several config names have been simplified
@serviceType on service type
@bindingSectionName on endpoint binding
@contractType on endpoint contract
@configurationName on binding name
@configurationName on behavior name
Object Model
Service changes
ServiceHost<T>() ServiceHost(typeof(T))
ServiceSite InstanceContext
[InstanceMode=InstanceMode.Singleton] [InstanceContextMode=
InstanceContextMode.Single]
[InstanceMode=InstanceMode.PrivateSession] [InstanceContextMode=
InstanceContextMode.PerSession]
[InstanceMode=InstanceMode.PerCall] [InstanceContextMode=
InstanceContextMode.PerCall]
[InstanceMode=InstanceMode.SharedSession] [InstanceContextMode=
InstanceContextMode.Shareable]
[OperationBehavior(AutoCompleteTransaction=
false]
[OperationBehavior(TransactionAutoComplete=
false]
[OperationBehavior(AutoEnlistTransaction=
false]
[OperationBehavior(TransactionScopeRequired=
false]
[BindingRequirements(
TransactionFlowRequirements=
RequirementsMode.Require)]
 [TransactionFlow(TransactionFlowOption.Required)]
On the operation
[BindingRequirements(
QueuedDeliveryRequirements=
RequirementsMode.Require)
[BindingRequirements(QueuedDeliveryRequirements=
BindingRequirementsMode.Required)
System.Runtime.Serialization.XmlFormatter is the default formatter. To use the XmlSerializer, apply the XmlSerializerFormat attribute
[ServiceContract(FormatMode=serializer)] [XmlSerializerFormat]
Client Changes
ProxyBase ClientBase<T>
IProxyChannel IClientChannel
Fault Changes
Fault<T> FaultException<T>
UnknownFault UnknownFaultException
DataContract
DataMember.IsOptional DataMember.IsRequired, default is false
Existing code that implements IBodyWriter will need to change to implement BodyWriter.OnWriteBodyContents instead of IBodyWriter.WriteBody
IBodyWriter BodyWriter
Binding Names changed: Dropped ‘Profile’ and made transport naming consistent
WsProfileBinding WSHttpBinding
WsProfileDualBinding WSDualHttpBinding
NetProfileTcpBinding NetTcpBinding
NetProfileDualTcpBinding NetTcpBinding
NetProfileNamedPipeBinding NetNamedPipeBinding
NetProfileMsmqBinding NetMsmqBinding
MsmqIntegrationBinding MsmqIntegrationBinding
BasicProfileBinding BasicHttpBinding

Changing Configuration:



  1. Replace <service serviceType="…"> with <service type="…">
  2. Replace <endpoint contractType="…" bindingSectionName= "…"> with <endpoint contract="…" binding="…">
  3. Replace <behavior configurationName="…"> with <behavior name="…">
  4. Replace <binding configurationName="…"> with <binding name="…">
  5. Replace the old binding names with the new ones. Refer to the table for the new binding names.

You no longer configure a uniquely named security element within a binding configuration. You set the security mode (usually one of Transport, Message, or TransportWithMessageCredential) using binding\security\@mode. Depending on the binding and the selected security mode, you configure the binding\security\message element or the binding\security\transport element.


In the same way, reliableSession is a standard element available under most bindings.


The following is a sample of new configuration:

<configuration>
    <
system.serviceModel
>

        <
services
>
            <
service

               
type="Microsoft.ServiceModel.Samples.CalculatorService"

               
behaviorConfiguration="CalculatorServiceBehavior">
                <!--
use base address provided by host
-->
                <
endpoint address=
""
                   
binding="wsHttpBinding
"
                   
bindingConfiguration="MessageSecurity
"
                   
contract="Microsoft.ServiceModel.Samples.ICalculator"
/>
            </
service
>
        </
services
>

        <
bindings
>
            <
wsHttpBinding
>
                <
binding name="MessageSecurity"
>
                    <
security mode="Message"
>
                        <
message clientCredentialType="Windows"
/>
                    </
security
>
                </
binding
>
            </
wsHttpBinding
>
        </
bindings
>

        <
behaviors
>
            <
behavior

               
name="CalculatorServiceBehavior"
>
                <
metadataPublishing enableHelpPage="false"
/>
            </
behavior
>
        </
behaviors
>

    </
system.serviceModel
>
</
configuration
>


Here is a sample client config:


<
configuration>
    <
system.serviceModel
>

        <
client
>
            <
endpoint address="
http://localhost/servicemodelsamples/service.svc"
                     
binding="wsHttpBinding"

                     
bindingConfiguration="MessageSecurity"

                     
contract="ICalculator"
/>
        </
client
>

        <
bindings
>
            <
wsHttpBinding
>
                <
binding name="MessageSecurity"
>
                    <
security mode="Message"
>
                        <
message clientCredentialType="Windows"
/>
                    </
security
>
                </
binding
>
            </
wsHttpBinding
>
        </
bindings
>

    </
system.serviceModel
>
</
configuration
>


For client code, your best bet is to rerun svcutil.


Namespaces























Removed
Microsoft.Tools.Indigo
Microsoft.Transactions.Bridge.Configuration
Microsoft.Transactions.Bridge.Dtc
Microsoft.Transactions.Wsat.Protocol
System.ServiceModel.Diagnostics
System.ServiceModel.QueueHelper
System.ServiceModel.QueueHelper.Design
System.Transactions.Isolation
System.Transactions.Recovery






Added
System.ServiceModel.Install.Configuration

Detail


Detailed API change reports are available here on Omri's blog.  They cover:



  • Beta1 to Nov/05 CTP
  • Beta 1 to PDC,
  • PDC to Nov/05 CTP

These reports are not intended for end to end consumption, but rather they offer a reference to help you decipher changes when you know the name of an API in the Beta1, the PDC, or the Nov/05 CTP build.


Update Dec 14, 2005:  Added link to detailed list.


Update Dec 20, 2005:  Corrected InstanceMode.Shared to be InstanceMode.Shareable


Skip to main content