WCF: Hosting Service with multiple end points

In continuation of previous post regarding WCF, here goes another. In this post I will do step step explanation for hosting service using config file (remember this is the beauty of WCF, we don’t need to recompile to add multiple endpoints).

The assumtion is readers have already implemented the service contract. I will use a dummy class named IService for my explanation

  1. Create a instance of ServiceHost. 
    1. ServiceHost servicehost = new ServiceHost(typeof(Examples.ServiceImplementation));
  2. Use the Open to start listening.
    1. servicehost.Open();
  3. Now put the following in the App.Config file


Let me explain each of the element

  • The host element declares the base address for the endpoint. In this case its declaring two base address the http address and another one is the tcp address. The host address is used by the ServiceHost to listen on the respective port and address.


  • There are three endpoints


Each endpoint basically is collection of address, contract and binding. Here in the above case the address is not specified as we have already sepcified in the base address. The contract is Examples.IService and the binding is HTTP.

  • The second endpoint


is the TCP endpoint for the same service. Smilar to the previous one this definess the endpoint as collection of Examples.IService as contract and binding as TCP and address is not mentioned and taken from the base address.

  • The last endpoint


is used by the client to generate the meta information about the Service. This  is standard and ideally should be there for each service.I hope the above helps in understanding this beautiful technology.

The author has 10+ years experience with Enterprise Poduct Development. He is also the Co-Founder of PCVITA. He have expertise in Enterprise Architecture, Enterprise Messaging Platform Migration, Email Archiving.


Understanding WCF

Windows Communication Foundation(WCF) that is part of .NET Framework 3.0 is in the line of Microsoft(MS) classic work of abstraction. MS have been innovator in providing abstraction over various technologies from many years. In the same tradition I do believe WCF is another achievement. Undoubtedly they understand the difficulties in any technologies being faced by technology implementors and then they use their experience to nake the technology simple by intoroducing the layer of abstraction.

Let me talk about WCf in particular now

  1. It was always challenge from many years to talk to remote objects.
  2. Many technologies have come and gone or become extinct as dinosors.
  3. To name a few will be CORBA or DCOM.
  4. But there was always problem with the technology itself and its implementation.
  5. Web Service was the most pouplar of all the technology and it still one of the best for such communication.
  6. The problem comes when we want to expose a remote object interface with multiple protocol interface such as HTTP, TCP etc.
  7. The problem with existing technology is that we have create multiple interface for the remote object i.e. each specific to each protocol.
  8. This really become a stumbling block while deciding on the protocol to be used as creating multiple interface results in maintainence overhead.
  9. So if we want a complete interoperable solution we need a web service based interface but if its standalone system the same Web Service interface becomes a performance bottleneck.
  10. WCF really becomes a great help for such scenario. It allows developer to create interface irrespective of the protocol to use.
  11. Developer can then configure the so called end points to decide on which protoocl to used for communication.
  12. The developer will create the interface and implement it. It will then expose the interface using multiple end points i.e. HTTP, TCP, Named Pipes.
  13. The client using the interface then can use the appropriate end point based their need.
  14. WCf as infrastructure takes care all overheads related to messaging etc.

Calling Web Service using XMLHTTP Object

Follow the steps to invoke a webservice using a XMLHTTP object in javascript

Step  1: Create a soap envelope for the requested method.


 var envelope = <The above string>;

Step 2: Create Instance of XMLHTTP Object

Now in the Javascript method create an instance of the XMLHTTP object


 Step 3: Prepare the Webservice Request

 As shown above the url points the target webservice which is Service.asmx file and named of the method is HelloWorld. The syntax to be used

http://<Host Name>/<Virtual Directory>/<Webservice>/Method Name

in the next line we are initiating a POST request for the webservice url.

Step 4: Handling the Callback


Here when the response from the web service returns it just display the return string in alert box.

Step 5: Sending the  Request


As shown above, the send message is send with the envelope  for the Web Method prepare in the Step 1.

Step 6: Executing the Web Service


Refer to this link for more  http://support.microsoft.com/default.aspx/kb/893659

Hello World using Apollo/Adobe AIR

Its been days that I was trying to write a simple app using AIR, the buzz word these days, so downloaded the following

  1. Adobe AIR SDK.
  2. Adobe AIR SDK documentation.

Extract these above stuff after downloading. The documentation is quite good for a HTML /Javascript developer like me. Here I write a Hello World html file using AIR framework.

There are three things to be done

  1. Application XML file.
  2. HTML File.
  3. Executing the application.
Application XML File
  1. Create a XML file named <AppName>-app.xml, here appname can be HelloAIR.
  2. The structure of XML is


The text of rootContent element represents the name of the html file that is associated with the xml.


The following the html code


The appLoad is invoked when the page is loaded. As shown above we are including the standard AIRAliases.js file in the HTML file, so AIR runtime will be initialized. If its initialized the Air.Trace statement is used to print on AIR console “Hello Air”. Then XMLHTTP request is made for getting request.txt file and dumping the content of that file onto the AIR console.

Executing the Application

When the AIR sdk is extracted there are two programs that come

  1. ADL: To execute the AIR application
  2. ADT: to package the AIR application

Use the adl command to execute the AIR application.

The ADL command

When you execute the command with XML as parameter then the following is displayed



As shown above the Hello.AIR is the Air.Trace output and the white console displays thee content of the request.txt file.

Windows Form Life Cycle

A link to Windows Form Life Cycle


Morphological Image Processing

Morphological Image Processing.

Leave approval workflow using CloudCodes gFlow

