Blog from Saravanan Arumugam

Let us talk about Technologies

Monthly Archives: October 2010

Default end point of WCF service


Default properties of WCF service

Recently I tried to create a WCF service manually without using WCF service project template in Visual Studio 2010. I found a strange nature in the service which was different from my usual understanding.

I followed the following steps.

1. Created a web project.
2. Added two class files, one for Service Contract Interface and another for the service definition.
3. Created a service file (.svc) with the definitions pointing to the contract and namespace I have created.

The only thing I left alone was the configuration. I didn’t add any end point to expose my service out.

To my understanding, from the recommendation of any book or article I read, a service must expose an end point either through configuration or through the code.

I wanted to see the behavior of the service without specifying an endpoint explicitly to it.

I ran the service and found that it’s hosted usually as any web application hosted from file system.

On selecting the .svc link, I could get the WSDL link.

I then created a client application to consume the service and to see if its also behaving properly. I added a service reference and gave the address of the WSDL.

It worked flawlessly.

 

From this exercise I figured out the following.

1. An endpoint is not a mandatory thing for a WCF service.

2. When we create a consumer that adds service reference, the consumer project/application adds an endpoint in the configuration.

3. The end point in the consumer points to an address such as http://localhost:12345/TaskManagerService.svc.

4. The consumer calls the service through basicHTTPBinding. Hence basicHTTPBinding looks to be the default binding that Visual studio arrange for the developers.

5. The address of the WSDL port number and the address stays constant how many ever times we restart the applications. This behavior is due to the Developer Server arrangement by the Visual Studio.

Advertisements

Visual Studio Development Server


When we work on a File-system based web site, the application is run on the localhost with a port number. E.g. http://localhost:12345/TaskManagerService.aspx.

This port number is a randomly chosen one when we run the web application.

Even when we restart the web application (restart the visual studio), this port number stays as is for every run. It usually doesn’t change. This is because of the following behavior of the Visual Studio.

 

The port number used to host the web application is stored in the project file (.csproj or .vbproj) under the tag, <DevelopmentServerPort>.

When a web application is initially created, this Development Server Port is initialized to zero. <DevelopmentServerPort>0</DevelopmentServerPort>

But when the application is run for the first time, an available port is randomly chosen and assigned to this web application. That’s how we get the default website address starting with http://localhost:12345.

The chosen port number is stored in the project file for any future runs. <DevelopmentServerPort>12345</DevelopmentServerPort>. During every run of the web application, Visual studio looks for a port number in the project file and sees if the port is free for use. If the port is available, the same port number is used for hosting the application.

 

Changing the default Development Server Port Number

For changing the port number follow these steps.

1. Open the .csproj or .vbproj file with a regular text editor (e.g. Notepad).

2. Browse for the tag <DevelopmentServerPort> and change the value in it.

or

1. In Visual Studio click on the Project Menu and Select <ProjectName> Properties…

2. Select the Web tab.

3. Under the Servers group, we would find the Use Visual Studio Development Server option.

4. Under this option we can select the Specific Port option and specify the port number of our choice.

image

Note: Though we have the option to chose the port number, there is no guarantee that the number of our choice would be available. So on running the application, it may likely be changed by the visual studio.

Read out loud Feature in Acrobat Reader


Using e-books is becoming more popular now a days. Almost all the technical books are available in the form of pdf. Even though conventional paperbacks are preferred by most users,  e-books are cheaper and easy to use. Introduction of sophisticated mobile devices increase the ease of use of e-books.

In the acrobat reader, traditional tool for reading e-books, we have the facility of having the computer read the e-book content for us (Accessibility feature). We can just follow what it speaks out and understand. Personally, this facilitated me reading the e-books quickly and made the reading fun.

I would like to narrate how to use the reading feature of Acrobat in this article.

Enable Read out loud feature

To enable the read out loud feature, in the acrobat reader, select the View menu > Read out loud > Activate Read out loud.

Alternatively try using the hotkeys: Control + Shift + Y.

Reading the e-book

Once the read out loud is turned on, we can,

  • Read to the End of the Document by pressing Control + Shift + B.
  • Read this page only by pressing Control + Shift + V.
  • Read a selected paragraph by clicking on the paragraph.
  • Reading can be paused or resumed by pressing Control + Shift + C .
  • Reading can be stopped by pressing Control + Shift + E.

Note: All the above can be done through the menu options: View > Read out loud

Configuring voices for Read out loud feature

Internally Acrobat reader uses the operating system’s internal feature called Text-To-Speech (TTS) engine to read the documents.

Text-To-Speech capability refers to the ability to play back text in a spoken voice.

For configuring the Read out loud feature in Acrobat reader follow these steps.

Step 1: Use Edit Menu > Preferences. (In Mac, we can find the preference in Acrobat Reader Application Menu)

Step 2: In the Category list, chose Reading.

Step 3: Under the Readout loud group box, Use default voice check box would be checked by default. Unchecking this would enable the selection of different voices.

Step 4: Select the voice of your choice in the drop down and click OK.

Each voice listed in the preference Drop down is a speech engine from operating system.

Configuring Speech Engines

Windows XP and Windows Vista offer a default Text-To-Speech engine, Microsoft Sam. Windows 7 comes with Microsoft Anna.

By default Text-To-Speech engine is turned on in Windows and it can be configured through “Speech properties” in Control panel. (In Windows 7, use Control Panel > Speech Recognition > Select Text-To-Speech on the left pane.)

Though Microsoft comes up with only one speech engine, it allows us to install additional 3rd party speech engines.

Note: Refer to How to configure and use Text-to-Speech in Windows XP and in Windows Vista for more detail on configuring Text-To-Speech engine.

Mac OS provides many such speech engines by default.

Refer to Apple’s Commitment to Accessibility for more detail.

Windows XP Icon Generation


Its always been a mystery how Microsoft Icons are made. Whenever we try with out traditional icon creation tools, we usually end up in minimal color bitmap kind of Icons or we have to google download some ready made icons from internet.

I recently came across an article from Microsoft (Though it was an old article, I saw it just some days ago) that was talking about Windows XP style icon creation.

Creating Windows XP Icons

This article primarily talks about using Photoshop as an image processing tool for creation of icons. It walks us through the theories of icon creation concept, decision of icon size, color etc.

I found it so useful for creating icons of my own. So I thought of publishing it for others to refer.