WCF Load Test

.NET, Tools, VSTS June 16th, 2009

Just published on CodePlex  -WCF Load Test tool.

Project Description from the project home page on CodePlex:

This tool takes a WCF trace file and a WCF client proxy, or a WCF interface contract, and generates a unit test that replays the same sequence of calls found in the trace file. The code generated is easily modifiable so that data variation can be introduced for the purpose of doing performance testing.
The tool generates code for both Visual Studio 2005 and Visual Studio 2008. It also installs a wizard into both editions of Visual Studio for creating the trace and processing it from inside Visual Studio. If both editions are present the tool is installed into both editions. The source code is a Visual Studio 2005 project.

Latest Release June 2009

A new beta was released in June 2009 adding support for ASMX web services. Download it from here.

Features

The tool has the following main features:

  • Replay of captured scenario in a unit test that can be included in a load test.
  • Support for the DataContractSerializer.
  • Support for message contracts.
  • ASMX support (beta)
  • Support for proxies generated using svcutil.
  • Support for clients that create proxies at run time from contract interfaces.
  • Supports calls to multiple services in a single scenario.
  • Supports multiple calls to the same service operation.
  • Filtering by SOAP action of which messages in the trace to replay.
  • Readable and modifiable code is generated.
  • Automatic association of trace message with proxy method (requires all operations to have a unique SOAP action).
  • Support for client and server side traces.
  • A command line tool for processing traces and generating code.
  • Visual Studio 2005/2008 integration (Team Developer, Team Test, Team Suite and for 2008 also Professional)) that can be used instead of the command line tool.

Tags: , ,

DebuggerDisplay Attribute

VSTS June 3rd, 2009

The DebuggerDisplay attribute (System.Diagnostics.DebuggerDisplayAttribute) controls how a class or field is displayed in the debugger variable windows. When a custom object is displayed, the name of the class or the result of ToString() is shown. This can be changed with a DebuggerDisplay attribute.

Look at the following demonstration. I added the DebuggerDisplay attribute:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace DebuggerView
{
    [DebuggerDisplay("User name={UserName} " +
        "& email={EmailAddress}")]
    class User
    {
        public string UserName { get; set; }
        public string EmailAddress { get; set; }
    }

    class Program
    {
        static void Main(string[] args)
        {
            User u = new User()
            {
                UserName = "maor",
                EmailAddress = "maor@example.com"
            };
        }
    }
}

The DebuggerDisplay attribute has a single argument, which is a string to be displayed in the value column for instances of the type. This string can contain braces ({ and }). Text within a pair of braces will be evaluated as a field, property or method.

And the result is:

DebuggerDisplay

Tags: ,

New Version of Windows Azure Tools for Microsoft Visual Studio

Cloud Computing May 29th, 2009

Windows Azure Tools for Microsoft Visual  Studio extend Visual Studio 2008 and Visual Studio 2010 Beta 1 to enable the creation, building, debugging, running and packaging of Visual Studioscalable web applications and services on Windows Azure. Installation includes the Windows Azure SDK.

New for the May 2009 CTP:

  • Support for Visual Studio 2010 Beta 1
  • Update for Visual Studio 2008
  • Improved integration with the Development Fabric and Storage services to improve the reliability of debug and run of Cloud Services from Visual Studio
  • Enhanced robustness and stability

Windows Azure Tools for Microsoft Visual Studio includes:

  • C# and VB Project Templates for building Cloud Services
  • Tools to change the Service Role configuration
  • Integrated local development via the Development Fabric and Development Storage services
  • Debugging Cloud Service Roles running in the Development Fabric
  • Building and packaging of Cloud Service Packages
  • Browsing to the Azure Services Developer Portal
  • SSL Certificate selection

 

Download here

Tags:

Visual Studio 2010 Beta 1 is Available for MSDN Subscribers

Team System 2010 May 18th, 2009

Visual Stusio

Download it…

Tags:

Windows Azure Management Tool – MMC

