WCF Interoperability – ASMX, WCF or MVC REST SDK - Open Questions#

A while ago I did a blog post on WCF-ASMX interoperability which came out from an experience I had in service collaboration with a partner. In a recent conversation with Jeff Bergman, a friend and co-worker, there was a question of WCF or not to WCF on a project which requires similar service interop and since I believe in Atwood’s theory of strong opinions held weekly, I jumped in with the opinion of using WCF contrary to my own earlier recommendation.

Jeff of course disagreed and pointed out the Christian’s Weyer’s article on flattening. For my excellent logging and tracing in WCF argument, he stated that “for asmx, you can add the [SoapLoggerExtensionAttribute] to get some kind of logging of soap requests”. Therefore I am quoting his argument below; I am still somewhat unconvinced 'in principle' but pragmatically speaking, he drives a hard bargain!

“At the end of the day, I think the WCF architecture is powerful but with power comes complexity, complexity in configuration files and complexity in the wsdl it generates and complexity in the pipeline architecture and how you can plug into it.

As for Rest, the WCF team has developed the MVC Rest SDK.

I prefer convention over configuration and simplicity of code instead of injection as a general principle.

My preference would to be to use WCF in situations where you have more control over the client (internal uses mainly) and want to support different communication channels.  At the end of the day when dealing with partners, Interoperability is the biggest challenge and making things as simple to consume as possible is desirable.

Have you encountered an interop issue with your WCF service and what has been your approach? Leave a comment or email me.

Happy Coding!





9/21/2009 11:31:53 AM (Pacific Standard Time, UTC-08:00) #    Comments [6]  |  Trackback

 

Doesn’t Smell like SOA? You may be right! What is NOT SOA?#

The Large Hadron Collider was created to help unlock the secrets of the universe. And also to create a working SOA implementation. (SOAFacts.com)

In a recent all-things-technology dinner conversation with a friend and developer extraordinaire Rashid, we talked about his recent purchase, Thomas Erl’s Service-oriented architecture: concepts, technology, and design. During this discussion he rightfully pointed out how virtually any and every distributed system is being dubbed “service oriented” raising a great point that since a lot has been said about “what SOA is?”, we should now talk about “what SOA is NOT” since this might be a able to clear things up as compared to, if it walks like SOA and talks like SOA... Hence I figured a typical non-SOA conversation may go as follows.


RealWorldPHB: “Do we have service oriented architecture? I have been hearing good things about it lately and the new partners really prefer it. Let’s go and buy one SOA or do they come in bulk?”

PerpetuallyPleasingIncompetentArchitect: “Of course we do have SOA sir, we are using web services for a long time, ahead of the curve!”

RWPHB: “Great; so we promote reuse, share contracts and schemas, do all those good things?”

PPIA: “No no, that’s too much work. Instead we share the dll’s and email it to our partners as soon as we sign the contract so they can build according to the specs. You gotta have specs for SOA”

RWPHB: “Even better; who cares about interop, right? If they have their SOA in order, they should be able to talk to us!”

PPIA: “Yessir!, you are right. We are loyal to our platform and we try to enforce uniformity, its better this way. Also our services share one database to ensure concurrency and integrity; someone called it violation of autonomous service principle and a bottleneck but we got rid of him!. We also bought that expensive SOA hardware solution and matching software suite to make sure our SOA works fine”.

RWPHB: “Glad you got rid of darn naysayer, these people upset me!. Anyways, so when we release the API update next month, how is going to work in SOA?”

PPIA: “Well, we want everyone to strictly follow our standards so we made sure our SOA does not allow any versioning. All 2000+ partners will be informed on deployment night to update their interfaces or they won’t be able to use our services. Now this is iron SOA as in iron fist!. I should patent this term.”

RWPHB: “Not sure what that means but it sounds good! I am going to tell board of directors we have SOA, woot!”


Now I should mention as a disclaimer that above mentioned conversation is a poor satirical attempt on my part on general state of SOA. Any similarity to actual persons or SOA’s, living or dead is purely coincidental. And that if you hear any such conversations in the corridors of power, hide! (No not really, educate please).

To make sure that you don’t have one of these conversations, let’s design with SOA tenants in mind. If this sounds too fancy, a simple breakdown of what is NOT SOA would be as follows.

  • Boundaries are Not explicit
  • Services are Not Autonomous
  • Services do Not share Schema and Contract, but Class
  • Compatibility is Not based upon Policy

There you go! This sums up all the things which would make your SOA design, a non-SOA design.

Ok, may be just adding a negation operator is not the best approach, let’s go with catch phrase methodology.

You might be a non-SOA if

  • Your services are too much dependent on each other.
  • Your service does not support versioning in contracts.
  • You have to pass around jars and dll’s to share contracts.
  • If your contracts and implementation are not properly isolated for consumers.
  • You have an enterprise SOA strategy even though your business stakeholders didn’t sit down with IT architects to examine business processes across the organization.
  • Your services use SOAP as a panacea when interop could have been better achieved with RESTful services.
  • Data is ignored and governance means a config file to turn off the service response to 500.
  • Your entire SOA strategy is implementing web services / BPM  / CEM / any other TLA including SOA (this will make it a circular definition).
  • A client is passing a database connection string to your service call…

Yeah, I agree the last one is probably just plain bad design.

and as if this has not been fun enough, let’s end with a knock-knock joke courtesy of SOAFacts.

Knock, knock
Who's there?
SOA
SOA who?
You're fired.


References

 





9/8/2009 1:02:40 PM (Pacific Standard Time, UTC-08:00) #    Comments [6]  |  Trackback

 

Teaching Programming WCF @ UCSD Ext. 1/24/2009 - 2/7/2009 #
I will be teaching a three day WCF course at the UCSD Extension campus on Lusk Blvd, San Diego. The first class is this coming Saturday. If you are interested, further details and enrollment information can be found here.

Programming Windows Communication Foundation (WCF)

CSE-40114  Credit: 3 units

Windows Communication Foundation (WCF) is a new object model for building distributed applications using .NET 3.0. WCF was designed to expose the current multitude of Windows remoting APIs (web servcies, MSMQ, Com+, peer-to-peer) using a single unified object model. In this course, attendees will examine the overall WCF object model, binding choices, host options and the use of declarative markup to specify the underlying infrastructure.

Section ID:      068791
Time/Dates:     Sa, 8:00 a.m. - 5:00 p.m. 1/24/2009 - 2/7/2009 (3 mtgs.)
Location:     Room 110, UCSD Extension Sorrento Mesa Center, 6925 Lusk Blvd, San Diego

Feel free to contact me if you have any questions or comments about the course. For enrollment, here is the link.





1/22/2009 4:11:18 PM (Pacific Standard Time, UTC-08:00) #    Comments [1]  |  Trackback

 

