Click here to Skip to main content
15,894,405 members
Articles / DevOps / Load Testing

VirtualService for ESB

Rate me:
Please Sign up or sign in to vote.
4.90/5 (32 votes)
19 Feb 2008CPOL37 min read 96.9K   1.2K   98  
This article describes the design, implementation, and usage of VirtualService for the Enterprise Service Bus, using the Microsoft .NET FX 3.5 technology.
using System;
using System.Diagnostics;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using RKiss.ESB;
using Contract;

namespace Client
{
    class Program
    {
        static void Main(string[] args)
        {
           

            for (int ii = 0; ii < 100000; ii++)
            {
                Console.WriteLine("Press any key to continue ...");
                //Thread.Sleep(500);
                //Console.Read();

                ChannelFactory<ITest> factory = null;
                try
                {
                    factory = new ChannelFactory<ITest>("test");
                    ITest channel = factory.CreateChannel();
                    string respond = channel.Ping3("Loop", Convert.ToString(ii));
                    //string respond = channel.Ping3(Convert.ToString(ii));
                    factory.Close();
                    Console.WriteLine("Test: #{0}", ii);
                }
                catch (Exception ex)
                {
                    if (factory != null) factory.Abort();

                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\n" + (ex.InnerException == null ? ex.Message : ex.InnerException.Message));
                    Console.ResetColor();

                    Thread.Sleep(500);
                }
            }

        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions