Thursday, February 21, 2008

I presented a webcast today as part of our ongoing series of precursor webcasts to the Windows Server 2008, Visual Studio 2008 and SQL Server 2008 Launch.  If you have not heard of the launch, you should head right away to www.heroeshappenhere.co.in and register yourself in one of the several hundred cities that we are taking this launch to in India.

I had a good audience and also felt that there was a lot of genuine interest in Smart Client Development.  That is not so much of a surprise given that more and more applications have a hybrid software+services approach to leverage best of both worlds - desktop and web.

My session focused on 4 different buckets of Smart Client Development:

image

Smart Client Applications do not have a single definition.  My view of these applications are that they are primarily desktop applications, that can have a few other "smart" features, such as:

  • Rich presentation providing users with a very good experience
  • Flexible UI that can be modified and keep improving over time (pretty much like web applications do)
  • Local data caching for master data, offline transactional data, etc.
  • Protection of some sort for the local data - both from security and from data corruption
  • Synchronization of data when "online" with conflict resolution, if necessary
  • Seamless deployment features such as auto-updates making it also easy for the software publisher to publish new versions

Most of the above are a breeze with components and frameworks that are available today - and with Visual Studio 2008, development of most of these becomes even more easier.

The webcast showed how you can leverage the following technologies.  I am not going deep into the demos here, because there were many, many steps involved and I am sure it will be tedious for you to read as well as have a high chance of missing something.   I will point you to resources, including the recording of my webcast, to watch these instead.

The technologies I talked about today are:

Windows Presentation Foundation / Windows Forms

WPF is a great way of creating rich applications with vector graphic elements, 2D, 3D, document-oriented applications, etc.  Windows Forms, a technology that has been around longer, continues to be a great technology to build desktop applications that forms-oriented, task-oriented (like a taskbar app, control panel, etc.) and do not require all the richness of WPF. 

A more detailed discussion on which technology to use when is something I posted in this post a while ago. The best part is that the interoperability between these two is fantastic - both provide a "control" that can host the other into one of their "windows" - you can put a WPF control into a Windows Form or vice-versa.  This means even existing Windows Forms Applications can start using some WPF richness for new features that require data visualization of high interactivity.

Microsoft Expression Blend and Visual Studio 2008 combine to provide a rich, seamless designer-developer process for creating these applications.  Blend provides all the designer tools whereas VS 2008 provides all the developer power.

There are also new enhancements to WPF with .NET Framework 3.5 and you can find the entire list here. A video describing the features can also be found here.

Scott Guthrie also blogged about an update to WPF that we are planning to release later this year which will add more flexibility in deployment options and also provide performance boosts.

If you are a beginner on WPF, the community website is www.windowsclient.net and the best place to start is the WPF Video Gallery. 

SQL Server Compact Edition

Another cool piece of technology I discussed today was SQL Server Compact Edition (or SQL Server CE). 

SQL Server CE is the compact edition of the SQL database and was used in a prior version in the Windows Embedded/Mobile world because of the necessity of small footprint there.  That technology has evolved now to provide a common base technology called SQL Server CE that you can still use in that world, but can also use in building PC applications.  In here, you can actually embed a full database within your application and query data using ADO.NET with the same ease as you would if you were using SQL Server Express or higher versions SQL Server itself.

The neat thing about using SQL Server CE is that you do not need to have SQL Server (of any kind) installed on the client system.  So it is a true database engine embed that doesn't need any administrative privileges or huge local services to be running.

You can learn more and download SQL Server Compact Edition 3.5 today from http://www.microsoft.com/sql/compact

A video tutorial of using SQL Server CE with a slightly older version (3.1) is available here and should get you introduced to the basic concepts.

Microsoft Sync Framework

Probably the coolest demo (at least according to the presenter :)) was showing off the Microsoft Sync Framework CTP Refresh 1.

Microsoft Sync Framework is one of those frameworks that you have to use to believe!  It is unbelievably simple for the enormously huge tasks it accomplishes.  It can do any kind of synchronization - between PCs, between PC/mobile/device, between client and local server, between client and Internet server, between databases - anything.  Ask it to sync and it obeys!

With Visual Studio 2008, the integration is unbelievable. I did a whole demo of local client/server sync between a SQL CE database and a SQL Server database running on my system with part data locally cached, part directly accessed - all of it with just ONE LINE of code and in well under 15 minutes.

You might want to give it a spin yourself by downloading it from www.msdn.com/sync - you will need both the Microsoft Sync Framework and Microsoft Sync Services for ADO.NET v2.

Excellent video tutorials (albeit a bit lengthy) are available here, here and here.   I used a large part of the third video for my demo today.  The videos also contain customizations you can make to the Sync APIs that I did not have time to cover today.

ClickOnce

Finally we talked about ClickOnce APIs in .NET Framework for easy publishing and auto-update.  I have uploaded the code I used today along with the presentation (link below).   The simple demo I used today was based on this video that can walk you through the steps all over again.  

 

Presentation and Demos

You can download today's presentation and all code samples I did today (finished samples) from here.  (The presentation is in PPTX format - you might want to download a viewer here if you don't have Office 2007). I do encourage you to go through the video links I mentioned above as well to get more information - I was talking too many technologies in the 1.5 hour session - many more details are available in the videos that are dedicated to these topics.

The entire webcast on-demand recording is available here.  You will need to register to download this, if you haven't already attended the webcast.

 

So there!  My part of the promise to post all the links and the pptx/code is done.  So now there's nothing stopping you from building awesome Smart Client Applications!! 

Happy coding!

posted on Thursday, February 21, 2008 11:45:16 PM (India Standard Time, UTC+05:30)  #    Comments [2] Trackback
 Thursday, July 05, 2007

Here's something fun you can do if you have a digital camera.  Go click pictures from your home city (original pictures) that adhere to 3 themes and submit them to Project Shutter.