Continuing from previous post, today we will show how easy is to configure typical leave approval using CloudCodes gFlow.

  1. Click on Admin/Setup section from the top menu.
  2. Click on Forms/Flows
  3. Click on Add Flow
  4. Provide the basic information about the approval
  5. Provide approval route information
  6. Configure form
  7. Define approval chain

Basic Information for Approval


The basic information approval includes

  1. Title of the approval workflow i.e. “Leave Approval Form” in this scenario.
  2. Description i.e. “Leave approval form request”.
  3. Organisation Unit(OU)to whom the form have to be made visible. This provides a flexibility to create leave form for each OU or create different approval chain for different OU.
  4. Form category to which the approval form will belong.
  5. If the form is set to enabled then it is displayed in the list of forms else it is store in the archive. We do maintain versioning of forms.

Approval Route Information


The approval route information includes

  1. Define the approval category/group. For e.g. if the leave approval has multiple phases or stage i.e. Internal Team, Human Resource, Finance then we can create 3 approval group and configure approver for each group.
  2. The approval across group can work in a sequential manner or in parallel depending upon the Approval Mode. For e.g. if it set to sequential then Internal Team will go for approval first and once all approvers are done then only it goes to next group.
  3. The approver type define whether the approvers can be pre-define or user define. In case of pre-define the administrator while creating the form can define the approval chain. In case of user define the end user can define the approval chain.
  4. Approver File Upload can be used to configure whether approver can upload the file or not.
  5. Approver process if flow is Resubmitted is configure to ensure how cancel approval can be sent for approval again. If it set to “Start from begining”  then re-submitting for approval will have all approvers irrespective of whether they have approved previously and if it set to “Continue where left off” then re-submitting for approval will only have the approvers who have rejected and pending for previously.

Configure Form


Configuring form is creating the approval form. The form can be categorized into multiple sections. Each section have their own fields relevant for approval. The section can configured to display in

  • One column layout
  • Two column layout

Configure the field as required by the approval form. Each field can be define to store particular type of data such as

  • Text/String
  • Date

We can also define list of values to be displayed in combo box. The type of field is “Select List” for such list of values.

Define Approval Chain


Configure the approval chain for the leave approval. For e.g the approval chain is

  1. On submit, the manager of the user should approved it.
  2. After manager, the HR should approved it as it need to check the leaves details.
  3. The HOD can be marked as FYI.

Once its save the user can see their requests within the form category specified i.e. HR in this case.


The use clicks on Start for the Leave  approval and provide information and submit for approval.


Approval workflow on Google Apps without the need of IT team

CloudCodes gFlow provides business users of SMB customers for Google Apps to automate their approval workflow without the continuos need of IT team. The following are the dependency for the IT team

  • Install the gFlow from Google Marketplace.
  • Assign the business user as administrator for gFlow.

Once gFlow is installed on the Google Apps domain, the business user can do the one setup for the following

  • Roles
  • Department
  • Users
  • Approval Categories

Once the setup of above is done, the business user can start converting paper based approval form on gFlow. Isn’t that simple?

If a new user needs to have access to gFlow then the user can request for access by clicking on gFlow from the More link. The administrator(business user not IT admin) receives an email notification and can add the user in a couple of minutes.

The objective of gFlow is to allow the business user to bring efficiency in their approval process and not get involved in IT administration of the product along with IT team which indirectly increases the risk to increase their budget.

CloudCodes is very much committed to ensure gFlow is able to meet the various complex need of Approval process within a customer organization. CloudCodes will keep on adding those features to meet such complex requirement.


CloudCodes SecureCloud+: Advanced Single Sign On(SSO) for Google Apps

CloudCodes SecureCloud+ is another solution by CloudCodes Software to overcome the IT issues related to Google Apps deployment for enterprise.

SecureCloud+ provides enterprise to implement Single Sign On(SSO) with Google Apps. It provides great control on how user within enterprise uses Google Apps. SecureCloud+ is deployed on Google App Engine.

Custom Login  Page

SecureCloud+ allows enterprise to customize login page. The login page can be changed to match the brand guidelines of the enterprise.


Redirect to Selected Google Site

SecureCloud+ allows you to forced the user to redirect to particular Google Site page after successful login. This is useful in case user should be forced to redirect to Corporate Portal on Google Apps.

IP Restriction

SecureCloud+ allows Google Apps administrator to restrict users to access their Google Apps enterprise account from a particular set of IP address. SecureCloud+ will not allow to login the user from any other IP address apart from the assigned one. It also takes care of the roaming user by assigning them as special user and allow them to access from any IP address.



SecureCloud+ provides auditing report in the form Google Spreadsheet. It provides the following information

a. UserName

b. Event (Login Success/Login Failure/Change Password)

c. IP Address

d. Time

e. Browser

Contact support@cloudcodes.com for more details.



Active Directory Google Apps Password Sync

CloudCodes Software provider of Google platform based product provides password synchronization tool for Active Directory and Google Apps.

The synchronization tool is simple and easy to use. Once the product is installed on the primary domain control and configured with Google Apps, any password changes by user on the AD is synchronized with Google Apps.  The product has the following system/technical requirements

1. Windows Server 2003/2008

2. .NET Framework 3.5

Once the product is installed and configured it need to go through a restart process. After the restart the AD the tool is installed within the AD.

The tool send the password to Google Apps in an encrypted manner. The password is encrypted before updating to Google Apps.

Read More


Links for Skype Crash

A link provided by Skype

Skype Support




Skype Crash Globally

Everyone is blaming Microsoft acquisation for the global crash of Skype crash today. But I found this unfair. Its just 2 weeks old news and I believe nothing have changed in Skype to have such impact.

Though it affected our support through our website www.pcvita.com

A news article on the same topic