About Me

My photo
Northglenn, Colorado, United States
I'm primarily a BI Developer on the Microsoft stack. I do sometimes touch upon other Microsoft stacks ( web development, application development, and sql server development).

Wednesday, March 12, 2008

WCF Binding Info

BasicHttpBinding

Element Collection

System.ServiceModel.Channels.TextMessageEncodingBindingElement
System.ServiceModel.Channels.HttpTransportBindingElement

Support Features

  • Transport-Level Security
  • Message-Level Security
  • WS-*Interoperability

Use if

  • Need basic level of interoperability

Performance : Good

Communication

  • Request/Reply
  • One-Way


WSHttpBinding

Element Collection

System.ServiceModel.Channels.TransactionFlowBindingElement
System.ServiceModel.Channels.SymmetricSecurityBindingElement
System.ServiceModel.Channels.TextMessageEncodingBindingElement
System.ServiceModel.Channels.HttpTransportBindingElement

Support Features

  • Transport-Level Security
  • Message-Level Security
  • WS-*Interoperability
  • WS-*Transactions
  • Reliable Sessions / Reliable Messaging

Use if

  • Need WS-* level of interoperability

  • Don't need duplexing

  • Don't need federated security

Performance : Good

Communication

  • Request/Reply
  • One-Way


WSDualHttpBinding

Element Collection

System.ServiceModel.Channels.TransactionFlowBindingElement
System.ServiceModel.Channels.ReliableSessionBindingElement
System.ServiceModel.Channels.SymmetricSecurityBindingElement
System.ServiceModel.Channels.CompositeDuplexBindingElement
System.ServiceModel.Channels.OneWayBindingElement
System.ServiceModel.Channels.TextMessageEncodingBindingElement
System.ServiceModel.Channels.HttpTransportBindingElement

Support Features

  • Transport-Level Security
  • Message-Level Security
  • WS-*Interoperability
  • WS-*Transactions
  • Reliable Sessions / Reliable Messaging

Use if

  • Need WS-* level of interoperability

  • Need Duplexing

Performance : Good

Communication

  • Request/Reply
  • One-Way
  • Duplex


NetTcpBinding

Element Collection

System.ServiceModel.Channels.TransactionFlowBindingElement
System.ServiceModel.Channels.BinaryMessageEncodingBindingElement
System.ServiceModel.Channels.WindowsStreamSecurityBindingElement
System.ServiceModel.Channels.TcpTransportBindingElement

Support Features

  • Transport-Level Security
  • Message-Level Security
  • WS-*Transactions
  • Reliable Sessions / Reliable Messaging

Use if

  • Don't need interoperability

  • Is not local

  • Don't need queuing

  • Don't need peer networking

Performance : Better

Communication

  • Request/Reply
  • One-Way
  • Duplex


NetNamedPipeBinding

Element Collection

System.ServiceModel.Channels.TransactionFlowBindingElement
System.ServiceModel.Channels.BinaryMessageEncodingBindingElement
System.ServiceModel.Channels.WindowsStreamSecurityBindingElement
System.ServiceModel.Channels.NamedPipeTransportBindingElement

Support Features

  • Transport-Level Security
  • WS-*Transactions

Use if

  • Don't need interoperability

  • Is local

Performance : Best

Communication

  • Request/Reply
  • One-Way
  • Duplex


NetMsmqBinding

Element Collection

System.ServiceModel.Channels.BinaryMessageEncodingBindingElement
System.ServiceModel.Channels.MsmqTransportBindingElement

Support Features

  • Transport-Level Security
  • Message-Level Security
  • Durable Reliable Messaging

Use if

  • Don't need interoperability

  • Is not local

  • Need Queuing

  • Don't need legacy MSMQ

Performance : Better

Communication

  • One-Way


NetPeerTcpBinding

Element Collection

System.ServiceModel.Channels.PnrpPeerResolverBindingElement
System.ServiceModel.Channels.BinaryMessageEncodingBindingElement
System.ServiceModel.Channels.PeerTransportBindingElement

Support Features

  • Transport-Level Security

Use if

  • Don't need interoperability

  • Is not local

  • Need queuing

  • Need peer networking

Performance : Good

Communication

  • One-Way
  • Duplex


MsmqIntegrationBinding

Element Collection

System.ServiceModel.MsmqIntegration.MsmqIntegrationBindingElement

Support Features

  • Transport-Level Security
  • Durable Reliable Messaging

Use if

  • Don't need interoperability

  • Is not local

  • Need queuing

  • Need legacy MSMQ

Performance : Better

Communication

  • One-Way


WSFederationHttpBinding

Element Collection

System.ServiceModel.Channels.TransactionFlowBindingElement
System.ServiceModel.Channels.SymmetricSecurityBindingElement
System.ServiceModel.Channels.TextMessageEncodingBindingElement
System.ServiceModel.Channels.HttpTransportBindingElement