Get a chance to win some really cool grand prizes and even get entered to win a T-Shirt every 30 minutes!

Now, that's simple and easy, huh?

 

posted on Thursday, July 05, 2007 11:11:50 PM (India Standard Time, UTC+05:30)  #    Comments [0] Trackback
 Tuesday, May 01, 2007

Finally, it is MIX 07 and I can breathe more freely.  We have known this internally for months, but the announcement was to happen at MIX.

Ray Ozzie started the keynote at MIX 07 with a great introduction, one of the best I've heard, to the Software + Service model.  Scott Gutherie, then came in and did some killer demos!! 

I will never forget ScottGu doing the Visual Studio Orcas remote debugging on a CLR process running within Firefox on a remote Mac system!  Wow!

And of course, the BIG BIG BIG SILVERLIGHT ANNOUNCEMENT!  We now officially have a cross-browser, cross-platform .NET runtime.  A runtime that has the very same CLR engine along with support for media playback, DRM, dynamic languages (IronRuby, IronPython, JScript and VBScript),  LINQ (!!), XML, REST/POX, AJAX and more!  All in 2MB!!!!!!  That is mind-blowing stuff!!!  When I'd first heard it, I thought it was a distant dream - but it is here and you can have the bits for yourself.

www.silverlight.net is the Silverlight community site. Check Soma's blog for the full announcement: http://blogs.msdn.com/somasegar/archive/2007/04/30/mix-07-silverlight-shines-brighter.aspx

Keep watching ScottGu's blog for he is sure to post some great stuff as well.  In fact, the auto-play chess game with .NET playing JavaScript (and winning) was a great demo and I would love to get my hands on that one!

Overall, I am super excited.  If you are a web developer, you should be too!  Because we have just opened up the web to never-before possibilities!

posted on Tuesday, May 01, 2007 1:24:44 AM (India Standard Time, UTC+05:30)  #    Comments [1] Trackback
 Monday, April 23, 2007

We did a series of webcasts last month on several web technologies. We covered some fundamentals of ASP.NET, AJAX, Live SDKs, Gadget Development and Silverlight (then called "WPF/E").

We are going to come back with more webcasts next month.  We are currently thinking:

1. ASP.NET AJAX - more detailed sessions

2. Silverlight - more details, integration with AJAX/ASP.NET

What else would you like to hear?  I am not promising we'll be able to do everything you want - but if you attend our webcasts regularily, which other Microsoft web technologies would you like to hear about?