geekSpeak recording - REST and the Windows Azure Services Platform with Adnan Masood #
Windows Azure provides developers with on-demand compute and storage to host, scale, and manage Web applications on the Internet.

In this geekSpeak webcast, Adnan Masood illustrates how to create and host services in the cloud. Adnan highlights key features of the platform software development kit (SDK), addresses how to implement RESTful interfaces (available remotely and from the data center), and describes how to run Microsoft ASP.NET Web applications or Microsoft .NET code in the cloud.
 
The geekSpeak webcast series brings you industry experts in a "talk-radio" format hosted by developer evangelists from Microsoft. These experts share their knowledge and experience about a particular developer technology and are ready to answer your questions in real time during the webcast. Your hosts for this geekSpeak are Lynn Langit and Lindsay Rutter. To ask a question in advance of the live webcast, or for post-show resources, be sure to visit the geekSpeak blog.





1/19/2009 10:19:28 PM (Pacific Standard Time, UTC-08:00) #    Comments [1]  |  Trackback

 

List of Out of the box WCF Bindings (including 3.5) - Note to Self#

Following is the list of WCF out-of-the-box bindings, brief information about them (from MSDN) and the link which points to further details. I have ordered them according to the frequency of use in my opinion, YMMV.

BasicHTTPBinding
Represents a binding that a Windows Communication Foundation (WCF) service can use to configure and expose endpoints that are able to communicate with ASMX-based Web services and clients and other services that conform to the WS-I Basic Profile 1.1. The BasicHttpBinding uses HTTP as the transport for sending SOAP 1.1 messages. A service can use this binding to expose endpoints that conform to WS-I BP 1.1, such as those that ASMX clients consume. Similarly, a client can use the BasicHttpBinding to communicate with services exposing endpoints that conform to WS-I BP 1.1, such as ASMX Web services or services configured with the BasicHttpBinding. Security is turned off by default, but can be added setting the mode attribute of the <security> of <basicHttpBinding> child element to a value other than None. It uses a "Text" message encoding and UTF-8 text encoding by default.

webHTTPBinding
A binding used to configure endpoints for Windows Communication Foundation (WCF) Web services that are exposed through HTTP requests instead of SOAP messages.The WCF Web Programming Model allows developers to expose WCF Web services through HTTP requests that use "plain old XML" (POX) style messaging instead of SOAP-based messaging. For clients to communicate with a service using HTTP requests, an endpoint of the service must be configured with the WebHttpBinding that has the WebHttpBehavior attached to it. The WCF Web Programming Model also requires that the individual service operations are annotated with the WebGetAttribute or WebInvokeAttribute attributes. This defines a mapping from a URI and HTTP method to the service operation, as well as the format of the messages used to call the operation and return the results. Support in WCF for syndication and ASP.AJAX integration are both built on top of the WCF Web Programming Model.

wsHttpBinding
Represents an interoperable binding that supports distributed transactions and secure, reliable sessions. The WSHttpBinding is similar to the BasicHttpBinding but provides more Web service features. It uses the HTTP transport and provides message security, as does BasicHttpBinding, but it also provides transactions, reliable messaging, and WS-Addressing, either enabled by default or available through a single control setting.

netTCPBinding
A secure, reliable binding suitable for cross-machine communication. The NetTcpBinding generates a run-time communication stack by default, which uses transport security, TCP for message delivery, and a binary message encoding. This binding is an appropriate Windows Communication Foundation (WCF) system-provided choice for communicating over an Intranet.

BasicHTTPContextBinding
Enables context for the BasicHttpBinding to be exchanged with HTTP cookies as the context exchange mechanism. The BasicHttpContextBinding adds a ContextBindingElement to the stack of BindingElement objects in the system-provided BasicHttpBinding. This enables SOAP headers to be used to exchange context.

NetMsmqBinding
Represents a queued binding that is suitable for cross-machine communication.
The NetMsmqBinding binding provides support for queuing by leveraging Microsoft Message Queuing (MSMQ) as a transport and enables support for loosely coupled applications, failure isolation, load leveling and disconnected operations.

wsDualHttpBinding
A secure and interoperable binding that is designed for use with duplex service contracts that allows both services and clients to send and receive messages.The WSDualHttpBinding provides the same support for Web Service protocols as the WSHttpBinding, but for use with duplex contracts. WSDualHttpBinding only supports SOAP security and requires reliable messaging. This binding requires that the client has a public URI that provides a callback endpoint for the service. This is provided by the ClientBaseAddress. A dual binding exposes the IP address of the client to the service. The client should use security to ensure that it only connects to services it trusts.

netPeerTCPBinding
Provides a secure binding for peer-to-peer network applications.The NetPeerTcpBinding binding provides support for the creation of peer networking applications that use a TCP-level peer-to-peer mesh infrastructure.

netNamedPipeBinding
Provides a secure and reliable binding that is optimized for on-machine communication.
The NetNamedPipeBinding generates a run-time communication stack by default, which uses transport security, named pipes for message delivery, and a binary message encoding. This binding is an appropriate Windows Communication Foundation (WCF) system-provided choice for on-machine communication. It also supports transactions.

MSMQIntegrationBinding
The MsmqIntegrationBinding class maps Microsoft Message Queuing (MSMQ) messages to Windows Communication Foundation (WCF) messages.

netTCPContextBinding
Provides a context-enabled binding for the NetTcpBinding. The NetTcpContextBinding adds a ContextBindingElement to the stack of BindingElement objects in the system-provided NetTcpBinding. This enables SOAP headers to be used to exchange context.

ws2007HttpBinding
Represents an interoperable binding that derives from WSHttpBinding and provides support for the updated versions of the Security, ReliableSession, and TransactionFlow binding elements. The WS2007HttpBinding class adds a system-provided binding similar to WSHttpBinding but uses the Organization for the Advancement of Structured Information Standards (OASIS) standard versions of the ReliableSession, Security, and TransactionFlow protocols. No changes to the object model or default settings are required when using this binding.

wsHttpContextBinding
The WSHttpContextBinding adds a ContextBindingElement to the stack of BindingElement objects in the system-provided WsHttpBinding. This enables SOAP headers to be used to exchange context when HTTP cookies are not enabled.

wsFederationHttpBinding
A secure and interoperable binding that supports federated security.





11/25/2008 1:46:37 PM (Pacific Standard Time, UTC-08:00) #    Comments [1]  |  Trackback

 

Cloud Computing#
A comparison of Google AppEngine, Amazon EC2 and Sun Project Caroline.
Cloud Computing
View SlideShare presentation or Upload your own. (tags: ec2 appengine)
Thanks to Rashid Kamran for pointing me to it.



10/8/2008 7:36:50 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

WADL (Web Application Description Language) - Call for Contributors for Open Source CodePlex Project#
For those who use Windows Communication Foundation extensively know that unlike SOAP based services, there is a lack of REST services contractual support in WCF. In lieu of this need, I have started this project, WADL on CodePlex, to build a tool which generates code for RESTFul Web services and RESTFul Web service clients from WADL contract files.

