yysun's space

WCF Bindings I have used

Posted on: December 1, 2009

My stories with WCF:
 
1) WCF is very easy to expose functions through different endpoints by just configuring endpoints. I created a WCF in Web application to serve Silverlight 2. It has a basicHttpBinding endpoint and a mexHttpBinding. It worked perfectly w/o change to serve Sliverlight 3. Later on, I added webHttpBinding endpoint (enabled web script). It worked with ASP.NET AJAX Client data template (not cross domain yet). Next I will try if it is possible to add a custom binding with binary encoding for Silverlight 3.
 
2) WCF is still too hard for non .NET clients. My client was a Delphi 7 program. It dose not support wsHttpBinding (SOAP 1.2). Even with basicHttpBinding (SOAP 1.1), Delphi could not generate proxy from the WSDL, because the WSDL of WCF uses "include". End of the day I created a ASMX wrapper around the WCF interface and implemetation. It was a success, because the ASMX follows the important concept of service interface, service implementation, service host and etc, just like WCF. In the future, if ASMX is need, I will start with WCF and wrap it with ASMX.
 
3) Nightmare of configuing the SSL for WCF. It requires to configure the base address in web.config. It was every difficult for a server that has many virtual sites. Metabase Exploerer is need to configure the IIS 6′ SSL binding.
 
4) Both WCF(basicHttpBinding endpoint) and ASMX work perfectly with my basice authentication HttpModule. As well as the ASP.NET client application (authentication) service.
 
For future reference, I need to write down my wresting experiences with a few commoly used WCF binginds.
 
  • basicHttpBinding – SOAP 1.1
  • wsHttpBinding – SOAP 1.2 (looks like it is only good for .NET client)
  • webHttpBinding – HTTP/REST
  • for ASP.NET AJAX Client/JSON, in web.config created a new endpoint with address "/ajax", and defined the <endpointBehaviors> to have  <enableWebScript />, now the URL …/xxx.svc/ajax/js and …/xxx.svc/ajax/jsdebug return proxy in Javacript. The proxy is used by the client template for data binding
  • for REST, in web.config created a new endpoint with address "/xml" and defined the  <endpointBehaviors> use <webHttp/>. now the [WebGet] attribute works for URL …/xxx.svc/xml/Id=123. [XmlSerializerFormat] was used to control the XML schema structure.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


  • None
  • Pk: The horizontal view is a pleasure to use! Good thinking
  • randyburden: A valiant and commendable effort. Your use of Tuple is a little weird but it offers a feature that most other microORMs don't. Your use of a static Gu
  • reav: great work done on Rabbit Framework. just started to learning it, and by now i think it will solve all my problems and questions, that i had in webpag

Categories

%d bloggers like this: