Announced today at Sibos 2009: Financial Messaging Services Bus

Wow. I have a little flurry of blog posts coming. This one’s first because this is breaking news.

Microsoft is participating at the Sibos 2009 conference in Hong Kong this week (http://www.microsoft.com/industry/financialservices/events/sibos.mspx). Sibos is the financial industry’s premier global financial services forum. What’s exciting to me about this is that this is the first public announcement, I think, of the Financial Messaging Service Bus (http://finance.yahoo.com/news/Microsoft-Announces-prnews-675925966.html?x=0&.v=1&.pf=taxes&mod=pf-taxes).

To quote from that post: “The Financial Messaging Service Bus cuts the cost of development, and speeds up the implementation process by providing reusable service-oriented architecture (SOA) components to simplify financial messaging integration”

From an implementation standpoint, this is a convergence of BizTalk Server 2009, ESB Toolkit 2.0 and the SWIFT support you get with BizTalk, along the way leveraging Business Activity Monitoring, the Business Rules Engine, and other parts of the stack. I had the opportunity to get an early look at some of this work, and I can tell you that it’s VERY impressive.

If you’re doing financial messaging, or working with clients that are, this is something you want to keep on your radar. I know I will be.

Announcing the Microsoft AJAX CDN

Announcing the Microsoft AJAX CDN

Earlier today the ASP.NET team launched a new Microsoft Ajax CDN (Content Delivery Network) service that provides caching support for AJAX libraries (including jQuery and ASP.NET AJAX).  The service is available for free, does not require any registration, and can be used for both commercial and non-commercial purposes.

What does a CDN provide?

Content delivery networks (CDNs) are composed of "edge cache" servers that are strategically placed around the world at key Internet network points.  These "edge cache" servers can be used to cache and deliver all types of content – including images, videos, CSS and JavaScript files.

Using a CDN can significantly improve a website’s end-user performance, since it enables browsers to more quickly retrieve and download content.  For example, instead of having a browser request for an image traverse all the way across the Internet to your web server to download, a CDN can instead serve the request directly from a nearby "edge cache" server that might only be a single network hop away from your customer (making it return much faster – which makes your pages load quicker). 

What does the Microsoft AJAX CDN provide?

The Microsoft AJAX CDN makes it really easy to add the jQuery and ASP.NET AJAX script libraries to your web sites, and have them be automatically served from one of our thousands of geo-located edge-cache servers around the world. 

For example, if you want to use jQuery from the Microsoft AJAX CDN then you can simply add a standard script tag to your page using the URL below:

   <script src="http://ajax.microsoft.com/ajax/jquery-1.3.2.min.js" type="text/javascript"></script>   

When the browser requests the script file it will be automatically served by the CDN "edge cache" server that is closest to the end-user.  This means:

  • The request will be processed much faster than if it had to hit your web-server (making the end-user’s page load much faster)
  • You don’t have to pay for the bandwidth of this file – since the file comes from our server we pay the bandwidth cost (saving you money)
  • The script can be easily cached across multiple web-sites – which means it might not even need to be downloaded if the user has already hit a web-site that requested the file (and as such has it already in the browser’s cache). 

You can get a full listing of the JavaScript libraries (and associated URLs) we already have loaded in our CDN cache here: www.asp.net/ajax/cdn 

We’ll update the available libraries in the CDN as we ship new versions of ASP.NET AJAX, and continue to update it to include all of the JavaScript files we ship with ASP.NET and Visual Studio (including jQuery, the jQuery Validation plugin, and additional libraries we ship in the future). 

The CDN service is free and available for anyone in the community to use for both commercial and non-commercial purposes.  You do not need to register to take advantage of it.

Using the Microsoft AJAX CDN with the ASP.NET 4.0 ScriptManager

In addition to allowing you to reference script files directly using a <script> element, ASP.NET 4.0 will make it easy to use the CDN from ASP.NET Web Forms applications that use the <asp:scriptmanager/> server control. 

The ASP.NET 4.0 <asp:ScriptManager> control includes a new property named EnableCdn. When you assign the value true to this property, your application will use the Microsoft CDN to request JavaScript files automatically:

scriptmanager

When you enable the CDN with the ScriptManager, your application will retrieve all JavaScript files that it normally retrieves from the System.Web.dll or System.Web.Extensions.dll assemblies from the CDN instead.  This includes both the JavaScript files within ASP.NET AJAX, as well as the built-in Web Forms JavaScript files (for example: the WebUIValidation.js file for client-side validation, and the JavaScript files for controls like TreeView, Menu, etc).

This provides a nice end-user performance improvement, and means that users accessing your ASP.NET website won’t need to re-download these files if they have visited another ASP.NET website that uses the CDN.

Using ASP.NET AJAX Preview 5 from the CDN

In addition to launching the AJAX CDN site, the ASP.NET team has also recently released ASP.NET AJAX Preview 5. You can download ASP.NET AJAX Preview 5 (with sample code) from CodePlex: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=32770

You can also now use the ASP.NET AJAX libraries simply by adding the following script tags that point at the CDN:

    <script src="http://ajax.microsoft.com/ajax/beta/0909/MicrosoftAjax.js" type="text/javascript"></script>

    <script src="http://ajax.microsoft.com/ajax/beta/0909/MicrosoftAjaxTemplates.js" type="text/javascript"></script>

These script tags reference the beta version of the September 2009 release of the ASP.NET AJAX library (the /0909/ part of the URL represents the year and month that the version of ASP.NET AJAX was released). 

After you add script tags that reference the ASP.NET AJAX library, you can start using the library in your page. For example, the following code attaches a client DataView control that represents an array of photos to a DIV element in the body of the page.

data 

The DIV element – with an id of "photos" – contains a template for formatting each photo in the array of photos. Here’s how the photos element is declared:

template

When the DataView is rendered, the contents of the photos DIV element is rendered for each photo in the array of photos. The following photos are displayed:

photos

Because ASP.NET AJAX is a pure JavaScript library, the code above works perfectly well in an ASP.NET Web Forms, ASP.NET MVC, HTML, or even with classic Active Server Pages. The code also works with all modern browsers.

You can learn more about ASP.NET AJAX Preview 5 by downloading the sample code from the CodePlex project: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=32770

Below are several blog posts that delve into the features of ASP.NET AJAX Preview 5 in more depth:

  • How the DataContext can change your data and your life (well, sort of, but not really) – Jonathan Carter has a great series of posts that dive into the details of the Ajax DataView and DataContext.

    Summary

    The Microsoft Ajax CDN enables you to significantly improve the performance of ASP.NET Web Forms and ASP.NET MVC applications that use ASP.NET AJAX or jQuery.  The service is available for free, does not require any registration, and can be used for both commercial and non-commercial purposes.

    ASP.NET 4.0 will make it especially easy for ASP.NET Web Forms developers to take advantage of the CDN. By setting one property of the ScriptManager control, you will be able to redirect all requests for the built-in ASP.NET JavaScript files to the CDN and improve the performance of your Web Forms applications.

    Hope this helps,

    Scott

    P.S. In addition to blogging, I have been using Twitter more recently to-do quick posts and share links.  You can follow me on Twitter at: http://www.twitter.com/scottgu (@scottgu is my twitter name)

    WCF Personalization Provider for ASP.NET

    [Source: http://geekswithblogs.net/EltonStoneman]

    The ASP.NET Web Part framework uses a plug-in framework for loading and saving personalization data to a persistent source. Out of the box, a SQL Server data source is provided (via the aspnet_regsql tool), along with a SQL personalization provider – specified in the system.web configuration section:

    <webParts enableExport=true>

    <personalization defaultProvider=SqlPersonalizationProvider>

    <providers>

    <add name=SqlPersonalizationProvider

    type=System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider

    connectionStringName=local

    applicationName=WcfPersonalizationSample />

    It’s painless to set up and gets you running Web Part-enabled sites quickly. But if your Web servers and database servers are separated by a physical boundary with app servers in between, you can’t use the SQL provider directly from the ASP.NET application and will need to write a custom personalization provider.

    Exposing the existing SQL personalization store through a custom WCF provider is a straightforward option – so your app server hosts a WCF service itself uses the SQL personalization provider, and the Web server uses the WCF service through the custom provider. Although the implementation is fairly trivial, there are a couple of issues to work around:

    • PersonalizationProvider is an abstract class which requires you to implement methods with out and ref parameters. You’ll need to write methods with different signatures to work over WCF;
    • SqlPersonalizationProvider has methods for loading personalization data as byte arrays, which are useful for the WCF service. To access them you’ll need another custom provider which inherits from SqlPersonalizationProvider, as the underlying methods are protected.

    I’ve worked this through as a sample on MSDN Code Gallery: WCF Personalization Provider Sample.

    To use it, the WCF service host needs to be configured to use the custom provider which wraps the SQL store, and a connection string entry for the data store:

    <connectionStrings>

    <add name=local

    connectionString=Data Source=.;Initial Catalog=WcfPersonalizationSample;Integrated Security=True

    providerName=System.Data.SqlClient />

    </connectionStrings>

    <system.web>

    <webParts enableExport=true>

    <personalization defaultProvider=PersonalizationServiceProvider>

    <providers>

    <add name=PersonalizationServiceProvider

    type=WcfPersonalizationProvider.PersonalizationServiceProvider

    connectionStringName=local

    applicationName=WcfPersonalizationSample />

    </providers>

    </personalization>

    </webParts>

    (Note that this is using ASP.NET functionality in the WCF service, but you do not need to set the WCF service up for ASP.NET compatibility mode.)

    The Web site need to be configured to use the custom provider which accesses the WCF service, and a service client entry for the WCF service:

    <webParts enableExport=true>

    <personalization defaultProvider=WcfPersonalizationProvider>

    <providers>

    <add name=WcfPersonalizationProvider

    type=WcfPersonalizationSample.ServiceClient.WcfPersonalizationProvider

    applicationName=WcfPersonalizationSample />

    </providers>

    </personalization>

    </webParts>

    <client>

    <endpoint address=http://localhost/PersonalizationService.svc

    binding=basicHttpBinding

    contract=PersonalizationService.IPersonalizationService

    name=BasicHttpBinding_IPersonalizationService />

    </client>

    And your Web Part personalization, for shared and user scopes, will work without the Web servers accessing the database.

    SQL Azure Setup Screenshots

    SQL Azure Setup Screenshots

    Finally got my SQL Azure invite code, and started poking around and figured I’d capture a few screenshots for folks who haven’t gotten in there yet.
    Once I plugged in my invitation code, I saw a new “project” listed in the console.

    If I choose to “Manage” my project, I see my administrator name, zone, and server. […]

    Auto-Start ASP.NET Applications (VS 2010 and .NET 4.0 Series)

    This is the seventh in a series of blog posts I’m doing on the upcoming VS 2010 and .NET 4 release.

    I’m going to switch from discussing new VS 2010 tooling features and instead do a few posts covering a few new runtime features (don’t worry – I’ll come back to a lot more VS features, I’m just trying to mix things up a bit).

    Today’s post covers a small, but nice, new feature that you can now optionally take advantage of with ASP.NET 4 – the ability to automatically startup and proactively initialize a web application without having to wait for an external client to hit the web server.  This can help you provide a faster response experience for the first user who hits the server, and avoids you having to write custom scripts to “warm up” the server and get any data caches ready.  It works with all types of ASP.NET applications – including both ASP.NET Web Forms and ASP.NET MVC based applications.

    Auto-Start Web Applications with ASP.NET 4

    Some web applications need to load large amounts of data, or perform expensive initialization processing, before they are ready to process requests.  Developers using ASP.NET today often do this work using the “Application_Start” event handler within the Global.asax file of an application (which fires the first time a request executes).  They then either devise custom scripts to send fake requests to the application to periodically “wake it up” and execute this code before a customer hits it, or simply cause the unfortunate first customer that accesses the application to wait while this logic finishes before processing the request (which can lead to a long delay for them).

    ASP.NET 4 ships with a new feature called “auto-start” that better addresses this scenario, and is available when ASP.NET 4 runs on IIS 7.5 (which ships with Windows 7 and Windows Server 2008 R2).  The auto-start feature provides a controlled approach for starting up an application worker process, initializing an ASP.NET application, and then accepting HTTP requests.

    Configuring an ASP.NET 4 Application to Auto-Start

    To use the ASP.NET 4 auto-start feature, you first configure the IIS “application pool” worker process that the application runs within to automatically startup when the web-server first loads.  You can do this by opening up the IIS 7.5 applicationHost.config file (C:\Windows\System32\inetsrv\config\applicationHost.config) and by adding a startMode=”AlwaysRunning” attribute to the appropriate <applicationPools> entry:

    <applicationPools>

         <add name="MyAppWorkerProcess" managedRuntimeVersion="v4.0" startMode="AlwaysRunning" />

    </applicationPools>

    If you load up the Windows task manager, click the “show processes from all users” checkbox, and then hit save on a startMode attribute change to the applicationHost.config file, you’ll see a new “w3wp.exe” worker process immediately startup as soon as the file is saved.

    A single IIS application pool worker process can host multiple ASP.NET applications.  You can specify which applications you want to have automatically start when the worker process loads by adding a serviceAutoStartEnabled="true" attribute on their <application> configuration entry:

    <sites>

         <site name="MySite" id="1">

              <application path="/" serviceAutoStartEnabled="true" serviceAutoStartProvider="PreWarmMyCache" />

         </site>

    </sites>

    <serviceAutoStartProviders>

         <add name="PreWarmMyCache" type="PreWarmCache, MyAssembly" />

    </serviceAutoStartProviders>

    The serviceAutoProvider="PreWarmMyCache" attribute above references a provider entry within the config file that enables you to configure a custom class that can be used to encapsulate any "warming up" logic for the application.  This class will be automatically invoked as soon as the worker process and application are preloaded (before any external web requests are received), and can be used to execute any initialization or cache loading logic you want to run before requests are received and processed:

    public class PreWarmCache : System.Web.Hosting.IProcessHostPreloadClient {

        public void Preload(string[] parameters) {

            // Perform initialization and cache loading logic here…

        }

    }

    IIS will start the application in a state during which it will not accept requests until your "warming up" logic has completed.  After your initialization code runs in the Preload method and the method returns, the ASP.NET application will be marked as ready to process requests. 

    You can optionally combine the new auto-start "warming up" feature with the load-balancing capabilities of the IIS7 Application Request Routing (ARR) extension, and use it to signal to a load-balancer once the application is initialized and ready to accept HTTP traffic – at which point the server can be brought into the web farm to process requests.

    Summary

    The new "auto start" feature of ASP.NET 4 and IIS 7.5 provides a well-defined approach that allows you to perform expensive application startup and pre-cache logic that can run before any end-users hit your application.  This enables you to have your application "warmed up" and ready from the very beginning, and deliver a consistent high performance experience.

    Hope this helps,

    Scott

    P.S. In addition to blogging, I have been using Twitter more recently to-do quick posts and share links.  You can follow me on Twitter at: http://www.twitter.com/scottgu (@scottgu is my twitter name)

    CloudCasts Behind the Scenes Part 1 – Development and Deployment

    I’ve just published a “Behind the Scenes” webcasts on CloudCasts. It’s the first in a series of webcasts that will look at the project and how it is developed, tested, and hosted in Windows Azure.
    In this webcast I’ll run through the deployment of a new version of the CloudCasts website. I’ll start by showing the project structure and how I have configures the application to use local or cloud based storage in the development phase. I’ll give you a few tips on hosting your Azure applications in IIS to speed up development. I’ll then run through the deployment of the new version of the site to a staging environment, and finally taking it into production.
    The webcast is here.