With YABE and everything else going on, I think I would need some significant help from open source volunteers and contributing developers looking forward to work in the area of REST interoperability. Interested? email me
or contact via codeplex.

The intent of this project is to for .wadl, do exactly what WSDL does for SOAP based services. Further details about WADL file format are as follows.

A .wadl file is an XML document written in an XML grammar called Web Application Description Language (WADL). This file defines how an REST based Web service behaves and instructs clients as to how to interact with the service. When you use Wadl.exe to create a proxy class, a single source file is created in the programming language that you specify. In the process of generating the source code for the proxy class, the tool determines the best type to use for objects specified in the service description.

wadl: Web Application Description Language (WADL) - Specification ...
Web Application Description Language (WADL) https://wadl.dev.java.net/wadl20061109.pdf

WADL_Screenshot.JPG

The WADL specification (PDF) and WADL schema describe the features of the language in detail but a few points are worth highlighting: [1]
  • Generative URIs are handled by including support for parameterization of URI components.
  • The base set of HTTP methods (GET, POST, PUT, DELETE, HEAD) are specifically supported by the WADL schema but the method enumeration is open to use with other methods such as those specified by WebDAV.
  • Representation parameters are hints to processors that point out interesting parts of a resource representation. As such they may be used or ignored as desired. I think they'll be useful for RPC-like interactions but less so for more document oriented work.
  • Sibling representation elements represent alternative representations of the same resource. This means you can describe a resource that is offered in alternate formats, e.g. XML or HTML.
  • The design center is XML/HTTP but this doesn't preclude use with alternate representation formats: the representation/@mediaType attribute provides the necessary hook.
Reference
[1] http://weblogs.java.net/blog/mhadley/archive/2005/05/introducing_wad.html





9/23/2008 6:29:38 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Post Event Resources - MSDN Webcast on REST and WCF#

The MSDN webcast on geekSpeak: REST and Windows Communication Foundation 3.5 went very well; Since REST is a very broad topic and there were tons of questions, I didn’t get a chance to show all the demos however the sample code can be downloaded from here.

Sample Code

Also, keep an eye on geek speak blog for future updates. Overall. there is a lot of concern about security in REST. I’ll be doing a series of blog posts on security in REST in near future however in the mean time, following resources would be provide a good starting point.

Mark O'Neill's Radio Weblog
Message Level Security in REST

Taking Amazon S3 as a model for secure REST services can be one way to implement security in REST. As mentioned in this article by Eric Heuveneers

