Rss Feed Like Us on facebook Google Plus
Showing posts with label blog. Show all posts
Showing posts with label blog. Show all posts

August 14, 2012

WCF concepts implementation with examples and interview questions

WCF - Windows Communications Foundation

"WCF is a programming platform and runtime system for building, configuring and deploying network-distributed services. It is the latest service oriented technology; Interoperability is the fundamental characteristics of WCF. It is unified programming model provided in .Net Framework 3.0. WCF is a combined feature of Web Service, Remoting, MSMQ and COM+. WCF provides a common platform for all .NET communication."

A WCF Service is composed of three components parts viz,


1) Service Class - A WCF service class implements some service as a set of methods.


2) Host Environment - A Host environment can be a Console application or a Windows Service or a Windows Forms application or IIS as in case of the normal asmx web service in .NET.


3) Endpoints - All communications with the WCF service will happen via the endpoints. The endpoint is composed of 3 parts (collectively called as ABC's of endpoint) as defines below:

Address
The endpoints specify an Address that defines where the endpoint is hosted. It’s basically url.

Ex:      http://localhost/WCFServiceSample/Service.svc


Binding
The endpoints also define a binding that specifies how a client will communicate with the service and the address where the endpoint is hosted. Various components of the WCF are depicted in the figure below.
·         "A" stands for Address: Where is the service?
·         "B" stands for Binding: How can we talk to the service?
·         "C" stands for Contract: What can the service do for us?

Different bindings supported by WCF:

Binding
Description
BasicHttpBinding
Basic Web service communication. No security by default
WSHttpBinding
Web services with WS-* support. Supports transactions
WSDualHttpBinding
Web services with duplex contract and transaction support
WSFederationHttpBinding
Web services with federated security. Supports transactions
MsmqIntegrationBinding
Communication directly with MSMQ applications. Supports transactions
NetMsmqBinding
Communication between WCF applications by using queuing. Supports transactions
NetNamedPipeBinding
Communication between WCF applications on same computer. Supports duplex contracts and transactions
NetPeerTcpBinding
Communication between computers across peer-to-peer services. Supports duplex contracts
NetTcpBinding
Communication between WCF applications across computers. Supports duplex contracts and transactions

Contract
The endpoints specify a Contract that defines which methods of the Service class will be accessible via the endpoint; each endpoint may expose a different set of methods.

Types of contracts in WCF

Service Contract
Service contracts describe the operation that service can provide. For Eg, a Service provide to know the temperature of the city based on the zip code, this service is called as Service contract. It will be created using Service and Operational Contract attribute.

Data Contract
Data contract describes the custom data type which is exposed to the client. This defines the data types, which are passed to and from service. Data types like int, string are identified by the client because it is already mention in XML schema definition language document, but custom created class or data types cannot be identified by the client e.g. Employee data type. By using DataContract we can make client to be aware of Employee data type that are returning or passing parameter to the method.

Message Contract
Default SOAP message format is provided by the WCF runtime for communication between Client and service. If it is not meeting your requirements then we can create our own message format. This can be achieved by using Message Contract attribute.

Fault Contract
Suppose the service I consumed is not working in the client application. I want to know the real cause of the problem. How I can know the error? For this we are having Fault Contract. Fault Contract provides documented view for error occurred in the service to client. This helps us to easy identity, what error has occurred.

Delete [OperationContract] attribute:
When we delete  [OperationContract] attribute we get an exception
“Contract OR Binding mismatch between the sender and receiver”


Read More

February 22, 2012

how to get your Website/Blog in google within 24 Hours

We all know that content is king and that if you keep blogging… if you keep doing what you love… the traffic and the money will follow suit. While that’s partially true, there is also things that you can do to:

Why wait right? Content can be king but waiting around for traffic to come by itself is not a good way to start blogging. So let’s start…


Getting Indexed

Let’s say you launched a Blog or Website today and want it on Google’s results tomorrow. Can this be done?Yes.

Easiest way to get indexed by major Search Engines is to get mentioned by established blogs. This usually will get your blog indexed within 24 hours. But since we are new (i.e the newly launched blog of ours) I don’t think any blogger want to mention it. So instead of begging other bloggers to notice your newly launched blog, you just have to figure out other ways of getting indexed by Google fast. Can it be done? Absolutely! (All it takes a little effort on your side).


1. Blog Communities
There are few blog related community portals that have a very good rankings in Google and other Major Search Engines Results, they are:  BlogCatalog, Blogged and NetworkedBlogs. This means that if you get your blog on these blog communities, Google will have no other choice but to index your blog. So, go ahead and register for an account on these communities and list your blog on it. 


"What to pay attention: Your blog’s description (have a proper write-up), keywords & tags (add related keywords and tags to your listing, this will be used by other members to find your blog), branding (put your logo, avatars, screenshots etc. have a consistent branding everywhere), and list your blog in the correct category."
 

2. Site Valuation & Stats Sites

Some of those How Much Your Site Worth? sites have a good ranking in Search Engines. All you need to do is to go there and check how much your site worth. This would create a special page for your blog (like this) and consecutively it would be indexed by Google. Here is a list of worthy sites:WebsiteOutlook, StatBrain, CubeStat, WebTrafficAgents, BuiltWith, WhoIs, QuarkBase, URLfan and AboutTheDomain.
 

3. Feed Aggregators

List your blog’s feed in these feed aggregators Feed-Squirrel, OctoFinder, FeedAdage. Once you have submitted your feed to these sites, they will keep track of your newly published posts and index them in their site. Whenever someone clicks on the blog post title, he/she will be redirected to your original blog post sending you free traffic and getting your latest posts indexed by Google.
 

4. Social Sites

Registering account on Social Sites with the same username as your blog’s URL is very effective in getting your blog indexed by Search Engines. Especially for those targeted keywords.

For example, if your blog’s name is Tech Impulsion, it’s a good practice to register the same username at twitter as @techimpulsion, and to create a page in Facebook at www.facebook.com/techimpulsion. Having a consistent keyword-username on all major Social Sites will help get your blog indexed faster, and at a later stage it will also help build a “brand” for your blog.

So, get account on major Social Sites for your newly launched blog, namely: Twitter, Facebook(create a page for your blog), Digg, StumbleUpon, Delicious etc. By the way, it’s a good pratice to create a separate Social Sites account for each of your projects. This way you can stay focused and post messages that are related to your project. In the long run, this will help build a community that are like-minded around your project.
 

5. Misc Sites

Squidoo is a community website that allows people to create pages (called “lenses”) on various topics. Creating a topic that is related to your blog and then including your feed in that page would help your blog get indexed by Search Engines. Squidoo used to have a really good ranking in Google results, but not so much today. But it’s still ranks well and it shouldn’t be neglected.

ChangeDetection is a website that monitors sites for changes. When you monitor a particular site using ChangeDetection, it will ask you whether you want the notices to be public or private. If you say public, it will be published in their news section.


Technorati is a search engine for searching blogs. "According to Wikipedia, as of June 2008, Technorati was indexing 112.8 million blogs and over 250 million pieces of tagged social media." It’s a dying breed, but not just dead yet. You have to definitely register for an account and get your blog listed on Technorati.

That’s it. Once you are done with creating accounts and submitting your newly launched blog in the above mentioned sites, you should see your blog in Google’s Search Results within 24 hours. Most of the time it will appear within the next few hours only.

Lastly, getting indexed is one thing but sustaining that traffic is another. And this is where the Content is King phrase should truly be emphasized. Because, without a good and valuable content, all your effort will be just wasted.
Read More

February 18, 2012

Socialize your Blog with these 10 tips

When it comes to building an audience and driving traffic, bloggers are turning to social media with record results. Instead of relying on organic search or (gasp) IRL friends, successful bloggers know they have to develop a following on key social networks as a way to promote their brands and ultimately get more clicks.

Twitter, Facebook, StumbleUpon and now Pinterest provide the savvy blogger with plenty of opportunities to attract new readers and engage with regulars, but it can be overwhelming if you’re new to social media or if you only use it for fun. 

Here are 10 tips to help bloggers navigate the increasingly complex world of social media — while still making time to write content.

1. Display your social media icons prominently toward the top of your website.


Make it as simple as possible for your blog readers to connect with you on various social media platforms. They shouldn’t have to hunt around to find your Twitter handle, but should be able to click on a button and be taken right to your profile. Bonus points if your social media icons reflect the overall design or feel of your blog.

2. Every blog should have its own Facebook Page.


Even with Facebook’s new subscription feature, there’s still merit to giving your blog its own space on Facebook. It’s nice to be able to post a link every time you publish something new, and not have to worry about annoying your friends. Plus, readers who don’t your name but know the name of your blog can search for it on Facebook. Show your fans some love on your blog by using the Facebook social plugin, which makes it easy to convert readers to fans.

3. Generate traffic with StumbleUpon.


This “recommendation engine” serves as an alternate browser where users click through pages that their SU friends and SU itself have recommended. You can submit your own blog posts into the system, but it works best if you also share them with your SU friends and accept their shares back. Like most social platforms, you need to have a strong following to get good results. While people are still trying to figure out what makes SU content go viral, many bloggers have seen terrific, albeit fleeting, traffic spikes through the service.

4. Import your RSS feed onto your LinkedIn profile using its Blog Link application.


As long as your blog somewhat pertains to your professional goals, you should be showcasing it on LinkedIn. List it as one of your three websites in your profile, where it will be labeled “Blog.” However, by using the Blog Link application, your most recent posts will display right on your profile.

5. Pinterest is the hot new frontier for bloggers.


Pinterest is the cool new kid, and all of the bloggers are scrambling to establish a presence there. Pin your best photos onto themed boards with links to a relevant blog post. Blogs with strong visual content, like fashion, food, design, crafts and travel, are a natural fit. Infographics will also do quite well. Don’t forget to add a Pinterest plugin (like the Pinterest “Pin It” Button for WordPress users) to make it easy for your readers to share your content on their Pinterest boards.

6. Use link shorteners even when you don’t have to.


Twitter will now shorten your link for you, and the length of your link doesn’t matter on Facebook and Google+. But by using a link shortener like bit.ly, you will gain access to metrics, so you’ll know how many people clicked and at what time. With this essential data, you can experiment with different ways to tease your content and different times to post it.

7. Use your blog name as your username whenever possible.


Promote your personal brand by consistently using your blog’s name for your Twitter handle, StumbleUpon name, Pinterest name and so on. Then, people don’t have to wonder about your blog’s name — it’s right there. Also, people will remember you easily across platforms, which is key as you develop up your online community.

8. Join blogger groups on Facebook.


There are some very active groups on Facebook that are terrific resources for any blogging issues you encounter. Look for groups like “Travel Bloggers” or “Global Bloggers Network.” WordPress geeks have “Advanced WordPress” and Central Florida residents have “Central Florida Bloggers.” Not only are blogger groups good for problem-solving, but it’s well-known that bloggers like to read other blogs. Do some searching and find a bloggers group that’s suited to you, or start your own!

9. Be generous with other bloggers.


Promote other bloggers’ content, and hopefully they’ll return the favor. You can’t simply blast your own content anyway — you need some variety in every social media stream. So why not check out what your fellow bloggers are posting and give them a retweet, a share or a repin whenever you can. And don’t forget to reciprocate and share content from bloggers who share yours.

10. Be on social media — even when it’s not driving traffic.


It can be frustrating when you feel that you’re doing everything right (posting good content on the appropriate platforms in the best way possible) and you’re still not getting many clicks. But console yourself by thinking about all of the links that you see throughout the day that you don’t click on. Just spending time on social media platforms is great way to forge relationships, keep up on industry news and find inspiration for that next blog post.
Read More

January 30, 2012

Add Facebook Comments to Your Blogger's Blog

Facebook comment box is one of the useful tool for bloggers to increase conversations. So here in this post I will teach you how to add/integrate Facebook comment box to blogger in simple steps. Before getting into the process I recommend you to back up your template and previous comments in blogger wont be visible if you use Facebook commenting system.

Hide Existing Comments - The best way to start off is by hiding the comments made from the Blogger System. To do that, go to Settings > Posts and Comments and set the Show Comments option to Hide and Save the Settings


1. Create a Facebook Application

To use Facebook comments on your website, create a new comment application for your website on the Facebook Application page. This step is required, whether you add Facebook comments manually using a third-party plugin or with the official Facebook plugin.


Simply click on the “+ Create New App” button on the Facebook Application page, and enter a unique name for your application in the “App Display Name” field. The “App Namespace” field doesn’t have to be filled in for Facebook comments (it’s used with the Facebook Open Graph Protocol).


2. You will then be provided with an “App ID/API key” and an “App secret key.” Copy the App ID.













In the App Domain Field give blogspot.com (If you are using a custom domain give that) Give your Blog Address in the Site URL field under “Website” and Save The Changes. Copy the Application ID from the screen
3. Add Application and Moderator Meta Tags

Modify the below code with the application id copied in step 2.

<meta content='YOUR_FACEBOOK_APPLICATION_ID'   property='fb:app_id'/>


e.g. - <meta content='221595294600904'   property='fb:app_id'/>

Go to Template/Design > Edit HTML and paste the above code just below

<head><meta content='221595294600904'   property='fb:app_id'/>
You should create the Facebook Application and the above fb:app_id meta tag should be added to your Blog. Otherwise you won’t be able to manage/moderate your Comments from a single Place(you will have to go to posts one my one and moderate and that too is possible only if you have added the fb:admins open graph meta tag).

4. Add FB Comments - Now you have to add the Facebook Comment Form to your Blog Template. To do that Go to Template/Design > Edit HTML and click on the “Expand Widget Templates” check-box.

Find the following code in your template(Use the keyboard shortcut Ctrl + F), and immediately below that paste the following code:

<div class='post-footer-line post-footer-line-3'>

If you can’t find this, then find

<p class='post-footer-line post-footer-line-3'>
If you cant find that as well, then find

<data:post.body/>

Paste the following code just below the line that you just found out

<b:if cond='data:blog.pageType == "item">
<div id="fb-root"></div>
<script>(function(d){
 var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
 js = d.createElement('script'); js.id = id; js.async = true;
 js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
 d.getElementsByTagName('head')[0].appendChild(js);
}(document));</script>
<fb:comments width='450' colorscheme='light' expr:title='data:post.title'
 expr:href='data:post.url' expr:xid='data:post.id'/>
</b:if>



5.FB Namespace Declaration - Next you have to add the fb namespace to your template tag.Your template should have the specification for the fb tag that you have used. The following XML namespace declaration will take care of that. To declare the namespace, find

<html
and change it to
<html xmlns:fb="https://www.facebook.com/2008/fbml"

(there is a space after the 2008/fbml” )The following screenshot will help you out.









Save the Template. This namespace declaration is necessary for all FBML widgets using the fb tag. So if you have already added the namespace declaration while adding some other FB plugin, then you can skip this.

You are Done !!!!


Managing Your Comments

When you are logged in to your Facebook account, the Facebook comment plugin will detect that you are the admin(it will detect you if you have added the fb:app_id or fb:admins meta tags). You will be able to manage the Settings and moderate the comments from there.

 
Read More

January 12, 2012

Perfect Ways to Improve Your Blog to Next Level

What does it take to move your blog up to the next level? Obviously you need a regular supply of useful content to attract readers and keep your audience happy, but here are a few extra tips on increasing interest in your blog in 2012.
1. Stop Auto-Posting
It is important that your blog has a Facebook page, a Twitter account and a Google Plus page, but unless you publish a dozen stories a day, avoid auto-posting to these channels. There are several tools that can update your Facebook page or send a tweet the moment you publish a new story, but the audience engagement level will be much higher, especially on Facebook, if you craft these messages manually instead of resorting to the help of a bot.
Lifehacker, for instance, is a pretty busy site, but it doesn’t employ bots to populate itsFacebook page – every single share or status update is written by one of the site’s editors, which helps push up engagement levels.
2. Use Fewer Ads
Revenue from online advertising is the lifeline of most small blogs, but try maintaining a balance here because too many ads are likely to repel visitors. The organic traffic originating from search engines is always welcome but the goal should be to convert that casual visitor into a return visitor, so you therefore need to offer a good reading experience on every page of your blog. Also, avoid using video ads that auto-play as they might embarrass people who are visiting your blog from an office computer.
GigaOm, The Verge and the WSJ’s AllThingsD are good examples of blogs that mix great design and non-intrusive advertising.
3. Master Google Custom Search
Internal search logs (what users type in your site’s search box) are a good indicator of topics that people are looking for on your site. The search box on your site is probably powered by Google Custom Search, but look beyond the default options and consider adding Promotions, Refinements and Synonyms to provide even more accurate and relevant search results. Google Custom Search also provides Auto-completions so your readers can type queries faster by using fewer characters.
The Custom Search Blog discusses each of these features in detail.
4. Minimize the Panda Impact
Google made some important changes to its search algorithms last year to keep “content farms” out of the search results pages, and that change had a big impact on small blogs as well. While the basic rules of SEO haven’t changed (see the SEO Handbook written by Google), here are a few things that may help improve your website’s  ranking in 2012.
a.     Remove pages with thin content because they could negatively affect your entire site.
b.     If you accept user-generated content on your site (like an online forum), move it to a separate sub-domain.
c.      Use larger images in your blog posts as the size of images is now a ranking signal in Image Search.
d.     Check your Google Analytics reports to discover pages that have a high bounce rate and analyze why people aren’t finding them useful. Search engines like pages that search users find useful, so it is important to fix pages that have a high bounce rate.
e.      Work on improving the loading time of your site because people don’t want to wait on the web. Page load time is also a factor in search rankings.
f.     Enable Social Tracking in Google Analytics to learn what content of yours is popular on social networks. While this is not officially confirmed, some search experts say Google could be using social sharing signals in search rankings.
5. Explore Additional Mediums
RSS feeds and email newsletters are the two most popular ways to distribute a blog, but now is a good time to explore other avenues as well. That’s because the use of RSS readers has declined in recent years and most people don’t want to subscribe to another mailing list just to follow a blog. Here are few things you could experiment with:
a.     Create mobile apps for your blog. Anyone with decent knowledge of programming can create blog apps using free tools like PhoneGap and jQuery Mobile.
b.     Distribute some of your long-form content as an eBook that people can download and print or read offline. Web18’s FirstPost.com offers a free eBook of their popular posts every week.
c.      In addition to having a fan page for your blog on Facebook, also open your personal profile to subscribers because the engagement levels are much higher for content shared on a Facebook profile page than on a fan page.
d.     Create browser extensions for your blog as some of your regular readers may visit more often if you offer them easy access tools.
e.      Publish an OpenSearch plugin as that will help people search your blog from within their browser search boxes. OpenSearch is a simple text file (here’s an example) that you can even create inside Notepad.
f.       Launch a video channel and apply to become a YouTube partner. YouTube is the second-largest search engine after Google, so you’d be missing out on a large audience if you don’t put videos on YouTube.
g.     Use additional distribution channels like Slideshare, Tumblr, Flickr and Scribd to expand the reach of your blog. You can publish original pictures, documents and slides to these channels and, in the long run, these shares will indirectly help in the growth of your blog.

Read More

© 2011-2016 Techimpulsion All Rights Reserved.


The content is copyrighted to Tech Impulsion and may not be reproduced on other websites.