Cloud Computing May 18th, 2009

Just released – Windows Azure MMC. The  Windows Azure Management Tool was created to manage your storage accounts in Windows Azure. Developed as a managed MMC, the tool allows you to create and manage both blobs and queues. Easily create and manage containers, blobs, and permissions. Add and remove queues, inspect or add messages or empty queues as well.

Windows Azure MMC

Features

The Windows Azure MMC makes it easy to work with your storage accounts. Here are just some of the features:

  • Manage multiple storage accounts
  • Easily switch between remote and local storage services
  • Manage your blobs
    • Create containers and manage permissions
    • Upload files or even entire folders
    • Read metadata or preview the blob contents
  • Manage your queues
    • Create new queues
    • Monitor queues
    • Read (peek) messages
    • Post new messages to the queue
    • Purge queues

Known Issues

  • The current release does not work with Windows 7 due to a bug in the RC version of PowerShell. Other OS versions should be unaffected.

Tags:

Azure .NET Services – A Twitter Service Bus

Cloud Computing April 29th, 2009

In this post I’ll demonstrate how to use the Microsoft .NET Services Service Bus and the .NET Service Bus NetTcpRelayBinding. The post based on the Echo sample in Azure SDK for .NET Services (March 2009 CTP).

What is a .NET Service Bus? it provides a relay service that makes it possible to establish connectivity through the cloud across organizational boundaries. This crucial infrastructure allows cloud-based workflows to communicate with on-premise applications by traversing firewalls and NAT devices.

The sample shows a simple service and client that communicate through the Service Bus. When the service application is started, it asks for your .NET Services Solution Credentials and opens an endpoint on the Service Bus. Once opened, this endpoint has a well-known URI on the Service Bus and is, irrespective of whether your machine is residing behind a Firewall or Network Address Translation, reachable from anywhere.

Configuring the Service

You configure the .NET Access Control Service through the administration portal provided within a particular solution. This is where you configure the rules that determine how it will issue claims for the users it knows about or as a result of transforming claims from other providers.

When using the .NET Service Bus, you’ll configure endpoints that use this Service Bus scope as the base URI (yours will be customized to your account, of course). Every solution comes preconfigured with a set of access control rules for both the .NET Service Bus and the .NET Workflow Service.

 

The Contract

Our service implements very simple contract that works as a Twitter wrapper. Currently there is only one method – CheckIfUserFollowMe that checks if a user follows you. (You can download the code and add other operations to the contract).

[ServiceContract(Name = "ITwitterContract", Namespace = "http://samples.maordavid.com/ServiceModel/Relay/")]
public interface ITwitterContract
{
    [OperationContract]
    bool CheckIfUserFollowMe(string user,string password,string friendScreenName);
}
public interface ITwitterChannel : ITwitterContract, IClientChannel { }

The Service

The service configuration file:

<configuration>
  <system.serviceModel>
    <services>
      <!-- Application Service -->
      <service name="Blog.MaorDavid.Samples.TwitterService">
        <endpoint contract="Blog.MaorDavid.Samples.ITwitterContract"
                  binding="netTcpRelayBinding" />
      </service>
    </services>
  </system.serviceModel>
</configuration>

The configuration file is just like any other WCF configuration file with the exception that configured service endpoint refers a "netTcpRelayBinding", which isn’t part of the .NET Framework. The NetTcpRelayBinding is one of the new bindings introduced with the Service Bus.

In order to hook a listening service into the Service Bus, the Service Bus service needs to be able to verify that the owner of the listening service is authorized to do so.

Authentication and authorization are both performed by the Microsoft .NET Services Access Control Service. In order to make these steps simple, the Microsoft.ServiceBus Framework contains a set of transport client credential helpers that automatically deal acquiring required security tokens.

// create the endpoint address in the solution's namespace
Uri address = ServiceBusEnvironment.CreateServiceUri("sb", solutionName, "TwitterService");

// create the credentials object for the endpoint
TransportClientEndpointBehavior userNamePasswordServiceBusCredential = new TransportClientEndpointBehavior();
userNamePasswordServiceBusCredential.CredentialType = TransportClientCredentialType.UserNamePassword;
userNamePasswordServiceBusCredential.Credentials.UserName.UserName = solutionName;
userNamePasswordServiceBusCredential.Credentials.UserName.Password = solutionPassword;

// create the service host reading the configuration
ServiceHost host = new ServiceHost(typeof(TwitterService), address);

// add the Service Bus credentials to all endpoints specified in configuration
foreach (ServiceEndpoint endpoint in host.Description.Endpoints)
{
    endpoint.Behaviors.Add(userNamePasswordServiceBusCredential);
}

// open the service
host.Open();

Console.WriteLine("Service address: " + address);
Console.WriteLine("Press [Enter] to exit");
Console.ReadLine();

// close the service
host.Close();

The credential used in this example is a simple Username/Password credential that is backed by the Solution credentials you set up when signing up for Microsoft .NET Services. Each Microsoft .NET Services solution automatically owns a branch of the Service Bus global namespace. "Your" Solution namespace branch is rooted at

[scheme]://solution-name.servicebus.windows.net/

whereby [scheme] is either "sb" (as in this example) or "http" or "https". The namespace owner can subdivide that namespace and organize services onto that namespace as needed and define rules in the Access Control Service to guard access to branches of the namespace.

When I run the host application, the WCF hosting infrastructure automatically authenticates with the .NET Access Control Service, acquires claims, and then opens an outbound port to the .NET Service Bus and registers a listener on the specified address. At that point, the locally hosted service will be ready to receive messages relayed through the .NET Service Bus on the specified address. I can also browse to the base address of the solution at this point to access the service registry feed and any active listener endpoints will appear in the feed.

The Client

The client configuration file will need to look just like the host configuration file. Only the endpoint definition will need to appear within the <client> section.

<configuration>
  <system.serviceModel>
    <client>
      <!-- Application Endpoint -->
      <endpoint name="RelayEndpoint"
                contract="Blog.MaorDavid.Samples.ITwitterContract"
                binding="netTcpRelayBinding"/>
    </client>

  </system.serviceModel>
</configuration>

When started, it asks for the Solution credentials, creates a channel to the Service and sends requests to the service.

// create the service URI based on the solution name
Uri serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", solutionName, "TwitterService");

// create the credentials object for the endpoint
TransportClientEndpointBehavior userNamePasswordServiceBusCredential = new TransportClientEndpointBehavior();
userNamePasswordServiceBusCredential.CredentialType = TransportClientCredentialType.UserNamePassword;
userNamePasswordServiceBusCredential.Credentials.UserName.UserName = solutionName;
userNamePasswordServiceBusCredential.Credentials.UserName.Password = solutionPassword;

// create the channel factory loading the configuration
ChannelFactory<ITwitterChannel> channelFactory = new ChannelFactory<ITwitterChannel>("RelayEndpoint", new EndpointAddress(serviceUri));

// apply the Service Bus credentials
channelFactory.Endpoint.Behaviors.Add(userNamePasswordServiceBusCredential);

// create and open the client channel
ITwitterChannel channel = channelFactory.CreateChannel();
channel.Open();

Console.WriteLine("Welcome to the Twitter Client. To check if your friend is following you, please follow the instructions below;");
Console.WriteLine("Enter your Twitter user name:");
string twitterUserName = Console.ReadLine();
Console.WriteLine("Enter your Twitter password:");
string twitterPassword = MicrosoftSDKUtilities.ReadPassword();
Console.WriteLine("Enter your friend's Twitter user name:");
string friendTwitterUserName = Console.ReadLine();
try
{
    bool follow = channel.CheckIfUserFollowMe(twitterUserName, twitterPassword,friendTwitterUserName);
    if(follow)
        Console.WriteLine("Yes! You & {0} are friends!", friendTwitterUserName);
    else
        Console.WriteLine("Sorry...{0} doesn't follow you -:(", friendTwitterUserName);

}
catch (Exception e)
{
    Console.WriteLine("Error: " + e.Message);
}
Console.ReadLine();