Support Features

  • Transport-Level Security
  • Message-Level Security
  • WS-*Interoperability
  • Reliable Sessions / Reliable Messaging

Use if

  • Need WS-* level of Interoperability

  • Don't need duplexing

  • Need federated security

Performance : Good

Communication

  • Request/Reply
  • One-Way

WS2007HttpBinding

Element Collection

System.ServiceModel.Channels.TransactionFlowBindingElement
System.ServiceModel.Channels.SymmetricSecurityBindingElement
System.ServiceModel.Channels.TextMessageEncodingBindingElement
System.ServiceModel.Channels.HttpTransportBindingElement

Support Features

  • Transport-Level Security
  • Message-Level Security
  • WS-*Interoperability
  • WS-*Transactions
  • Reliable Sessions / Reliable Messaging

Use if

  • Need WS-* level of Interoperability

  • Don't need duplexing

    Don't need federated security

Performance : Good

Communication

  • Request/Reply
  • One-Way


WS2007FederationHttpBinding

Element Collection

System.ServiceModel.Channels.TransactionFlowBindingElement
System.ServiceModel.Channels.SymmetricSecurityBindingElement
System.ServiceModel.Channels.TextMessageEncodingBindingElement
System.ServiceModel.Channels.HttpTransportBindingElement

Support Features

  • Transport-Level Security
  • Message-Level Security
  • WS-*Interoperability
  • Reliable Sessions / Reliable Messaging

Use if

  • Need WS-* level of Interoperability

  • Don't need duplexing

  • Need federated security

Performance : Good

Communication

  • Request/Reply
  • One-Way

Tuesday, March 04, 2008

WCF Error: HTTP could not register URL http://+:80/Temporary_Listen_Addresses// because TCP port 80 is being used by another application

So I was doing a dual http binding (WSDualHttpBinding) [page 53-54 in Essential Windows Communication Foundation For .Net Framework 3.5] when I got the error above. I doubled checked by running the svcutil and the wizard, but with no luck.

 

Found the solution at(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2782499&SiteID=1)

 

Just need to include the clientBaseAddress attribute with a URI in the binding tag, since the default is using port 80.

 

<?xml version="1.0" encoding="utf-8"?>

<configuration>

   <system.serviceModel>

      <bindings>

         <wsDualHttpBinding>

               <binding   name="WSDualHttpBinding_IServerStock"

                        closeTimeout="00:01:00"

                        openTimeout="00:01:00"

                        receiveTimeout="00:10:00"

                        sendTimeout="00:01:00"

                        bypassProxyOnLocal="false"

                        transactionFlow="false"

                        hostNameComparisonMode="StrongWildcard"

                        maxBufferPoolSize="524288"

                        maxReceivedMessageSize="65536"

                        messageEncoding="Text"

                        textEncoding="utf-8"

                        useDefaultWebProxy="true"

                        clientBaseAddress="http://localhost:8001/WCFDuplexService">

               <readerQuotas   maxDepth="32"

                           maxStringContentLength="8192"

                           maxArrayLength="16384"

                           maxBytesPerRead="4096"

                           maxNameTableCharCount="16384" />

               <reliableSession   ordered="true"

                              inactivityTimeout="00:10:00" />

               <security   mode="Message">

                  <message   clientCredentialType="Windows"

                           negotiateServiceCredential="true"

                           algorithmSuite="Default" />

               </security>

            </binding>

         </wsDualHttpBinding>

      </bindings>

      <client>

         <endpoint   address="http://localhost:8000/WCFDuplexService"

                  binding="wsDualHttpBinding"

                  bindingConfiguration="WSDualHttpBinding_IServerStock"

                  contract="IServerStock"

                  name="WSDualHttpBinding_IServerStock">

            <identity>

               <userPrincipalName value="wandrus@mbsnav.com" />

            </identity>

         </endpoint>

      </client>

   </system.serviceModel>

</configuration>

Generating WCF's app.config and proxy class.

Currently reading: Essential Windows Communication Foundation for .Net Framework 3.5. The book is written for Visual Studio 2008, but I'm running on VS 2005 -- which means that I will have to run the svcutil.exe instead of using the wizard on some cases.  A quick reminder on how to do so:

 

Synchronous:

svcutil <Host Service IMetadataExchange address> -config:app.config -out:generatedProxy.cs

Example:

svcutil http://localhost:8000/EssentialWCF/mex -config:app.config -out:generatedProxy.cs

Asynchronous:

Example:

svcutil http://localhost:8000/EssentialWCF/mex -config:app.config -out:generatedProxy.cs /async

The svcutil.exe comes with Microsoft's SDK 6.0, for more information on this tool can be found at: http://msdn2.microsoft.com/en-us/library/aa347733.aspx