Leave a comment or drop an email (assuming you know my ID if you have attended any session I've done before - not posting it here to avoid spam). 

posted on Monday, April 23, 2007 11:52:07 PM (India Standard Time, UTC+05:30)  #    Comments [1] Trackback
 Thursday, April 19, 2007

I was traveling and hence could not break the news simultaneously with Soma's post, but we'd heard a little while ago about the new name for what was called "WPF/e" - Microsoft Silverlight.

I simply love the name and by reading feedback across blogs, it looks like people are almost surprised that Microsoft could find a "cool name" such as Silverlight.

The Silverlight announcement happened at the National Association of Broadcasters (NAB) on the 15th of April. Read Soma's post on the same.

Of course, as Soma himself has mentioned, this is just half-the story. Tune into MIX 07 for a full and broader vision of Silverlight.

Find all the resources at www.microsoft.com/silverlight

posted on Thursday, April 19, 2007 9:56:17 PM (India Standard Time, UTC+05:30)  #    Comments [0] Trackback
 Sunday, April 15, 2007

The Ultimate in Online Training Environment is here!
With Developer Virtual Classrooms, you'll enjoy the benefits of LIVE human interaction from the comforts of your desktop for FREE.

Develop New Age Applications with WPF

This Classroom will discuss all the pillars of WPF (Windows Presentation Foundation), and enable you to experience the joy of developing new age Win Applications with much ease and performance. The instructors also walk you through some WPF applications.

Score more than 80% during the online evaluation and earn yourself a certificate of participation from Microsoft.

Register Now for FREE!

Registrations Close at 1800hrs on Thursday 19th April. Limited Seats Available

Chapter Details

Date

 Introduction to WPF

Apr 23, 2007
1700–1830hrs

 Introduction to WPF Controls

Apr 24, 2007
1700–1830hrs

 Data Binding in WPF

Apr 25, 2007
1700–1830hrs

 Resources and Styling with WPF

Apr 26, 2007
1700–1830hrs

 Deployment of WPF applications

Apr 27, 2007
1700–1830hrs

Register Now for FREE!

Registrations Close at 1800hrs on Thursday 19th April. Limited Seats Available

Speakers: Tarun Anand & Brij Raj Singh

posted on Sunday, April 15, 2007 8:07:08 AM (India Standard Time, UTC+05:30)  #    Comments [0] Trackback
 Tuesday, April 03, 2007

Google made two announcements: The GMail Paper and the Google TiSP

Now for those who still haven't realized, both of these are Google gags that they typically play on April 1st.  Go to http://www.google.com/tisp/notfound.html to see links to other gags they've played in the past as well.

The GMail Paper thingy was funny.  I had actually worked on a similar service provided by Alacrity Homes when they were new to the Internet.  We had built up their site way back in 1999 and a traditional construction company in Kerala going on the Internet was a very new thing back then.  Some smart people at Alacrity realized the value of using the Internet as a medium for NRIs to be able to view properties (in full 3D) and then choose to book them online.  Now to popularize their new website (which by the way no longer exists), they also provided a free service that allowed people to submit a mail form, which Alacrity would print on a postcard and send to whosoever you wanted to.  The connection of email to snail mail.

The service was a real innovative idea.  Interestingly enough, the Indian Postal Department is still offering a similar service: http://www.indiapost.gov.in/IndiaPost-E-Post.html

So when GMail Paper did sound absurd, the foundation of the idea does exist.  Only, I don't personally believe there will be huge value in the same, thanks to Internet penetration reaching almost every nook and corner.  Also, with telephone being far more cheaper a medium than it was once, I don't think snail mail forms the primary means of communication in most places.  There might still be the odd official form that required your signature to be sent - and that would not quite anyway work through the e-medium.

In other April Fools gags, there was the Microsoft Penguin Adoption Story (which by the way was not originated by Microsoft) and people speculating if the big announcement by Apple and EMI to provide DRM-free music on the iTunes was also an April Fools story.

Lessons to corporates: Don't make your killer (real) announcements on April 1st.

Lessons to us:  Don't believe any announcements that do get made.  

I wonder if some day a prank like this will cost somebody tons of money in a false stock market boom and eventually get the company sued. Hmm...

posted on Tuesday, April 03, 2007 2:52:08 AM (India Standard Time, UTC+05:30)  #    Comments [0] Trackback
 Wednesday, March 28, 2007

I just enrolled to do a presentation at Barcamp 3 in Bangalore.

Barcamp Logo

I will be talking about building Rich Internet Applications using WPF and WPF/E.  See you there!

posted on Wednesday, March 28, 2007 7:31:09 PM (India Standard Time, UTC+05:30)  #    Comments [0] Trackback

Microsoft Research PlayAnywhere is one of the most fascinating things that's been around for a while now.  I couldn't resist putting this here for the benefit of those who might have not seen it yet.  


Video: Playanywhere and Bluetooth Photosynch - MS Research

posted on Wednesday, March 28, 2007 12:32:28 AM (India Standard Time, UTC+05:30)  #    Comments [1] Trackback
 Tuesday, March 20, 2007


Video: Longhorn - Windows Server Virtualization

This video highlights two important features - Server Core and Windows Server Virtualization

The demo shows:

  • Windows Server Virtualization running on a Server Core installation mangaed remotely from another Windows Server "Longhorn" box
  • 64-bit and 32-bit VMs running concurrently
  • SUSE Linux 10 running in a virtual machine
  • An 8-core virtual machine
  • System Center Virtual Machine Manager
    • Interface and Operations
  • System Center Operations Manager
    • Monitoring the VMs on the Server Core box
    • Fire off a PowerShell (aka Monad) script to hot-add another NIC to a SQL VHD image

Just pure power!

posted on Tuesday, March 20, 2007 7:52:40 PM (India Standard Time, UTC+05:30)  #    Comments [0] Trackback
 Wednesday, February 21, 2007

I cranked up my first WCF Service and it was a great learning experience.  As part of an upcoming Vista and Office developer tour across 5 cities in India, I was preparing for delivering Session III on connected applications.

Now, I have written simple WCF code in the past, mostly when the initial bits were available and a lot has changed since then.  To add to it, Vista with IIS 7.0 requires some additional steps to create and host WCF services.

Since it took me some searching on the web and some amount of research to figure out some of the nuances, I thought jotting them down would help somebody else save some time.

Before coding your WCF service

To start with, you need to have .NET Framework 3.0 installed.  With Vista, this is pre-installed, so you can ignore this if you are running Vista.  However, IIS 7.0 is not enabled in Vista by default and you have to do that through the Add/Remove Programs > Turn Windows features on or off in Control Panel.

While you are there, you might also want to turn on features to enable HTTP Activation to be hosted in IIS.  You can find this under Microsoft .NET Framework 3.0  as two options - Windows Communication Foundation HTTP Activation and Windows Communication Foundation Non-HTTP Activation.  Enabling these installs required modules that allow for processing of WCF components in the HTTP pipeline in IIS.

The above is also the fix if you are stuck with an error message that says: HTTP 500   --- Handler svc-Integrated has a bad module "ManagedPipelineHandler" in its module list

The reason this is not installed by default is that most clients would not require to actually host a WCF service.  So it makes sense to only enable it on systems that are used by, say, developers, who might create services, host them in IIS and consume them all on the same system.

You also need to install other handlers that will enable IIS and other hosts in the system to understand the WCF service model. To register these, use the ServiceModelReg.exe utility with the –i option. This utility is found in the %WINDIR%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation path. (If you can't find such a directory structure, you probably haven't installed .NET Framework 3.0). You are also better off running this in a command prompt that is running with Administrative privileges (right-click and Run As Administrator – something you must be familiar with already if you are using Vista).

If you are using Visual Studio to create your WCF applications, you also need the WCF "Orcas" bits, the current version of which is the Nov 2006 CTP.  I recommend you search for the latest bits depending on when you are reading this and install those.

Understanding the Basics

Most communication scenarios have a Server and a Client component.  In WCF, everything revolves around three things - Contract, Bindings and EndPoints.

Contract defines the actual contract between the client and the server, which means that it defines what the client can request for and what the response would look like.  In simple words, the contract is synonymous to the method signature and the methods exposed by the service.

Bindings specify how the communication will actually occur between the client and the service.  The client and the service should communicate in a manner that both are capable of understanding - for example, if the service provides information over HTTP, the client should be aware of that and make the appropriate kind of request.  Bindings basically specify that information for both the client and the server.  Well, that's actually putting it in simple words - in reality, the bindings also enable services and clients to specify various transport protocols, security standards and a host of other things to be specified in great detail.

EndPoints provide the information of the actual address where the service is located and how to reach the same.   An end-point is the actual link that has information about what binding to use and what contract is being referred to.  Thereby, the end-points actually become the service address that anybody who wants to consume the service would refer to.

Creating your WCF Service

Now to some actual code.  Creating the actual WCF service is very easy.

Step 1 : Define the Contract

To begin with, a contract has to be defined.  The contract is defined as an Interface and the class that actually provides the implementation of the contract implements the interface.

So, for a simple Math Service that takes two numbers and adds them up, the contract would look like:

using System;

using System.Collections.Generic;

using System.Text;

using System.ServiceModel;

 

namespace MathService

{

[ServiceContract]

public interface IAdditionService

{

[OperationContract]

Int32 Add(int number1, int number2);

}

}

 

Note that a reference to System.ServiceModel assembly in .NET 3.0 will be required before you write the above code in Visual Studio.

The ServiceContract attribute says tells the .NET Framework that this interface is actually defining a WCF Contract. The OperationContract attribute is applied to method signatures that will be actually exposed as operations of the contract. Basically this means that the client can now access the Namespace.ServiceContract class through a proxy and call the OperationContract methods on it.

If you find this very strange, just think of OperationContract as synonymous to marking methods with the [WebService] attribute when creating web services. This is a similar structure to allow the underlying framework to generate all the plumbing code that will be required to create the actual services.

Step 2 : Service Implementation

Now that the contract is defined, the actual implementation for the service is done by a class that implements the above interface. In our case, that would look like:

using System;

using System.Collections.Generic;

using System.Text;

using System.ServiceModel;

 

namespace MathService

{

public class AdditionService : IAdditionService

{

public int Add(int number1, int number2)

     {

        return (number1 + number2);

     }

 

}

}

 

Of course, I am not doing anything great in terms of the actual implementation, because I want to focus on the structure of the various components rather than implementation logic.

Step 3 : Host the Service

The contract for your WCF service is actually ready. But for clients to be able to get to it, you will have to host the service. There are a wide variety of options to host your service in Windows Communication Foundation. The simplest one is to host it within a console application that is kept continuously running. Leveraging the same System.ServiceModel namespace, you can use the ServiceHost class to host your service. A simple console application that hosts the service is shown below:

using System;

using System.Collections.Generic;

using System.Text;

using System.ServiceModel;

using MathService;

 

namespace MathServiceHost

{

class Program

{

static void Main(string[] args)

{

using(ServiceHost host = new ServiceHost(typeof(AdditionService),

new Uri("http://localhost:9999/MathService/AdditionService")))

{

host.Open();

 

Console.WriteLine("Math Service\n");

Console.WriteLine("Addition Service Started...\n");

 

Console.ReadKey();

}

}

}

}

The using attribute helps to scope the ServiceHost instance that is created, so that it is automatically disposed when the program ends. The ServiceHost constructor takes two arguments – the type of the class to host and the URI at which it will be available. The URI can be any valid URI. If you are running Vista or Windows XP SP 2, and try accessing the service from another computer (or in certain cases the same computer), you might not be able to access a port such as 9999, because Windows Firewall blocks most non-standard ports. To get around this, you need to configure Windows Firewall to allow your application to communicate on the ports you want. Details of this can be found at http://msdn2.microsoft.com/en-us/library/ms751530.aspx. Note that this is not required in most cases.

Hosting the service involves another step. The service endpoint has to be configured. Remember, WCF clients can only discover the service if the endpoints are specified. To specify an endpoint, create an app.config file for the console application. In the app.config file, use the following code:

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

<configuration>

<system.serviceModel>

<services>

<service name="MathService.AdditionService" behaviorConfiguration="MathServiceTypeBehaviors">

<endpoint

address="http://localhost:9999/MathService/AdditionService"

binding="basicHttpBinding"

contract="MathService.IAdditionService" />

<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />

service>

services>

<behaviors>

<serviceBehaviors>

<behavior name="MathServiceTypeBehaviors" >

<serviceMetadata httpGetEnabled="true" />

behavior>

serviceBehaviors>

behaviors>

system.serviceModel>

configuration>

[Why some pieces of code are marked in bold will be obvious soon]

A tip here is that if you were creating the above file in Visual Studio 2005 and were using an earlier WCF sample, you will not get intellisense. The configuration tag requires no xmlns namespace, which if you provide, you will not get any intellisense in VS. The quirk is documented here.

The system.serviceModel is a special configuration section that is defined in System.ServiceModel and provides options to configure a lot of the settings with regard to Bindings and Endpoints.

In the example above, a service is defined with the name and a behavior configuration. I will get to the behavior configuration in a minute. The endpoint is defined next with the address, binding and contract. In this case, it specifies the address at which the service will be available, that the binding will be a simple HTTP binding (which means clients make a simple HTTP call to access the service) and the reference to the contract that we defined earlier (to know what is being exposed by the service). You can almost imagine the framework traversing through this one line and discovering where the service is located, what it offers and how to communicate with it – and generating all the necessary code for it to actually happen.

The other endpoint brings us back to the behaviors part. When you access the service through the browser (and you can do this without specifying the pieces of code that I marked in bold), the contract is not automatically shown to the client. This is a piece of security in place to ensure that anybody and everybody doesn't get to see the details of the contract by just browsing to the service. To enable "viewing" the contract details when just visiting the service URL through a browser, it is required to specify a service behavior that allows HTTP GET requests and an endpoint that allows metadata exchange. This special (built-in) endpoint will be used to query the metadata and return the queried information.

So, we're now ready to host the service and just building the application and running the console application should get you hosting the service. You can verify it by visiting the service URL (in our case http://localhost:9999/MathService/AdditionService) through a browser. You should see a page that shows you the service contract and gives you instructions on building a client to consume the service. (You will see a different page if you did not enable the metadata exchange endpoint).

If you received an AddressAccessDeniedException with a message such as - HTTP could not register URL http://+:9999/MathService/AdditionService/. Your process does not have access rights to this namespace, then you probably did a lazy F5 through Visual Studio 2005. I haven't found a workaround for this – and I am already running VS 2005 as administrator – however, I did figure out that it is a Vista security feature not allowing an application to register a URL (kind of create a local HTTP address available on the fly). I opened a command prompt in elevated mode and ran the application directly from the command-line and it worked like a song. So that's probably something you can try as well.

Consuming your WCF Service

Hurray – the server is created. Now we have to consume the client and if you are still with this blog at this point, you'll probably see that creating it in Visual Studio is very, very simple. Just create a console application, right click on References and click on "Add Service Reference". Provide the service URL and a name for your client proxy class and everything is created for you in a jiffy.

Of course, you can do it the harder way (and sometimes it is necessary to do it that way) by using svcutil.exe – just like in earlier versions of the .NET Framework. Type svcutil.exe and the URL of the service to generate the code for the proxy classes which you can then include/reference in your client code.

The last thing is to call this typed proxy that was generated for you. The code to do that is rather simple:

using System;

using System.Collections.Generic;

using System.Text;

 

using MathClient.MathServices;

 

namespace MathClient

{

class Program

{

static void Main(string[] args)

{

Console.WriteLine("Press any key when service is ready...");

Console.ReadKey();

 

try

{

AdditionService proxy = new AdditionService();

int result = proxy.Add(1, 2);

 

Console.WriteLine(String.Format("Result: {0}", result));

}

catch(Exception ex)

{

Console.WriteLine(ex.Message);

}

finally

{

proxy.Close();

}

 

Console.WriteLine("Press any key to exit");

Console.ReadKey();

}

}

}

 

A using statement to resolve the proxy class (in this case MathClient.MathServices – MathClient was the namespace of my client console application and MathServices was the name I gave in Visual Studio to the proxy generation wizard) at the top and instantiating the service proxy (which is named the same as your service class by default).

Pretty straightforward. The try/catch clauses actually help on Vista to just show the error message rather than having to see a dialog that tries capturing error information and send it to Microsoft assuming that an application crash happened. This is the behavior by default for all unhandled exceptions. Also, it is useful to just run the application from a console window to actually get to see the exception details if any – otherwise the window just closes too fast.

Remember also that your service should be running before you run the client, otherwise you will get an error that says that The target machine actively refused the connection for obvious reasons.

Further Steps

I started out writing this article to also cover IIS hosting of the service where there are some more quirks when working with the secure environment of Windows Vista and IIS 7.0. But I think I will do a part 2 on that just to keep this article readable. So in part 2, we'll take the same service and do an IIS hosting of the same service.

Reference

An excellent reference of several starter quirks and solutions for the same is the One-time setup procedure for the Windows Communication Foundation available at: http://msdn2.microsoft.com/en-us/library/ms751527.aspx

 

Hope this article helped! Do leave comments if you face any other issues or think anything else needs to be added.

posted on Wednesday, February 21, 2007 9:53:17 PM (India Standard Time, UTC+05:30)  #    Comments [4] Trackback
 Tuesday, February 20, 2007

I have a new toy.  Actually have it for a couple of weeks now.  I have a HP iPAQ hw6960 Pocket PC running Windows Mobile 5.0.

Now this is my first with a smartphone and I have been loving it.  After enabling unlimited GPRS through Hutch, I have been using the phone so much that I am having to charge the phone up every single day.  (And yes, the battery actually lasts much longer for normal usage).

I am sure this is the phase of initial excitement and I will get back to saner usage.  But at the moment, I really wonder how I lived without all of this all these days.

Email at my fingertips, so much so, that I spent a day when I was traveling responding to all my email through phone.  Other than my corporate email, I also manage Hotmail through the phone now.  GMail seems to have some problems - even after configuring POP3, the email doesn't get automatically pushed to my phone, I have to manually sync it up.

The plethora of Windows Mobile applications that we have access to our Intranet has me all charged up. I can use my phone as a wireless presenter to present a PPT on my laptop - when being able to advance slides through the mobile and also view speaker notes on the mobile. That's simply awesome.

Today, I just got to Jani's blog on recent trends on the TV and Music and learnt about Mundu Radio - which I think is a really cool application.  If you know of any other killer apps, do leave me a comment.

I have also been browsing a lot with Pocket IE.  I was amazed at how most sites render just fine on Pocket IE, including all the ThinkingMS blogs.  However, interfaces designed specifically for the mobile require less scrolling and make it much easier.  Windows Live has a whole suite of mobile interfaces for the various services at http://mobile.live.com

I was just emphasizing the need of having a mobile-version of websites to a customer recently. The day isn't far when computing will move more to devices than the PC.  

Microsoft just announced Windows Mobile 6.0 and I can't wait till our IT department announces a supported build that I can upgrade my phone to.  The interface is slicker and a lot of nags I have with getting used to the new form factor are made simpler and more intuitive in WM 6.0.

posted on Tuesday, February 20, 2007 9:53:22 PM (India Standard Time, UTC+05:30)  #    Comments [0] Trackback
 Monday, February 19, 2007

Windows Presentation Foundation (formerly codenamed "Avalon") is the real highlight of .NET Framework 3.0.  Everybody wants to build those cool, slick UIs and leverage some of the wonders of the powerful Vista presentation framework.

Also, every developer who has that creative spark in him/her, wants to learn the nuances of using a designer tool such as Expression Blend and create UIs that wow their peers and friends.

Now, when it sounds like a lot of fun - know also that WPF is not a toy and is a really powerful API with full support for 2D and 3D vector graphics.  Just like any other programming framework, it requires an investment of time and effort to learn the framework and master it.

One really cool way of doing this would be to keep a tab on www.revoluxions.com - an initiative by Dax Pandhi and Andrew Eick. These two whizkids are doing a (hopefully very long) series of short WPF video tutorials, that quickly get you onto a concept or two.  Then they give you enough time to hone your skills with the newly learnt concept before you dive into the next one. Also, since they are short 15-min videos, they are easy to download, not too time-consuming to watch and even easier to digest.

Way to go guys!  And keep the good work coming.

posted on Monday, February 19, 2007 2:48:15 PM (India Standard Time, UTC+05:30)  #    Comments [1] Trackback
 Friday, February 16, 2007

Just been a whole lot of time since I posted here.  Mostly been busy.  Had been to a vacation to Dubai and then attending the rocking Windows Vista launch at Mumbai and then at Seattle for an internal Microsoft conference.

Seattle was fun.  Got to go the Redmond campus.  The holy grail.  The pilgrimage.  Clicked a lot of pictures here and there. 

Bought a copy of Flight Simulator X Deluxe Edition.  Have been long wanting to play Flight Simulator.  Aircrafts simply thrill me and the closest to get it to flying is using Microsoft Flight Simulator.  So far, tried flying a plane, managed to take off and then spin around and crash.  Flying with keyboard or mouse is real hard.  I wish it was easier - but it is fun to learn it.  After all, flying in real must be hard too.

Seattle struck me as a different city compared to other places in the US that I have been.  For one, the atmosphere had some class to it.  Seattle Downtown looked very classy and beautiful.  There were a couple of streets that didn't look as good, but the central part of it has these tall-rise buildings that look really nice when lit up.   Mt. Rainer is a nice, huge, fat mountain with a snow cap a couple of hours away from Seattle.  The mountain looks great when taking off from the Seattle Tacoma airport.

The visit to campus was shortlived and I hope to get to see more of it in the coming years.  Will surely need many more trips to go see the entire campus.

Dubai pictures available at http://pandurangvn.spaces.live.com

posted on Friday, February 16, 2007 9:35:50 PM (India Standard Time, UTC+05:30)  #    Comments [1] Trackback
 Tuesday, January 09, 2007

Microsoft started off CES with a Bill Gates pre-keynote address.  BillG started saying that this is probably the last time he gets to go on the CES stage and talk about technology!  :(  I don't buy that completely though :)

However, the address was very exciting with some of the stuff that was never demo'ed before.

There was Windows DreamScene - something quite amazing spectacular and something that was a hush-hush thing at Microsoft for a while now.  Of course, it is another UI glitz, with playing videos now being able to be set as the desktop background.  I got to install a small internal BETA today and it works great.  Sure looks exciting and I think the Vista Ultimate Edition users will love the feature (that'll ship as a Vista Ultimate Extra).

If you haven't seen DreamScene, you should watch the CES keynote.

One of the biggest announcements yesterday was Windows Home Server.  Windows Home Server is the vision of having a server in every home that takes care of backend infrastructure for the digital home.  In many ways, a "home server" makes perfect sense to orchestrate all the digital devices that make up today's homes.  Hook up your Media Center PC, your laptop, your personal computer, your XBox, your Windows Mobile phone and everything to the backend server and let it manage backups, synchronization, and a lot more for you.  That's the message.  However, to learn more, you can also check out the Center for Digital Amnesia Awareness Web Site. :)

In the meanwhile, Bill Gates has also written this must-read article titled "A Robot In Every Home".  When you read the paper, you realize the real parallel universe between the "origin of the PC" days and today's world.  I played around with Microsoft Robotics Studio v1.0 yesterday and created my first robot in a simulated environment that I could control with a small controller-like Window (called the Direction Dialog).  That was pure thrill!

Exciting times ahead, and with this company - that's a statement that'll always be true!

posted on Tuesday, January 09, 2007 10:33:37 PM (India Standard Time, UTC+05:30)  #    Comments [0] Trackback
 Friday, January 05, 2007

Security on the web has taken a new dimension with AJAX-driven websites.  AJAX-driven websites are more susceptible to cross-site scripting (XSS) attacks and offer easier means of call and logic discovery.

I had covered these in sessions titled "Building Secure Next Generation Web Applicaitons" during the recent Security Yatra and also during some MSDN Days organized in a few SIs in India. 

Some of the really startling attacks I discovered while preparing the content for the demo included the MySpace worm.  The complete details are available at http://namb.la/popular/

Not only did the worm bypass all of Myspace.com's rules, but surprised the author of the malicious code himself by affecting a million users in under 20 hours!

I just also received an email that talks about a very interesting vulnerability in PDF and Adobe Reader that makes it possible to perform serious XSS attacks.  That was quite startling because the avenues are increased not just to AJAX-sites but common technology such as Adobe PDF and OpenOffice.  The article is available at http://www.eweek.com/article2/0,1895,2079201,00.asp?kc=EWEWEMNL010107EP26A

The actual attack instructions are also available here.  But let me warn you not to try this with any site.  Don't mess around - it is a dangerous world out there.

And for all your developers there, if that didn't shake you and say "Take security seriously", I don't know what will.

posted on Friday, January 05, 2007 10:57:51 PM (India Standard Time, UTC+05:30)  #    Comments [0] Trackback
 Saturday, July 01, 2006

This entry is out of considerable deliberation and after discussions with some brilliant friends who share the thoughts. The reason was because though I have the freedom (Thank God!) to write what I feel like, I am actually talking about decisions other people have made. And I respect those people, so it doesn't feel good to write this. Nevertheless, I have been having this thought and it was only adept that I put it into words.

So what is this about? I am primarily talking about business on the Internet.  Many of us have been unfortunate enough to witness the big dot-com burst at the dawn of this millenium. All of us realize why that happened. If you don't, here it is in simple words - too much money was poured into online businesses which did not have a strong enough revenue model to get profits.  A kid would understand that if you put your money into something, you should know how that would generate profit for you.  Take that and multiply it a zillion times. When too many people put in money into too many things and don't care or know about how that investment will generate profits, then too much money is in the wrong place. That causes deficits in other places, hence creating a false boom of prices, salaries and everything else. When that might seem like a boost for a while, it eventually collapses because after time there is no return and all the rich people who invested in the first place stop doing that. And the people who are yet to generate profits out of the businesses they ventured into suddenly have a reduced cash flow, increased costs and no profits. Crash!  There is very little to say after that point.

When everybody who was in business then learnt their lessons, not everybody was fortunate enough to survive the bust.  Today is a different world. Forced by the cost cutting exercises that many global companies went through during that phase, work moved to countries where "labor" was cheaper. That has resulted in the offshoring and outsourcing model that we see today - which has become so successful that it is not just for IT, but has gone further into business process outsourcing as well.

Looking back at the lessons we learnt during the bad phase, companies and organizations have to take strong decisions that have a solid revenue model backing them. It is this that brings me to the crux of this discussion - which is the path that Zoho is embarking on.  Zoho, a product of AdventNet, Inc., is launching a series of amazing Web 2.0 products that deliver a complete office suite on the Internet, with nothing more than a browser required.  Everybody I know has been awed by the amazing work done, specially on Zoho Sheet and were even surprised when I said that it was created out of a company based out of Chennai, India.  Zoho has a Word-equivalent called Zoho Writer, a PowerPoint-equivalent called Zoho Show and many other productivity tools. And Google, which recently announced Google SpreadSheet, just has an online spreadsheet program. There were friends of mine who wondered, "Why didn't Google just think of acquiring Zoho?" 

AdventNet, for people who haven't heard of them, is a remarkable organization based in Chennai. They have some of the most brilliant minds in the industry and some of the most innovative products.  They also have built amazing prototypes such as SQLOne - a product that I think can lead its way to context-sensitive search engines, if they get it right.  Just looking at www.adventnet.com awes you with the breadth of products and technical excellence and solidity of these products.  AdventNet also has had a reputation for strong senior management and for creating startups into magic companies. Also, evidently they still love startups and are an extremely confident lot in believing in what they do.  An example is Applibase or Jambav, the former founded by an previous founder of AdventNet, and the latter an amazing organization backed by AdventNet that can give you the real job satisfaction - combining the worlds of technology and social responsibility.

Given all the background, I must sound like an idiot to say Zoho is probably a huge step in the wrong direction. But I still have my convictions that somehow, AdventNet is not getting it right this time around. Zoho is no doubt out of this world, even in its current humble BETA form.  Also, you can realize by just visiting the site that AdventNet has not put up Zoho just for fun, but is serious about making money through the product.  Google might very well put their product out for free, license it to enterprises and keep it free for the general public, banking on ad revenue.  Zoho, on the other hand also looks like licensing a Professional Edition for serious users and keeping it free for the the general public.

Let us take a step back and take a look at the complexity involved in building something as comprehensive as Zoho.  They released well before Google SpreadSheets and are announcing a new product every other week.  Google is still limited-user and hence has users waiting to see what is in store.  Zoho, on the other hand, is even willing to "publish" charts for you as images hosted off their servers.  Now to have achieved all this, Zoho must have put in a huge investment to get to where they are.  Let us assume, looking at the size of the project, and having mentioned in a previous post that JavaScript skills are not easy to get, they must have had a team of senior developers working for at least a good year.  Taking a shot at an average salary of a developer (assuming a mix of senior developers, managers and juniors) at Chennai, I am assuming a figure of INR 4.5 lakhs, which is close to USD 10,000. (Oh yeah! why do you think outsourcing works?). Assuming a team size of 40 (considering the number of products) - that would work out to $400,000. Add to that an investment in servers, development software, testing tools, operating costs, etc. which might have run into something like $1,000,000 (Assuming salaries are a 30% of operating costs).

That means the whole investment in building Zoho in its current state might be around $1.4M. If you took a look at Zoho, they have miles to cross before it can be any serious competition to the likes of Microsoft Office, or even Open Office.  The reasons:

a. Bandwidth - a luxury only in countries like the USA where the "Updating" that occurs after every entry in a cell in Zoho Sheet will not matter. Organizations in India are heavily trying to conserve bandwidth given the large number of employees and hence might not really be keen towards having their major productivity tools web-based. 

b. Productivity - Which brings me to my second point.  The product's target segment is users who want to use a productivity tool such as Microsoft Office.  Notice the key word - productivity. How can productivity increase with tons of JavaScript running in a memory constrained browser window, making server roundtrips at beck and call as opposed to rich client applications utilizing system resources, hyper-threading, core duo, high power graphics cards, tons of RAM, virtually unlimited disk space, high-speed IO devices, etc?  The answer is in the question - productivity takes a hit! 

c. Connectivity - Zoho claims that it makes "global availability a reality". They should probably talk to their sales force and ask them if they would go for a customer presentation without an office product installed on their laptops and rely on Zoho Show and Zoho Virtual Drive to load up the presentation.  The Internet is not always available, well, yeah Wi-Fi, WiMax, blah blah, but no, not yet.  How could I make that last change in the costing slide when I am sitting, waiting for my presentation, just before the client walks in - and specially when I am in the customer's office!

d. Enterprise Needs - Question again. Would the AdventNet sales team use Zoho Show? (Would they?  Really?)  Or would their finance team create all of their balance sheets and tax calculations for they year on Zoho Sheet.  (Really, again?)  Or would they expect their technology teams to create 3000-page product and technical documentation on Zoho Writer?  If they ever did, I bet it is a good year away looking at the current BETAs and even then, it would be unbelievable if they did not have a single license or installation of a different office suite.

e. Reliability - How many enterprises would be willing to depend on a service provider to store data pertaining to the organization?   Even if Zoho planned a "deployment" model where they host their product in the customer network, several organizations will be bound by compliance and security restrictions that prevent using such an alternative.  Specifically, Zoho Virtual Drive makes no sense for organizations that have the least concern of protecting data and information.  And it is not just the organization - customers of the organization run audits to ensure their data is stored safely.

The only benefit, and I think AdventNet sees it as the prime advantage, is the pricing that works out far cheaper than Microsoft Office Standard Edition - almost 16 times cheaper if I consider the 500-user licensing mentioned at https://store.adventnet.com/jsp/fp.jsp?filter=10010&p1=10118 vs. the Microsoft Volume Licensing Advisor (http://www.microsoft.com/licensing/mpla/) which gave me a quote of $183,000 for 3 years.  But then, the question remains - how many 500-strong companies would consider AdventNet against the de facto leader in the office productivity market.  To add to Zoho's woes, Google has made its intentions clear of getting into the space and surely, Google knows how to attract customers even if some of their products have better competing alternatives.

Now, going back to my initial cost estimates at building Zoho, I am making another assumption that they still have another year's development to get it anywhere close to Microsoft Office (try adding a very large number in Zoho Sheet and generate charts, try working with the suite in IE 7 BETA 2, try cross-referencing values between sheets, try disabling ActiveX when using Zoho Chat - this was the most surprising - after looking at Zoho Sheet - you wonder - ActiveX!!?!, try understanding Zoho Creator, try looking for documentation, try export/import features, etc. etc.).  That would mean another $600,000 (Average 20% hike for developers and some operating costs).  Total - $2M.

And then, I have not added hosting costs for the ASP-model, marketing costs, product re-inventing, re-writing future versions, investments for support infrastructure.

If AdventNet recreated magic, they would need to get 1000 organizations buying 500-user licenses. Or many, many more individuals licensing software.  In a year. Because then, they start incurring more costs.  From the looks of where Web 2.0 is, the concerns people still have and many other factors, it looks like a very, very steep ask. 

AdventNet will, needless to say, back it up with large investments and hope to make it really big. But in that, they are trying to compete against the product planners of Microsoft Office, the inventiveness of Google and the likes of Open Office.  It will be interesting to watch if they can pull this off.

If you asked me, they are headed the wrong way. I only pray that not too many companies invest too much and trigger another collapse. Let us hope, for us and for AdventNet, that I am wrong.

posted on Saturday, July 01, 2006 2:38:14 AM (India Standard Time, UTC+05:30)  #    Comments [0] Trackback
 Thursday, June 15, 2006

Web 2.0 has no doubt arrived. What initially looked like a spate of XML/HTTP-driven websites, now has terms like AJAX (which no doubt was a marketing genius) and Comet making its way into programmer skill-sets.

There was time, back in 1999, when I was just an year into programming, when JavaScript was dreaded.  Nobody was interested in writing more than a few lines of client-side validation. I remember writing what we called a "double dropdown", which basically meant having two JS arrays and then populating a HTML SELECT list based on the selection of the first SELECT list. Like in a country-state selection. Doing that bit was a niche skillset that a couple of us could achieve with minimal code. All because of JavaScript illiteracy.

And then I had the opportunity to work on an IE-only intranet application (oh yeah, there was Netscape 3 and 4 to support otherwise) and thankfully we persuaded the customer to go with IE 4 as the base platform. Doing that application taught me DHTML and JavaScript like never before. In fact, after that I could look at JavaScript to do inventive things. I have had the privelege to code using Remote Scripting, Design-Time Controls (VSDTC) and Visual Basic DHTML project templates - all pioneers in making it easier to code in "AJAX".  However, the best of those days was coding in Notepad.  XML HTTP, which made its debut in IE 5.0+, was something I got introduced to only in 2003.

Why all this?  To give you an indication that the Web 2.0 AJAX thing was always around. But somehow, due to the then backward nature of non-Microsoft browsers, non-standardization and the usual time for user adoption and comfort with new trends, it took a while to appear the way it has now. However, Web 2.0 is not just about AJAX. This is a key thing to remember. Check out Manoj's excellent post on Web 2.0 - a great perspective that I share too and hence am not going to repeat things here.

So, now that the background is set, let me get to what I wanted to actually talk about.

Though there are a variety of new innovative websites out there that harness Web 2.0 technologies and ideologies, it is still quite a small percentage of the larger web. One of the main reasons still remains that JavaScript, that plays a pivotal role in creating powerful interactive websites, is still a nice skillset. Excellent programmers hate coding in JavaScript (take Sid for instance - got to link to that awful post on AJAX here - Sid, place the link in the comments. Interestingly, the company Sid is part of is building something really cool on AJAX to make it easier to build mash-ups). 

Now do you smell an opportunity?  Everybody wants to be on Web 2.0, but JavaScript is a road block. And even if you love coding in JS, writing reams of code is a no-no for productivity. Of course, the larger corporations of the world did sense this and the result is a barrage of "AJAX toolkits" trying to ease the burden.

There is Microsoft ATLAS, Yahoo Developer Network, Google Web Toolkit, the Dojo toolkit, the Prototype toolkit, just to name a few. And there are tools and parsers - you will find plenty of them.

Though all of these are around, the developer view of Web 2.0 is still very confusing. The reason - each one has its own way of solving the problem. Some are even solving the wrong problem.

ASP.NET 2.0 introduced script callbacks which in itself is a great way of writing AJAX-style code. But then many of the associated controls do not have the AJAX capabilities built-in and still rely on postbacks. ATLAS aims at solving this problem - hence enabling developers to write ASP.NET code (read server-side) without having to worry about JavaScript and client hacks. Neat. But this causes two problems - one, it is tied to a server platform and two, it will take longer to mature because Microsoft has assumed that the developers know ASP.NET 2.0 already, something that is not necessarily true in all cases. Moreover, it is taking just way too long to release. I am afraid they might well miss the curve if something really better comes up.

Google Web Toolkit (GWT) works with code generation. Write in Java, generate JavaScript. Though I haven't tried GWT personally, I am pretty sure this is not a great approach. The problem is that no matter how well you write your code generation, purists will tell you that it limits the language that is being generated. If I wanted to do something one way and the tool generated in another way, it is always going to be a problem. Frankly, I had expected Google to come up with something targeting the Microsoft developer base primarily, but coding in Java will limit the user base of GWT as well.

Yahoo UI, Dojo and Prototype are all nice client libraries. In fact, I like Yahoo UI a lo