channel.Close();
channelFactory.Close();

You can download the sample:

And this is what we get:

twitterSB

Enjoy!

Share this post :

Tags: ,

ASP.NET MVC 1.0 Released

Web March 25th, 2009

ASP.NET MVC 1.0 RTW (Release To Web) is now officially released. You can download it right now here.  Also check out Phil Haack’s post on the release.

MSDN Documentation for MVC is also now available at the following link http://go.microsoft.com/fwlink/?LinkId=145989

Tags:

Web Platform Installer 2.0 Beta and Windows Web Application Gallery

Web March 24th, 2009

Last week we launched the Windows Web Application Gallery, a catalog of the most popular Web applications that ALL run on Windows.   main-img

The Windows Web Application Gallery is a community hub of free and popular .NET and PHP applications for you to use for creating dynamic web solutions.

Features include:

  • Simple install of the application through the Web Platform Installer
  • Rate and Comment on Applications
  • Sort by Most Popular, Highest Rated, Latest
  • Filter by Category
  • Submit your own Web Applications
  • Strategic part of increasing our NextWeb goals around server share

The Microsoft Web Platform is our vision to deliver the best platform to developers for building their Web applications. Microsoft is committed to delivering the platform, tools, and applications that development organizations, communities, and developers need and value; with the long-term idea of supporting a lucrative market to benefit developers and end-users. The Microsoft Platform is designed to interoperate with both ASP.NET and PHP, and integrate easily with community applications and products in the market today.

 

get_microsoft_web_platform_3

Tags:

Silverlight 3 Beta

Web March 21st, 2009

Silverlight 3 Beta was unveiled at MIX09. logo

It is a preview release which  continues Silverlight’s track record of rapid innovation – introducing more than 50 new features, including support for running Silverlight applications out of the browser, dramatic video performance and quality improvements, and features that radically improve developer productivity.

To get started, you’ll first want to download the tools to make Silverlight 3 Beta development productive for you.

  • Silverlight 3 Beta Tools for Visual Studio – this will install the developer runtime of Silverlight 3 Beta, the Visual Studio project templates and the Silverlight 3 Beta SDK
  • Silverlight 3 Beta developer runtimes: Windows or Mac.  If you installed the tools above, you will get the developer runtime and there is no need to install it again.  These downloads are being made available for test machines for the Windows and Mac platforms for your applications.
  • Microsoft Expression Blend 3 Preview – this is the preview version of Expression Blend that will enable authoring of Silverlight 3 Beta applications.
  • Silverlight Toolkit – the toolkit has been updated to provide an updated to Silverlight 2 controls, a new release for Silverlight 3 Beta controls, and a new themes gallery.  All of these can be downloaded at the Silverlight Toolkit CodePlex project site.
  • .NET RIA Services – Microsoft .NET RIA Services simplifies the traditional n-tier application pattern by bringing together the ASP.NET and Silverlight platforms. The RIA Services provides a pattern to write application logic that runs on the mid-tier and controls access to data for queries, changes and custom operations. 
  • Silverlight 3 Beta Documentation – to view the Silverlight 3 Beta documentation you can view it online or download an offline CHM help file.

Tags:

March Meeting – Web and Load Test

Team System, VSTS March 18th, 2009

This month we had a testing specialist at the podium, Shai Raiten attracted over 50 listeners with a well built lecture and fascinating demos about Visual Studio Team System web testing. The original plan was to dedicate one lecture to web testing and the other one to load testing, but since the there was a lot of interaction with the audience and a lot of discussions we’ve decided to go with the flow and dedicate the entire meeting to web testing. Shai will join us again on April (exact date will be pubished here and on MS-Event feed) and will present some web testing left-overs and a Load session

For the presentation, code examples and much more pls see Shai’s blog

Tags: , , , , , ,