“Amazon S3 REST resources are secure. This is important not just for your own purposes, but also because customers are billed depending on how their S3 buckets and objects are used. An AWSSecretKey is assigned to each AWS customer, and this key is identified by an AWSAccessKeyID. The key must be kept secret and will be used to digitally sign REST requests. S3 security features are:

  • Authentication: Requests include AWSAccessKeyID
  • Authorization: Access Control List (ACL) could be applied to each resource
  • Integrity: Requests are digitally signed with AWSSecretKey
  • Confidentiality: S3 is available through both HTTP and HTTPS
  • Non repudiation: Requests are time stamped (with integrity, it's a proof of transaction)

The signing algorithm is HMAC/SHA1 (Hashing for Message Authentication with SHA1).’

Reference: Introduction to Amazon S3 with Java and REST

Links to the books and reference articles mentioned in the webcast are as follows. Please feel free  to send me your questions and comments on my email 

Books





9/4/2008 7:00:02 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

MSDN Webcast: geekSpeak: REST and Windows Communication Foundation 3.5 with Adnan Masood (Level 200) #
I'll be doing a webcast on 3rd September on geekspeak. The topic is "REST and Windows Communication Foundation 3.5". Details are as follows.

MSDN Webcast: geekSpeak: REST and Windows Communication Foundation 3.5 with Adnan Masood (Level 200)  

Audience(s):     Developer.  
Duration:     60 Minutes
Start Date:     
Wednesday, September 03, 2008 12:00 PM Pacific Time (US & Canada)
 
Event Overview

The geekSpeak webcast series brings you industry experts in a "talk-radio" format hosted by developer evangelists from Microsoft. These experts share their knowledge and experience about a particular developer technology, and they are ready to answer your questions in real time during the webcast.

This geekSpeak is a very RESTful one. Distributed systems guru Adnan Masood introduces the Representational State Transfer (REST) architectural style and its design principles, and he discusses how they can be implemented using Windows Communication Foundation (WCF) 3.5. Adnan offers guidance and takes questions on when to choose a RESTful design over SOAP-based services and how WCF fits into the spectrum of Microsoft technologies that include ADO.NET Data Services (Astoria) and ASP.NET MVC. Your hosts for this geekSpeak are Lynn Langit and Glen Gordon.

To ask a question in advance of the live webcast, or for post-show resources, be sure to visit the geekSpeak blog.

Guest Presenter: Adnan Masood, Senior Software Engineer, Green Dot Corporation

Adnan Masood works as a senior software engineer and technical lead in a Monrovia-based financial institution where he develops middle-tier architectures, distributed systems, and Web-applications using the Microsoft .NET framework. He holds various professional memberships (ACM, BCS, and ACS) and several technical certifications, including MCSD .NET, MCAD .NET, and SCJP-II. Adnan is attributed and published in print media and on the Web, holds a master's degree in computer science from Nova Southeastern University, and is currently pursuing his doctoral studies in machine learning. Adnan has taught Windows Communication Foundation (WCF) courses at the University of California at San Diego and regularly presents at local code camps. He is actively involved in the .NET community as cofounder and president of the of San Gabriel Valley .NET Developers group. Adnan is a recent recipient of an INETA Community Champion Award for his contributions to the developer community in Southern California.

  Event ID: 1032387085





8/29/2008 4:44:04 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Buidling REST based services using WCF 3.5 - Webcast#

Here is my webcast explaining how to build a simple REST based service using WCF 3.5. Slides and sample code can be downloaded from the links below.


Downloads
REST using WCF 3.5 - Webcast.pptx (137.68 KB)
MyRestService.zip (3.67 KB)





7/21/2008 5:03:48 PM (Pacific Standard Time, UTC-08:00) #    Comments [1]  |  Trackback

 

REST and WCF 3.5 Talk Slides and Code Samples#
On Thursday July 17th, I presented "RESTFul Web Services – UriTemplates and REST support with WCF 3.5". to SoCal.NET architecture group (http://www.socaldotnetarchitecture.org/). It was well recieved and I got good feedback.

The code samples and slides are as follows.


Thanks to all the attendees especially Mike Vincent and David Wells for arranging this talk.




7/20/2008 3:28:53 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

INETA's David Yack on ADO.NET and My REST Talk at SoCal Architecture Group.#

Tomorrow, July 16th, David Yack will be speaking on Exploring the Entity Framework at SGV.NET User Group (www.sgvdotnet.org). It's an INETA sponsored event and for those interested in understanding a core strategic part of Microsoft's data access strategy, please join us. David would walks us through how Entity Framework aims to improve the  mismatch between data storage and data usage by applications.  In his talk he will explore the Entity Data Model and the various techniques for accessing using the client libraries that are part of the Entity Framework.  With V1 of Entity Framework almost ready to go out the door, David will also touch on efforts already underway for V2.

Speaking of Speaking, On Thursday July 17th, I'll be presenting to SoCal.NET architecture group (http://www.socaldotnetarchitecture.org/) on "RESTFul Web Services – UriTemplates and REST support with WCF 3.5". The abstract of the talk as follows.

"REST (Representational state transfer) is an architectural style to build distributed systems in a Uri centric way focusing on resource addressing via HTTP style "command line" interface. REST style of service development improves server scalability, allows systems to be more robust and promotes long-term compatibility and evolvability. Related technologies using the similar design principles are  ASP.NET MVC and  ADO.NET data services (Astoria). Support for REST is introduced in WCF 3.5 with a new WCF binding (webHttpBinding) allowing .NET developers to have the option of build light weight REST style services in contrast with traditional SOAP/RPC style development.

The presentation focuses on REST design principles and how they can be implemented using Windows Communication Foundation (WCF) 3.5. New Features such as support for UriTemplates, Web HTTP binding, syndication support and the new web programming model leveraging a RESTful design of web services within the unified WCF programming model will be addressed for architectural and implementation perspective."









7/15/2008 11:50:02 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Https with BasicHTTPBinding - Note to Self#
So if you are looking to implement SSL using basicHttpBinding for your WCF service, look no further. Here is your config file settings

The modified basicHttpBindinging to allow security mode = Transport

<bindings>
            <basicHttpBinding>
                <binding name="defaultBasicHttpBinding">
                    <security mode="Transport">
                        <transport clientCredentialType="None"/>
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>

which corresponds to your end point.

<system.serviceModel>       
        <services>
            <service behaviorConfiguration="MyServiceBehavior"
            name="MyServiceName">       
                <endpoint address="https://AdnanMasood.com/MyService.svc"
                            binding="basicHttpBinding"
                            bindingConfiguration="defaultBasicHttpBinding"
                            contract="Axis.IServiceContract" />    

and the httpsGetEnabled

<behaviors>
            <serviceBehaviors>               
                <behavior name="MyServiceBehavior">
                    <serviceMetadata httpsGetEnabled="true"/>
                    <serviceDebug includeExceptionDetailInFaults="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>

and last but not least, if hosting in IIS, here is the key for custom factory. Details about how to do this part can be found on the MSDN article "Deploying an Internet Information Services-Hosted WCF Service" referenced below.

    <appSettings>       
        <add key="CustomIISServiceHostEndPoint" value=https://AdnanMasood.com/MyService.svc"/>
    </appSettings>


and you should be all set. Got any questions, email me.

Helpful Links

Inside the Standard Bindings: BasicHttp
http://blogs.msdn.com/drnick/archive/2006/06/01/612672.aspx

WCF-basicHttp receive location
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2154774&SiteID=1

<basicHttpBinding>
http://msdn.microsoft.com/en-us/library/ms731361.aspx

WCF Endpoints
http://www.vistax64.com/indigo/86653-wcf-endpoints.html

Securing your Web Service
http://www.theserverside.net/tt/articles/showarticle.tss?id=SecuringWCFService

Deploying an Internet Information Services-Hosted WCF Service
http://msdn.microsoft.com/en-us/library/aa751792.aspx

Custom Service Host
http://msdn.microsoft.com/en-us/library/aa395224.aspx





7/15/2008 11:23:46 PM (Pacific Standard Time, UTC-08:00) #    Comments [5]  |  Trackback

 

Code Camp Presentation Downloads#

Following  are the links to my talks from the SoCal Rock and Roll Code Camp in UCSD Extension Campus, San Diego.

Using ASP.NET MVC  to build a blogging engine in 60 minutes or less.

MVC is a framework methodology that divides an application's implementation into three component roles: models, views, and controllers. ASP.NET now has built-in support for MVC style development and this session is an introduction to using this technique for building a sample application, a blogging engine.  This session will elaborate on differences between traditional ASP.NET post-back style development versus the routes and REST architecture based thinking around MVC.


ASPECT.NET – Aspect Oriented Programmi
ng in .NET, an Introduction

Aspect Oriented Programming (AOP) deals with factorization in code i.e. separation of common concerns, specifically cross-cutting concerns, as an advance in modularization. AOSD has been a popular trend in development for quite some time in other programming environments and IDE’s however it’s scope and exposure is limited among .NET developers.

This session is focused on getting developers a deeper understanding of what AOP is all about and how to use it in their everyday development. Aspect.NET is a language-agnostic visual environment for developing aspect-oriented applications for Microsoft.NET that was implemented as an add-in to Microsoft Visual Studio.NET 2005. Using Aspect.NET, the user can define and weave aspects and assess the results of the weaving in his or her projects.


 Collaborative Filtering 101 – An Introduction with SQL Server 2008 BI

Collaborative Filtering (CF) is defined as profiling or classification of information based on specific entity relationships i.e. making automatic predictions (filtering) about the interests of a user by collecting likelihood information from many users (collaborating). The underlying assumption of CF approach is that those who agreed in the past tend to agree again in the future. For example, a collaborative filtering or recommendation system for music tastes could make predictions about which music a user should like given a partial list of that user's tastes (likes or dislikes).

In this session, we will discuss collaborative filtering algorithms and applications in the current e-commerce systems. A wide array of topics such as market basket analysis, association trees,  singular value decomposition (SVD), naïve Bayesian classification will be briefly discussed along with the implementation of these algorithms in sites like Netflix, Amazon and digg / (google pagerank). In the second half of the talk, attendees will get to see the step by step implementation of a small scale recommender system using SQL Server 2008 business intelligence studio and C#.





The UCSD Code Camp Speaker's Room; the best place to recruit speakers for your user group.




7/3/2008 12:15:25 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Getting Rid of TempUri in WCF#

Everyone of has seen it; the default namespace TempUri reference in our otherwise neatly published WSDL, looks like an out of place not-so-thought-out part of your otherwise ironclad contract. Hence the question arises, how to get rid of it and put your company’s corresponding namespace in there.

In the asmx services, it was rather easy to do it; just modify your webservice attribute.

[WebService(Namespace = "http://tempuri.org/")]

However, in the new uncharted waters of WCF, things are wee bit more complex than this. Now you’d need to do it in multiple places. The point to remember is that an endpoint has an associated behavior with it.

The web.config file.

 Service Endpoint
<endpoint address=""                                                                                                                                           binding="basicHttpBinding"                                                                                                                                 contract="Acme.Services.WCFNamespaceSample.IService"                                                                                bindingNamespace ="http://acme.com/Acme/Services/WCFNamespaceSample/">

Behavior Endpoint
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" bindingNamespace="http://acme.com/Acme/Services/WCFNamespaceSample/"/>

Also, for the general namespace changes, you need to specify the attribute as follows.

namespace Acme.Services.WCFNamespaceSample
{
                [ServiceBehavior (Namespace = "Acme.Services.WCFNamespaceSample")]
                public class Service : IService

And

namespace Acme.Services.WCFNamespaceSample
{
                [ServiceContract(Namespace = "Acme.Services.WCFNamespaceSample")]
                public interface IService

This should do the magic. Following source code is a good place to start.

WCFNamespaceSample.zip (4.1 KB)






6/13/2008 11:18:28 AM (Pacific Standard Time, UTC-08:00) #    Comments [1]  |  Trackback

 

WCF Articles on Code Project#
I’ve recently completed the following two articles for The Code Project. These are mainly based on my CalState Fullerton SoCal Code Camp talks.

Exploring WCF 3.5 Tools - WcfSvcHost and WcfTestClient
Disucssing use of WCFSvcHost and WcfTestClient for Service hosting and testing.

Publishing RSS and ATOM Feeds using WCF 3.5 Syndication Libraries
This article focuses on using the WCF 3.5 libraries namely System.ServiceModel.Syndication namespace to create and publish an RSS and Atom feed from the same code base.


Enjoy!





2/5/2008 7:54:27 PM (Pacific Standard Time, UTC-08:00) #    Comments [6]  |  Trackback

 

WCF - ASMX Interoperability – Best Practices – Part I#
These are probably few of the most popular questions on the forums and in the WCF sessions.

  • How can I make my WCF WSDL same as Asmx WSDL? It looks different even when I use basic http binding with nothing fancy (security, reliable messaging..no WS* of course).
  • I’m doing interop with Java and my stub generator is unable to understand the WSDL generated by WCF but it works just fine with Asmx WSDL, what am I doing wrong?
  • What binding should I use which works best for interop?
  • Dude, where are my types? 

etc...

In short, the answer is, there is no silver bullet when it comes to interop. There are several case by case things you’d need to consider when trying to make your contracts visible to outside world. Having said that, there are best practices you can follow which I’d cover in this and upcoming blog posts.

The WSDL generated via WCF is different from traditional ASMX WSDL because they have split the schema into multiple segments (WSDL0, WSDL1....). This is the reason why when you look at the WSDL, you'll notice that the types seem to be missing! The stub building tools which come with other servers (Weblogic 6.0 for example) do not yet know this and do not iterate through the links specified in the schema by default, therefore you would not be able to make proxies out of it.

One of the big benefits of using WCF meta-data generation engine is that you can get XSD’s out of it too. Other platforms (read Java) tools understand and prefers XSD's (even though WSDL is the standard, XSD’s are cleaner IMHO). You can now easily generate them via a WCF service like follows.

  • service.svc?xsd=xsd0
  • service.svc ?xsd=xsd1
  • service.svc?xsd=xsd2

Each of these xsd's has separated out contract, type and type definition.

Similarly you'd have WSDL0, WSDL1 and WSDL2 so

  • service.svc?wsdl=wsdl0
  • service.svc?wsdl=wsdl1
  • service.svc?wsdl=wsdl2

Again, the wsdl's are separated to keep the contract, type and type definition (what is a double in interop environment) apart and not in giant one big file, which seems to be much easier but in essence its not.
Improving WCF Interoperability: Flattening your WSDL is an excellent article by Christian Weyer on increasing the interop bar. It explains the reasoning behind why a simple basic http binding service based WCF generated WSDL cannot communicate with its Java counterparts anymore and how to fix this problem.

In the next part I’ll discuss and share some examples and code samples.





10/8/2007 7:22:34 AM (Pacific Standard Time, UTC-08:00) #    Comments [5]  |  Trackback

 

WCF and Document Literal vs. RPC Encoding#

Document Literal vs. RPC Encoding is the big endian-little endian of connected systems. There has been a lot said about the differences (see reference section for details) however this post is about how elegant it looks in WCF. Traditionally we had two ways to represent them;

As a web method

[WebMethod]
public int Add(int p1, int p2)
{
return p1+p2;
}
[WebMethod]
[SoapRpcMethod]
public int Add(int p1, int p2)
{
return p1+p2;
}

Or as a SoapDocumentMethod

SoapDocumentMethod(
"http://www.dotnetsmith.com/DocumentLiteral",
RequestNamespace="http://www.dotnetsmith.com",
ResponseNamespace="http://www.dotnetsmith.com",
Use=SoapBindingUse.Literal)]
public string DocumentLiteral(Address1 address, bool useZipPlus4) {

[SoapDocumentMethod(
"http://www.dotnetsmith.com/DocumentEncoded",
RequestNamespace="http://www.dotnetsmith.com",
ResponseNamespace="http://www.dotnetsmith.com",
Use=SoapBindingUse.Encoded)]
public string DocumentEncoded(Address address, bool useZipPlus4) {

With WCF's seperation of Data and Service Contracts, it has become much more cleaner and clear.

[ServiceContract]
[DataContractFormat(Style=OperationFormatStyle.Document)] //Or Rpc
public interface IOrderEntry {...}

[ServiceContract]
[XmlSerializerFormat(Style=OperationFormatStyle.Document,
Use=OperationFormatUse.Literal)] //Or Encoded
public interface IOrderEntry {...}

and the one way attribute as an operation contract.

public interface IOrderEntry
{
[OperationContract(IsOneWay = true)]
void PlaceOrder(PurchaseOrder order);
}

Remember that RPC/encoded is not WS-I compliant!

Following is difference in the output from the two different


References





7/31/2007 4:39:46 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Why Web Service Software Factory?#

This blog entry is based on a conversation with Michelle Bustamante at the SoCal Code Camp.  She has announced doing a 15 part series of web casts on WCF. All the links are on her blog WCF Webcast Series

Michelle has raised an important concern about web service software factory; Why Web Service software factory? For someone who is skeptical of tools and believes in the raw power of framework and associated IDE, this is a genuine point of unease. Why use a fancy new piece of software which creates some arbitrary code and projects while you can start from scratch in your favorite IDE and do it all by yourself? What is the architectural and development advantage of the prior approach?

Web Service Software factory is an integrated collection of tools, best practices, design patterns, sample source code and guidance. Following are the five key reasons I recommend usage of Web Service Software Factory in the enterprise development.

  1. Service Orientation Comes Standard
  2. Executable Architectural Guidance
  3. Service Targeted Code Analysis
  4. UI Consoles for Housekeeping Chores
  5. Project Template – Avoid the blank page syndrome

 
1. Service Orientation Comes Standard

The templates generated by WSSF are built with SOA tenants in mind. The template comes with separate projects and folders dedicated to project entities such as business logic, resources, data access, service interfaces, data, fault and service contracts, service host and client for self hosting. This enforces the SOA design practices such as type separation, having contracts and interfaces, separate service policy from implementation, keeping boundaries explicit and schema enforcement. As a result, this becomes a better overall design resulting in better compatibility and interoperability when the service is published or modified at a later date.

Figure: Solution interactively creates the business logic and service interfaces.

Figure: The Project Structure after a solution is created.

 

2. Executable Architectural Guidance

In contemporary development, we developers heavily rely on intellisense. We like IDE’s to do little syntax corrections for us and  press F1 to see a new class’s syntax; Wouldn’t it be nice if one can see step by step instructions for basic things like “How to create a Message contract” or for relatively advance things such as “Decorate type as DataContract”. How about if you can “run a recipe” i.e. have a built-in macro which would do all the underlying work for you. Sounds interesting? WSSF provides both the documentation style and executable guidance for Web Service developers. See it for yourself.

 

Figure: The architecutral guidance in the IDE. Click on the picture to enlarge.

3. Service Targeted Code Analysis

I’m sure you use FxCop as part of your daily continuous integration process? No? ok, I didn’t hear that. Seriously, what is the better way to enforce enterprise level coding conventions, security rules et al. Web Services software factory comes with WCF Semantic code analyzer which uses the FxCop engine to perform the semantic rules check and provide necessary recommendations. Using service factory, you can easily create a code analysis rule that will inspect service contract code and check code compliance with WCF service model. See chapter 13 of hands on labs for further details.

 

Figure: Showing the code analysis engine. 


4. UI Consoles for Housekeeping Chores

This is your first WCF service and you want to expose it to the world. What is the first error you get when you run it?

Metadata publishing for this service is currently disabled

Now you have to copy and paste few behavior attribute lines to the web.config. No big deal but how about if you want to tweak with interop and communication? Would it be easy if all these are part of a management console? Service factory team heard you. These and many more attributes are now part of context menus for each and every project. You can right click on the project and see how you can do general maintenance tasks by few mouse clicks.

Figure: Context menu for exposing the service

 Figure: The dialog for exposing the meta-data extension and the service interop.

5. Project Template – Avoid the blank page syndrome

Being an architect you want your development team to follow an enterprise template for service orientation; They are free to innovate but within boundaries so no one starts writing their ADO.NET code inside the web service class file. Makes sense? Now apart from visual studio.NET enterprise templates, you can do it now with service factory templates to enforce the coding standards and provide a good starting point for your developers.

 

Figure: Context menu for exposing the project template.


Figure: Template Export Dialog


Like WCF itself, the service factory also greatly helps developer to stay focused on business logic programming, service versioning, service, data and message contracts, the core concepts instead of doing the repetitive tasks and plumbing work. I’m not sure how many would actually buy into it but for what it’s worth, treating WSSF even as an SOA learning tool would be quite effective.
 

Happy 4th of July; now I’m going out to enjoy some fireworks.





7/7/2007 2:00:07 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

DevConnections Wrap-ups Etcetera#

Courtesy of Paul Mooney
Scott Guthrie gave an 8 AM talk on ASP.Net AJAX at DevConnections, in case you missed it I got it recorded.” Click here to see it.

Dan Wahlin’s sessions were also recorded.
Video: ASP.NET AJAX, XML and Web Services (with a little Virtual Earth)
Video: Minimize Code with TableAdapters and Strongly-Typed DataSets
-Dan Wahlin and Spike Xavier

Some pertaining posts with slides and samples.

Microsoft IronPython for ASP.NET CTP is available; I’ll be trying it out shortly.

And for you “Heavy .Netal” music fans, pleasure for your ears, not.

No More DLL Hell - The Song
Written and Performed By:   Spike Xavier & Dan Wahlin

Couple of good white papers I encountered from MSR & MS.

Can Abstract State Machines Be Useful in Language Theory?
Yuri Gurevich; Margus Veanes; Charles Wallace
Microsoft Research

Windows Workflow Foundation - Performance Whitepaper
Performance Characteristics of Windows Workflow Foundation
Microsoft Corporation.

And last but not least, food of thought for your <substitute your favorite player here>.
Free Academic Podcasts;
145 podcasts for your educational pleasure.





11/12/2006 11:52:45 PM (Pacific Standard Time, UTC-08:00) #    Comments [1]  |  Trackback

 

DevConnections Conference - Day 4#

Post Conference Session - Mastering WCF in a Day

“Plumbing is evil. Developers are inherently disadvantages by plumbing. ”
-Juval Lowy

Juval Löwy is the founder of IDesign and a seasoned software architect specializing in system architecture and large applications design. He is the author of Programming .NET Components and upcoming Programming WCF Services. As a post conference session, I attended Joval Lowy’s “Mastering WCF in a Day”. It was a crash course in all things WCF with the following agenda.

  • Service Orientation
  • WCF Essentials
  • WCF Architecture
  • Data Contracts
  • Instance Management
  • Operations and Calls
  • Transactions

The entire day presentation was essentially what Joval has described in this article “WCF Essentials-A Developer’s Primer” however, his concise examples and simplistic explanation has made a significant difference in understanding windows communication foundation (WCF).

I’ll discuss topics discussed in his session in detail as a separate post; following are the code samples, links and references to further explore WCF.

The IDesign WCF Coding Standards can be downloaded from here.


Books and References


           
Programming WCF Services
by Juval Lowy (On Safari Rough Cuts)

To request the WCF Resource CD, click this link and check the CD Checkbox:

WCF Essentials-A Developer’s Primer

IDesign Downloads

Vista Series: Windows Communication Foundation

WCF Downloads and Samples

Discover Mighty Instance Management Techniques For Developing WCF Apps

What You Need To Know About One-Way Calls, Callbacks, And Events

WCF sample: Chat room client and server for .NET Framework 3.0

Windows Communication Foundation Architecture Overview 

Windows Communication Foundation Part 1.

MSDN TV: Windows Communication Foundation Bindings and Channels

Distributed .NET: Learn The ABCs Of Programming Windows Communication





11/12/2006 2:41:25 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Grid Computing using Microsoft.NET Framework#
Grid Computing using Microsoft

Forbes Magazine in its January 2006 issue ran its cover story titled “A Super Computer for your living room”. This discusses the IBM cell processor powered by eight co-processors with their own memory being used in multimedia.  This helps providing realistic imaging by realtime rendering as it states

“Cell crunches through millions of lines of topographical and photographic data per second to paint topographically accurate, photo-quality pictures at a movie quality 30 frames per second. On a similar program a pentum take two minutes to sketch a single frame.” –Forbes, Jan 2006.

Beside the chip’s power whenever it comes to large scale parallel processing, Linux is usually the first name which comes to mind. Even though Microsoft is trying to catch up, it’s seems already a bit late in the OS/hardware game. However, while assisting a friend’s Masters thesis for “Grid computing with XML web services”, I came across several decent Microsoft application frameworks and services augmenting the grid computing. Grid computing is a form of distributed computing infrastructure “that provides the ability to perform higher throughput computing by taking advantage of many networked computers to model a virtual computer architecture that is able to distribute process execution across a parallel infrastructure.” (wikipedia). Microsoft’s early initiatives on Grid are explained in this Jim Gray’s talk and the future eScience workshops have augmented the blitz. This list of services and frameworks comprises of TerraService.net which is a poster child for both eGovernment and for .NET, SkyServer.sdss.org or SkyQuery.net, windows clustered version, Web services resource framework (WSRF.NET Webcast: Grid Computing Using .NET), and last but not least, Alchemi.

Alchemi is defined as “an open source software framework that allows you to painlessly aggregate the computing power of networked machines into a virtual supercomputer (computational grid) and to develop applications to run on the grid.”

Distributed Fractal Generator is an interesting example and with a little setup, programming for a grid can be as intuitive and simple as following sample taken from Alchemi’s user guide.

  class MultiplierApplication
    {
        static GApplication ga;
        [STAThread]

        static void Main(string[] args)
        {
            Console.WriteLine("[enter] to start grid application ...");
            Console.ReadLine();
            // create grid application
            ga = new GApplication("localhost", 9099);
            // add GridThread module (this executable) as a dependency
            ga.Manifest.Add(new ModuleDependency(typeof(MultiplierThread).Module));
            // create and add 10 threads to the application
            for (int i=0; i<10; i++)
            {
                // create thread
                MultiplierThread thread = new MultiplierThread(i, i+1);
                // set the thread finish callback method
                thread.FinishCallback = new GThreadFinish(ThreadFinished);
                // add thread to application
                ga.Threads.Add(thread);
            }
            // set the application finish callback method
            ga.FinishCallback = new GApplicationFinish(ApplicationFinished);
            // start application
            ga.Start();
            Console.ReadLine();
      }

References & Further Reading





5/14/2006 6:23:38 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Plumbing is Evil - Knowing your service options#

I shouldn't be writing this since Dino Esposito said in his ASP.NET call backs session, “Plumbing is evil“; It was mentioned in in the context that a developer shouldn't have to worry about plumbing but concentrating mainly on the underlying business logic. However there are times when knowing your plumbing options are important. Somehow for several people I know, including myself, in the back of our heads the words web services and HTTP are intermingled like synonyms; Simon Guest's article “Planes, Trains and Automobiles: Choosing Alternate Transports for Web Services” published in Microsoft Architecture Journal 5 is a good read if you want to scratch this out of your head.

Long ago in a Los Angles .NET developers group meeting, Jefferey Hasan also mentioned that WSDL can define TCP as web service end points; this was enough turning an HTTP zealot's world upside down. It's becoming more and more a config change with upcoming Windows Communications Framework (Indigo). But if you think about it, it's all good to fulfill the interop promise; eventually we all want to get along, don't we?





11/17/2005 9:14:01 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Aaron Skonnard's Running ASMX Without IIS#

I remember answering a question about what does ASMX stands for on ASP.NET forums a while back. The rumor is, it stands for active server module and the trailing x is actually a + rotated as it follows the same nomenclature to ASP+ (ASP.NET's former name).

In other news, in the MSDN service station column, Aaron Skonnard discusses Run ASMX without IIS i.e. using HTTP listener class in Whidbey to wrap the functionality of HTTP.sys and offer the functionality of a web service without having IIS installed. Pretty exciting to have apps offering HTTP services without a web server, can't wait!





12/5/2004 6:19:48 PM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

Expert Service-Oriented Architecture in C##

My long awaited Jeffrey Hasan’s Expert Service-Oriented Architecture in C#: Using the Web Services Enhancements 2.0 is finally out. I wrote the following review for this book on Amazon. Expert SOA includes reference to my article on Evolution of Web Services in its appendix which is an honor. Thanks Jeff!

Practical, Developer Oriented and Contemporary!, August 2, 2004

Developing distributed applications has become an increasingly indigenous part of a present-day developer's software life cycle. XML web services provide us an easier and standardized way to facilitate distributed communications. Service orientation takes this to another level, i.e. standardizing loose coupling of these services via contracts. Hasan's book provides answers for today's enterprise needs to learn and formulate their existing distributed communication frameworks as they shift towards Service Oriented Architecture.

This book is about technology we can implement today; it's neither a superficial overview of terminologies nor is it a manager's guide or executive summary. Expert Service-Oriented Architecture in C# is the answered prayer of various developers like me who were looking for a book which comprehensively addresses SOA in Microsoft.NET and couldn't find much help. There are only a handful of books out there on this thriving discipline, Service Oriented Architecture, and most of them fall short in technical implementation details. Most importantly it answered my own skepticism of having another fancy TLA (three lettered acronym) and how can it change the way we program distributed apps today. You'll have to read it to get the answer. Hasan acquired Masters degree from one of the top 10
US
schools and you'll see the academic excellence in his writing. His technical fluency, vocabulary and in-depth explanation are salient features what give this cutting edge technology book priority over its counterparts, if there are any.

Expert Service-Oriented Architecture isn't just a good read about SOA but as title depicts, also a great reference for WSE 2.0. Individual chapters are categorized in a way that each chapter covers a topic of interest; WS-Security, Policy Frameworks, WS-Addressing & Routing, Design Patterns and so on. Therefore it provides excellent reference for WSE 2.0, a fairly new release from Microsoft providing support for latest developments in Web Services arena. Examples in this book are simplified but not trivial, simpler but not marginal and the style shows them coming from a software developer who encounter real world application architecture challenges. Jeffery touched various important topics concisely which a developers encounters either in practice or theory; for instance RPC vs. document literal invocation, web services building blocks, digital signing with x.509 certificate, integrating web services and MSMQ, XML schema definition etc. The last chapter, beyond WSE 2.0, I found very interesting since it addresses Microsoft's new breed of communications infrastructure built around the Web services architecture code name "Indigo". WSE 2.0 is here for a relatively small period of time till indigo kicks in with support for secure, reliable, and transacted messaging along with interoperability. However, future proofing the applications is what Hasan explained in this book and you have to read it to know it like Emerson said "Nature and Books belong to the eyes that see them

 

APress Link

 





8/4/2004 5:31:16 PM (Pacific Standard Time, UTC-08:00) #    Comments [11]  |  Trackback

 

Web Services Enhancements 2.0 - Wait is Over!#

Microsoft announced the release of Web Services Enhancements 2.0 for Microsoft.NET on Monday. Its available for download from Microsoft Web Services Developer Center.

From the MSDN website

"WSE 2.0 simplifies the development and deployment of secure Web services by enabling developers and administrators to more easily apply security policies on Web services running on the .NET Framework. Using WSE, Web services communication can be signed and encrypted using Kerberos tickets, X.509 certificates, username/password credentials, and other custom binary and XML-based security tokens. In addition, an enhanced security model provides a policy-driven foundation for securing Web services across trust domains. WSE also supports the ability to establish a trust-issuing service for retrieval and validation of security tokens, as well as the ability to establish more efficient long-running secure communication via secure conversations."

Links





5/26/2004 9:58:45 PM (Pacific Standard Time, UTC-08:00) #    Comments [15]  |  Trackback

 

Service Oriented Architecture at LA Dot NET User group#

Don Box defined service in a PDC session “as a program you communicate using messages. No more, no less”. He also said that “service doesn't have to be implemented as a 'message' end-point” i.e. a service end point should be decoupled from implementation business logic. How and why? Jeffrey Hasan elaborated this in his last Tuesday’s presentation in UCLA Dodd Hall at LA dot net group. The topic of his presentation was “Building Message based web services for service oriented architecture” which is a fancy name for web services based architectures with further enhancements.

 

W3C defines SOA as “A set of components which can be invoked, and whose interface descriptions can be published and discovered.” however, David Sprott and Lawrence Wilkes of CDBi, a independent software development analysis group beg to differ with this definition. “CBDI defines SOA as a style resulting from the use of particular policies, practices and frameworks that deliver services that conform to certain norms. Examples include certain granularity, independence from the implementation, and standards compliance. What these definitions highlight is that any form of service can be exposed with a Web services interface. However higher order qualities such as reusability and independence from implementation, will only be achieved by employing some science in a design and building process that is explicitly directed at incremental objectives beyond the basic interoperability enabled by use of Web services.”

 

Another good and concise definition on looselycopuled.com states ”A system for linking resources on demand. In an SOA, resources are made available to other participants in the network as independent services that are accessed in a standardized way. This provides for more flexible loose coupling of resources than in traditional systems architectures.”

 


 Jeffrey is author of various articles and books; his book on  Expert Service Oriented Architecture in C#, is due to release soon. His presentation was mainly a premier to SOA with examples to equip audience exploring on their own. He discussed WSE (Web Services enhancements toolkit) and upcoming changes in WSE 2.0 (for instance In-process model – specific optimization for services running on same application domain). He emphasized on importance of indigo’s plumbing in SOA scenario beside what measures are required to implement Pre Indigo SOA. Jeffrey regarded web services based service exposure as excellent because it’s qualified, validating and serves as a distributed component that provides a well-defined interface for processing and delivering XML messages. These are the basic building block of a loosely coupled distributed application.

 

He defined services as

 

  • Services provide a well defined interface that is described by an XML based document called the web services definition lanuage (WSDL) document.
  • Services provide endpoints that consumers and other services can bind to, based on the service’s port address (typically a URL). Services are analogous to traditional object oriented type based components.

 

While explaining Services vs. OO Components, he elaborated the differences as follows.

 

  • Services are described by a WSDL contract not by type libraries
  • Service descriptions can be easily extended
  • Services provide flexible binding
  • WSDL document provides metadata descriptions clients can dynamically bind
  • Services Provide a service guarantee
  • Policy files document service agreement and expectations i.e. error reporting etc could be implemented out of box.

 

Service based messaging addresses reliable messaging for instance XML message preserve the integrity of requests and a record of communication. He defined creation of an XML web service, the foundation of SOA in the following steps.

 

  • Step1: Design Schema
    • Design the messages and the data types
    • Conceptually design what the messages and the data type will look like. Uml class diagrams are the best way to capture this information.
  • Step 2: Build the XSD schema file for the data types
    • Use an XML designer tool to build the XSD schema file for all the datatypes that are exchanged by the web service methods. Visual Studio.NET XML designer is a good tool.
    • XML which correlates with a namespace
  • Step3: Create a class file of interface definitions for the messages and data types.
  • Step4: Implement the stub interface in the web service code-behind file.
  • Step5: Generate a proxy class file for clients based on the WSDL document.

 

Jeffrey supports automated code generation and believes that it gives you qualified schema power. He thinks that having central control on XSD schema provides control on various aspects of application. Publishing the XSD makes it more exposed. On the end point perspective he answered:

 

Why web services should not implement business logic directly in their methods?

Web Services should delegate this processing to dedicated business assemblies. This is because you can’t assume that the business logic will always be accessed through a web service but can be accessed by various other means. Web Services and their associated WSDL documents should not be the original reference points for interface definitions. This information belongs in a dedicated reference assembly and should be stored as an interface definition that can be implemented in different kinds of components.

 

In the revised architecture, he defined the steps of revision and how to embed dedicated assembly:

 

Step 1: Create a dedicated type definition assembly

Step 2: Create a dedicated business assembly (non web interoperability)

Step 3: Create a web service based on the type definition assembly

Step 4: Implement the interface + Import the business assembly

Step 5: Create a tightly coupled client

 

Jeffrey said he’ll upload the presentation on his website or LA dot NET group’s website but I couldn’t find it on both. I’ll post a link here as soon as I get hold of it. Our next month’s speaker is Chris Rolon of Neudesic, an excellent speaker as I know from DevDays; he is a C++ person and speaks on security & development, an intelligent & excellent speaker; can’t wait to hear him!

 

DevDays 2004 participants received a free copy of Test Driven Development in .Net; since I didn’t win any raffles, it was some consolation for me beside this book was already in my Amazon.com wishlist .

 

 References

 

 





5/9/2004 3:20:45 AM (Pacific Standard Time, UTC-08:00) #    Comments [2]  |  Trackback

 

Benjamin on Indigo#

Benjamin Mitchell will be speaking Indigo in the London .NET users group on coming Monday the 24th 2004. He already has started posting appetizers in his blog and as I remember him from his last September's open mike presentation on NUnit, I'm keeping high expectations for this one too.

David Sussman’s last month Café Royale talk on ASP.NET Whidbey was marvelous; Russ Lewis compiled his talk very well and I hope this tradition will continue.

More on Indigo here and I’ll keep posting on meeting progress soon.

 





2/20/2004 7:22:47 AM (Pacific Standard Time, UTC-08:00) #    Comments [0]  |  Trackback

 

All content © 2010, Adnan Masood
About the Author
On this page
Calendar
<February 2010>
SunMonTueWedThuFriSat
31123456
78910111213
14151617181920
21222324252627
28123456
78910111213
Archives
Sitemap
Blogroll OPML
microsoft
Blogroll
Disclaimer

Powered by: newtelligence dasBlog 1.8.5223.2

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts