0
Posted on 8:19 AM by Softminer and filed under ,

Here is a good example of publish subscribe design pattern in c#
http://www.codeproject.com/Articles/34316/Topic-based-Publish-Subscribe-design-pattern-imple

Here you can read about Publish Subscribe design pattern
http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern

WCF has already some method to implement it
http://www.codeproject.com/Articles/34333/Topic-based-publish-subscribe-design-pattern-imp

0
Posted on 7:18 AM by Softminer and filed under ,

To install TFS 2013 you need to install SQL server 2012 or 2014
Look at the requirement here
http://msdn.microsoft.com/en-us/library/dn641202.aspx

After installation you have to create new TeamProject

and choose a process template for that, Here is the default process template
http://msdn.microsoft.com/en-us/library/ff731587.aspx

To be able to customize a template you should be able to download the template, edit it and upload it
http://msdn.microsoft.com/en-us/library/ms243782.aspx

Modify or add custom work Item
http://msdn.microsoft.com/en-us/library/hh409273.aspx

0
Posted on 5:05 AM by Softminer and filed under

Comparing with selenium Ranorex is very much powerful but costly which start from 690€.
Selenium has a lot problem with browser compatibility and It doesnt work for example with Firefox versions.

Here is a tutorial about Testing web Service
0
Posted on 4:46 AM by Softminer and filed under ,

http://www.codecademy.com Free courses mostly about Web
http://www.pluralsight.com Minimum 29$/Month Microsoft products (Free trial) My recommendation
https://www.udacity.com Minimum 199$/Month Free trial Course materials are free
https://www.coursera.org Free courses From most universities in Many languages
0
Posted on 8:07 AM by Softminer and filed under ,

This is a tutorial to test webservice using Ranorex

http://www.ranorex.com/blog/how-to-test-web-services-with-ranorex

To test following asp.net webservice can be used.

http://www.w3schools.com/webservices/tempconvert.asmx



0
Posted on 5:03 AM by Softminer and filed under ,


To Generate Service proxy c# classes from WCF endpoint Run:

cd C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin>
svcutil net.tcp://endpoint.svc /out:c:\proxy

To create schema from service contract dll
Run visual studio command prompt as admin:
go to the output folder

Svcutil c:/ServiceContracts.dll /t:metadata

Schema (*.xsd) and (*.wsdl) are generated and then proxy classes can be generated using:
Svcutil *.wsdl *.xsd /language:C#
0
Posted on 5:21 AM by Softminer and filed under

The Dynamic IP Restrictions Extension for IIS provides IT Professionals and Hosters a configurable module that helps mitigate or block Denial of Service Attacks or cracking of passwords through Brute-force by temporarily blocking Internet Protocol (IP) addresses of HTTP clients who follow a pattern that could be conducive to one of such attacks. This module can be configured such that the analysis and blocking could be done at the Web Server or the Web Site level.


http://www.iis.net/downloads/microsoft/dynamic-ip-restrictions



using System;
using System.Collections.Generic;
using System.Timers;
using System.Web;

public partial class _Default : System.Web.UI.Page 
{
    
  private static Dictionary<string, short> _IpAdresses = new Dictionary<string, short>();
  private static Stack<string> _Banned = new Stack<string>();
  private static Timer _Timer = CreateTimer();
  private static Timer _BannedTimer = CreateBanningTimer();

  

  private const int BANNED_REQUESTS = 10;
  private const int REDUCTION_INTERVAL = 1000; // 1 second
  private const int RELEASE_INTERVAL = 5 * 60 * 1000; // 5 minutes

    protected void Page_Load(object sender, EventArgs e)
    {
         string ip = HttpContext.Current.Request.UserHostAddress;
    if (_Banned.Contains(ip))
    {
      HttpContext.Current.Response.StatusCode = 403;
      HttpContext.Current.Response.End();
    }

    CheckIpAddress(ip);
    }

    /// <summary>
    /// Checks the requesting IP address in the collection
    /// and bannes the IP if required.
    /// </summary>
    private static void CheckIpAddress(string ip)
    {
        if (!_IpAdresses.ContainsKey(ip))
        {
            _IpAdresses[ip] = 1;
        }
        else if (_IpAdresses[ip] == BANNED_REQUESTS)
        {
            _Banned.Push(ip);
            _IpAdresses.Remove(ip);
        }
        else
        {
            _IpAdresses[ip]++;
        }
    }

    #region Timers

    /// <summary>
    /// Creates the timer that substract a request
    /// from the _IpAddress dictionary.
    /// </summary>
    private static Timer CreateTimer()
    {
        Timer timer = GetTimer(REDUCTION_INTERVAL);
        timer.Elapsed += new ElapsedEventHandler(TimerElapsed);
        return timer;
    }

    /// <summary>
    /// Creates the timer that removes 1 banned IP address
    /// everytime the timer is elapsed.
    /// </summary>
    /// <returns></returns>
    private static Timer CreateBanningTimer()
    {
        Timer timer = GetTimer(RELEASE_INTERVAL);
        timer.Elapsed += delegate { _Banned.Pop(); };
        return timer;
    }

    /// <summary>
    /// Creates a simple timer instance and starts it.
    /// </summary>
    /// <param name="interval">The interval in milliseconds.</param>
    private static Timer GetTimer(int interval)
    {
        Timer timer = new Timer();
        timer.Interval = interval;
        timer.Start();

        return timer;
    }

    /// <summary>
    /// Substracts a request from each IP address in the collection.
    /// </summary>
    private static void TimerElapsed(object sender, ElapsedEventArgs e)
    {
        foreach (string key in _IpAdresses.Keys)
        {
            _IpAdresses[key]--;
            if (_IpAdresses[key] == 0)
                _IpAdresses.Remove(key);
        }
    }

    #endregion
}