Interview Questions Headline Animator

Thursday, September 18, 2008

Marriage and the movie maker

I am getting married. That's right. Well I don't know about the other parts of the world, but 32 is a little late to get married for people resident in India. All my friends are married and have children of age ranging from 4 months to 8 years. Most of them started thinking that I am not ever going to get married. But well it is happening. But this blog post is not about that.

A couple of months back, my girl friend (the girl with whom I am getting married silly...!!) received a marriage invite from her friend which was quite innovative. They had made a nice write up with the Shrek Movie poster in the back ground. Sweet nothings about their relationship, about their attitude and chemistry. Being a girl, she was moved and said she wanted something equally innovative for our marriage.  I told her if a picture is worth a thousand words, we make a movie. And we did.

Now to stick the clips together, and to do the editing, I really didn't know what to do. So a friend of mine suggested that I download the ULead Video Studio, which I did, and installed it and used it to create the movie. Dainty little tool it is. The only thing that was left in the movie was the sub titles. Yes I made a movie and the subtitles would describe how the movie relates to our lives. That's when the trial period for Video Studio got over. Now I was in a fix. I didn't want to upload the movie with no subtitles. Talking about it around the cafeteria, Dhananjay, reminded me of the Microsoft Windows Movie Maker.

That's what this blog is all about. I did upload the movie without the subtitles, but as we speak, or rather as I write this, the Movie Maker is publishing the movie with the subtitles. I am going to upload the movie once I reach my workplace. The whole point is Movie Maker is a nice tool, that comes free with Windows since Windows ME. When it was released initially, it faced some poor reviews. But it has come out pretty well it seems.

As Wikipedia quotes it, "Windows Movie Maker in Windows Vista includes new effects and transitions, and support for the DVR-MS file format which Windows Media Center records television in. The HD version in Premium and Ultimate editions of Windows Vista adds support for capturing from HDV camcorders. The capture wizard will create DVR-MS type files from HDV tapes."

Just giving Windows Movie Maker the credit it deserves...

Hosting a WCF Service on IIS

Look for this topic on the Internet. The first thing that you will see is the implementation of the service. I really wouldn't fathom why that is usually done. If I am looking for the subject Hosting a service on IIS, I would assume that the service has already been written and ready, and it is the hosting that I really need the help with. But still I will also follow the standard and go and and tell you the details of how to create a WCF Service.

  1. File -> New -> Website
  2. WCF Service

This will create Service1.svc and IService1.cs. The IService1.cs is the Service Contract, that you need to implement on your Service. Prepare the contract, prepare the Service and then build. Once it builds, you are done with the service.

Now when you are writing an application which requires a WCF Service, you don't really start off with a WCF Service. Just like you don't start writing a Windows Service, with a Windows Service, you don't start a WCF Service application with a WCF Service application. Confused...? What I am trying to say is, in case of a windows service, what I usually do is write the entire application in a Windows Application. Once I am done writing the application, I move the code to a Windows Service, simply because it is much easier to debug a windows application than a windows service. Similarly, I would write a normal multi-layered application, and then once I am done (at least up to a logical completion), I would Create a WCF Service and move the Service Layer (which was not a service layer until now) into the new Service. Of course with it goes all the other layers, which were supposed to be on the database side. Like the Data Access Layer or perhaps the Entities Layer, if you happen to use one.

So coming back to the point how do you really host your service? This article is not really about hosting the service. I would like to write more about the glitches and the obstacles that you have to face when you are hosting the service. In theory, the process of hosting the service is quite simple:

  1. Publish the Service
  2. Open Internet Information Services (IIS) Manager
  3. Create a new application and provide the physical path to the directory into which you published the service

That's it.

Now the glitches:

Server Error in Application “Default Web Site/CallService”

HTTP Error 404.3 - Not Found:

Incase of this error the possible reasons are:

  1. The current version of WCF has not been registered
  2. IIS Scriptmaps are not updated at the IIS Metabase Roots
  3. Existing Scriptmaps are of a lower version

To resolve this issue, you need to take the following steps:

1. Run a command prompt window as administrator. Start, cmd as normal then press CTRL+SHIFT+ENTER
2. Navigate to c:\windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\
3. Run the command ‘ServiceModelReg -i’ - You should receive the results below.
4. Exit

Another error that you most commonly see is this:

"There is no compatible TransportManager found for URI 'http://<your URI>.svc This may be because that you have used an absolute address which points outside of the virtual application. Please use a relative address instead."

The error message might misguide you. There is a possibility that you might have specified an absolute address in the configuration file. But if you go there and check and find that the address is not absolute, then perhaps the error isn't there. For this what you should do is, check if all your IIS Components are installed or not. In my case I discovered that I didn't have 2 things installed. "IIS Metabase and IIS 6 Configuration Compatibility" under Web Management Tools -> IIS 6 Management Compatibility and "Windows Authentication" under World Wide Web Services -> Security.

Last but not the least. If you see any other issues, which you are not able to figure out just by reading the error message on the IE, where you are trying to browse to the service, publish the website once again, using an http:// URI from your Visual Studio project. If the publish fails, even though you might not see any errors on the error window, go to the output window and check. You will see the source of the problem, which is much more clear and easy to understand. This idea was given to my by my good friend Koti who sits next to me.