Dela via


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

 

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="https://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