ASP.NET MVC 1.0

ASP.NET MVC 1.0

mvcsource[1] Two weeks ago at MIX we released ASP.NET MVC 1.0.  ASP.NET MVC is a free, fully supported, Microsoft product that enables developers to easily build web applications using a model-view-controller pattern.  ASP.NET MVC provides a “closer to the metal” web programming option for ASP.NET.  It enables full control over HTML markup and URL structure, and facilitates unit testing and a test driven development workflow.

Releasing the ASP.NET MVC source code under MS-PL

I’m excited today to announce that we are also releasing the ASP.NET MVC source code under the Microsoft Public License (MS-PL).  MS-PL is an OSI-approved open source license.  The MS-PL contains no platform restrictions and provides broad rights to modify and redistribute the source code.  You can read the text of the MS-PL at: http://www.opensource.org/licenses/ms-pl.html

Learning more about ASP.NET MVC

To learn more about ASP.NET MVC, you can read my free ASP.NET MVC PDF tutorial that covers building an end-to-end application (starting literally with File->New Project).

There were a number of great ASP.NET MVC talks at MIX this year.  Below are links to several of them:

There are also several great ASP.NET MVC tutorials at http://www.asp.net/mvc.  You can also read the ASP.NET MVC MSDN Documentation.

Download ASP.NET MVC

Click here to download and install ASP.NET MVC 1.0.  You can also install it using the new Microsoft Web Platform Installer V2 – which provides an integrated setup experience for the entire Microsoft web stack.

The ASP.NET MVC 1.0 source code is now available.  Scroll down to the bottom of the ASP.NET MVC download page and you’ll find links to both the ASP.NET MVC 1.0 integrated MSI setup, as well as a .zip file that contains the ASP.NET MVC source code.  The ASP.NET MVC source code includes a VS 2008 project file that enables you to build it.

Hope this helps,

Scott

Comming soon: Tool to build your own queries for MBV

Comming soon: Tool to build your own queries for MBV

Hello,


I create this post just to announce that I will make available very soon a tool to build queries for MBV : MBVQueryBuilder.


Let me explain quickly role of this tool as I will make a more detailed post on that later :



As you noticed, I added already a lot queries embeded in MBV exe but because more and more MBV users, inside or outside Microsoft, suggest me to add some queries in MBV, I decided for a while to change MBV Architecture to be easily extensible in term of queries to add (MBV version 10.12 allow you to add also your own rules).


So it means that MBV accept “custom” queries to be added in its lists of queries via an XML file.


To achieve that, you will just have to use  MBVQueryBuilder tool to create your custom queries with also their rules (warnings they can generate) in a queries repository XML file.
To create a query, you will have to provide some information like its Type (SQL, WMI, BAT, CMD, VBS), Caption, Comment, Target Type (MsgBox db, Mgmt db, ALL BT servers, ALL Biztalk SQL Servers,etc…) , and of course its body (ex: “Select @@ServerName” for a SQL query,  or “Select * from MSBTS_SendPort”  for a BizTalk WMI one)

MBV contain a query execution engine for queries of type SQL, WMI, CMD, .BAT, or VBS so it will automatically execute your queries knowing  just its type and body.


Once you built your repository of queries, you can select in the same tool the specific queries you want to be visible  in MBV and save them in an MBVEXT.XML file.

This file must be put in the same folder than MBV, and when MBV will be started you will see your custom queries in an additional listview in MBV Gui interface, that’s all  !   
you can then select/unselect your queries like for any embeded queries an start a Collect process. and output of your queries will be also visible in the resulting HTML report


To see a concrete sample of this MBV query extensibility, you can have a look on following Thiago’s Post (Thanks Thiago to have shared that) :

http://connectedthoughts.wordpress.com/2009/03/19/extending-msgboxviewer-with-biztalk-message-body-tracking-count-queries/


So stay tuned for availability of  this tool !


JP

The Context Accessor functoid, part I

The Context Accessor functoid, part I

Hi all

At http://social.msdn.microsoft.com/Forums/en-US/biztalkgeneral/thread/ecaa2059-d78e-449f-8eb0-37696847b4b0 there
is a guy who is struggling to get the MessageID into a message inside a map.

I have been trying to help him and have come to a stand still, because I missed a
very important point. The MessageID is “written” and not promoted to the context base.
Therefore, it cannot be read using the functoid found at http://www.codeplex.com/ContextAccessor (The
one used inside an orchestration).

So basically, you can use the functoid to get hold of all the properties that were
promoted into the context, but the ones that were written, you need to get to some
other way.

I have created a small sample that illustrates how to do this inside an orchestration.

It can be downloaded here.

Basically, I have a schema for the input:

Inputschema

It has two fields, and I have promoted the first field.

The output schema looks like this:

OutputSchema

It has four fields.

What I want in the output is this:

  • Field1: The value from Field1 in the source schema. It isn’t to be mapped directly,
    though. I want to demonstrate that the functoid can be used to get values that were
    promoted from a schema.
  • Field2: The value from Field2 in the source schema. Mapped directly
  • MessageID: The Message ID of he input message. Since this isn’t accessible by the
    functoid, I will use a Message Assignment shape to do that
  • ReceivedFileName: Will contain the content of the BTS.ReceivedFileName poperty – by
    using the functoid.

The map looks like this:

Map

I am using the ContextAccessor (for orchestations) to fill a value into Field1 and
ReceivedFileName. I am mapping Field2 directly. The MessageID field I am not mapping,
since I need a message assignment shape for that. The element “MessageID” must be
present in the output, though. Otherwise i cannot fill in value. So, as you can see
in the screenshot, I have set the “Value” property to “<empty>”. This will create
an empty element. This feature is very handy for initializing elements that will later
on get values from message assignment shapes but also for creating the needed empty
fields for demotion.

Anyway, the parameters for the first functoid look like this:

FirstFunctoid

The parameters are:

  1. The name of the message to get the value from.
  2. The name of the property
  3. The name space of the property schema that property exists in.

The second functoid looks like this:

SecondFunctoid

Now, the final touch is the orchestration:

Orchestration

Quite simple A receive, a construct and a send port for the output. The construct
shape has two shapes inside it. The first is a transformation shape hat will execute
the map. The second is a message assignment shape hat will insert the messageid into
the destination schema.

The message assignment shape looks like this:

MesageAssignment

I made the MessageID field of he output a distinguished field and can therefore insert
values into it. This is quite clever . the way you can do several things to a message
as long as you are still inside the same Construct Message shape. After the map, where
I let the MessageID field be empty, I can insert a value into this field using a distinguished
field. I could also just as easily have used XPath to do that, but that is not as
readable, so I didn’t do it.

So This was the first post of two – next time I will look at the receive port version
of the Context Accessor functoid.

And one last point: If the idea i just to get an Id into a message and it doesn’t
have to be the message ID of a message, you can also just use the “New GUID” functoid
found at http://eebiztalkfunctoids.codeplex.com/

—

eliasen

BizTalk: What features we would like to see in future releases

.
BizTalk: What features we would like to see in future releases
After the MVP Summit [http://geekswithblogs.net/LeonidGaneline/archive/2009/03/09/microsoft-global-summit-mvp-most-valuable-professional-2009-pictures.aspx] we, the BizTalk MVPs, have been asked to give feedback to the product team on what features we’d like to see in future releases.
I created the list of features and separated it into parts. One is from the global, crazy things than never be implemented. But why don’t imagine? Second one is from the small things.
Let start from the big, crazy things:
More flexibility in the deployment and licensing.
What I mean:
1) Why don’t move the BizTalk as a product to cheap segment? (cheap? No, let’s talk about bigger)
a) BizTalk + SQL Express on one box. Then creating a farm of the BizTalk applications would be easier. Load Balancing is moved outside, before the farm. Maybe create a separate product the “BizTalk load balancer”?
b) Moreover, ship the preconfigured VHD with BizTalk + SQL Express + Windows Server. With possibility to create the farm from these VHDs. (Not so easy because now we have strict limit to the SQL and BizTalkserver names, and that limit should be fixed anyway.)
2) Why don’t move to the expensive segment?
a) Shift to the Windows HPC? What about this? One time the BizTalk was pioneered as the first enterprise level product by Microsoft, created on .NET. Using the HPC methods to get rid of SQL completely, perform all persistency in memory to get super-low latency product.
3) Reiterate the architecture with all spectrum new Microsoft technologies. Is it possible to extract the MessageEngine, the OrchestrationEngine, and the UnifiedInputOutput Engine to separate products?
4) At last extract the BRE to separate product or free library! Now it is dead. Give BRE a shock treatment.
5) Redesign the error processing for different stages of the message processing. Now there are different approaches are used in many places or nothing at all.
6) Extract the LOB Adapters to separate product on the “buy if you need it” basis or to the free library. Create the Internet store and sell adapters for small money to everyone not only to the buyers of the BizTalk. Sell them not in packages but per adapter.
Nowthe small things:
Many years there were no improvements in very basic things, the things the developers are using in everyday tasks. I mean: adapters: File, SQL; pipelines; schema and map editors; additional shapes in Orchestrations, etc.
1. Adapters:
a. File adapter (for example): add the possibility to use the file names to order delivery (process files in the sorted order, many variations J ); implement the file receive filters with regEx on the file names; add possibility to copy files to other folder after consuming (to make some sort audit/resubmit storage, in forums this question is repeated and repeated, “How we could make a copy of the original files?”)
b. SQL adapter: OMG, there should be many changes in real-time functions and much more improvements in the design-time appearance. I’d prefer to use not the standard Wizard to generate SQL port artifacts but some sort rich-UI window to set up different stages of artifact creation and the real-time parameters.
I am sure the brainstorm by BizTalk MVP should generate a lot of good ideas.
c. Additional adapters: like Task Scheduler; Nope; Fan-out/Garbage (to consume messages without subscribers in the pub/sub application); PowerShell (for additional processing of the input/output messages). Brainstorm this! Buy these adapters from the third-parts, unify them and include to the standard package.
d. Please, make InfoPath integration with BizTalk easy as hell!!!! (Isn’t it a prime purpose of InfoPath??? To integrate the BizTalk with human?)
2. Pipelines (pipeline components): where are? the xml <-> PDF ; zip/unzip ; map (yeah! what is wrong with it?); different coders/decoders; symbol (regex) replacement (for EDI processing it MUST be!); PowerShell (for additional processing of the input/output messages); “create message” pipeline; Excel/Word ; Html ; simple EDI (to very basic EDI processing); promote properties from the text; etc. . Brainstorm this!
3. Add the error processing to the standard interfaces of the custom pipeline components.
4. Transmitting raw/binary data. Frequently we only use the BizTalk to transfer and route the documents (messages) without transformation. Now it is the second-class citizen scenario.
5. Orchestrations: additional shapes as: CreateMessage !!!; throwEvent; Pipeline transformation (?).
Make shapes resizable, otherwise we should use odd methods to make the Orchestration more descriptive. How we could show Orchestration to business people if we cannot add enough text to shapes???? Add color to shapes.
Make the Expression Editor window resizable, dockable, fully InteliSensed, etc. !!!!!!!!!!!!!!!!!!
6. Schema editor: Use the schema node icons for more useful information, definitely, for cardinality (say, different colors for “max occurs = *”, for “min occurs = 0”). Maybe add separate window for the referenced (included) schemas?
7. Map editor: add functoids [IfElse]… Make improvements to the Script functoid!!! Separate to InlineScript; ExternalScript (ExternalMethod?); XsltScript…; make InteliSense to the Inline Script and Xslt script windows. Use the source/target node icons to more usefull information. See http://geekswithblogs.net/LeonidGaneline/archive/2005/12/23/64004.aspx – it is an old list but still actual.
8. Ports: Please, make ports the first-class artifact as an Orch. Why we should use the orchestration assembly just to store the port type??? Why do we use the “logical port” term in Orchestration editor? It is not a port, it is just an endpoint. Orchestration has the endpoints and the Port has the endpoints. My perception it should be big redesign of the “port part” of the BizTalk architecture. Right now it is a mix of adapters, pipelines, maps, etc. without strict regulation, strict design. This mix is very static, could not be used in structured way to improve the development.

The question to us was: 1) What was/is THE GOOD stuff about the area? 2) What is just plain BAD? 3) What is UGLY about the feature area e.g. if you were developing this feature what would you do to improve it.
I am sorry but I used the same words. To me “UGLY” and “BAD” are just synonyms for ”rudimentary implemented” and “implemented in beta version”.
1) Monitoring, operations. Now it is UGLY. No real real-time :). See how it works on HPC Windows, for example.
2) Debugging is plain BAD.
3) BRE is good, but EVERYTHING for development BR, everything is UGLY. Development, testing-debugging (come on, have somebody seen the test text window in Composer? the text inside it????), deploying. BRE now is good, very good to sell the BizTalk to business people, and BRE is just pain in ass for developers. Examples?
http://geekswithblogs.net/LeonidGaneline/archive/2006/12/27/102156.aspx
http://geekswithblogs.net/LeonidGaneline/archive/2006/10/16/94245.aspx
Now as a rule of thumb, I use the BRE for POC projects and never for real projects.
4) To me BAM is kind of partly implemented. Run-time is very good. Design-time is BAD.
5) ESB. IMHO if the BizTalk gets the Web-service (or metadata) repository, it has ALL ESB functionality and could be named ESB to business people. MVPs discussed this many times on the Summit.
6) Of course, low latency must be implemented.

RoleClaimsMapper for the Geneva Framework

Briefly back on my STS work –

Our STS implementation can already replace the authentication implementation of most of our applications; naturally we can’t do that just yet, given that the Geneva-framework has not been released yet, but all of my tests are quite positive so we’re just waiting for the opportunity to start using it.

However, so far, we were not in a position to replace the authorisation mechanism, not easily anyway, and that’s something that was on my list for some time now.

The STS provides a list of claims, which the applications can relatively easily access via code, as many samples show, and this proves very useful; application can investigate various claims about a user and drive their functionality from that.

It does mean, though, that the applications need to change to support this new claims based mode for authorisation, which is not something we can just assume we would be able to do; as a start, we just want to achieve an in-place replacement for our current authorisation logic.

Most of our web apps currently use ASP.net membership and roles and so they extensively use ’IsInRole’ checks to figure out user authorisation and drive the application behaviour, to start with, we had to hook to that mechanism.

Luckily the Geveva framework has a relatively good support for exactly this need – , out of the box, it would convert any claims of the Microsoft role namespace (’http://schemas.microsoft.com/ws/2008/06/identity/claims/role’) to roles; so – if a token included a claim of this type with a value of ’Manager’, a call to HttpContext.Current.User.IsInRole(“Manager”) would return true.

And so I made sure my STS adds any roles with the correct claim type, very easy.

However – this is very Microsoft centric. what about all those claims that come from systems that don’t follow Microsoft’s approach? (how dare they!) ? and what about us wanting to have our own claims, using our own types, some matching roles (while others may not) –

Well – we needed a way to map any claims to ms-role claims before the Geneva framework does its bit.

As is often the case – Dominick Baier was most helpful in posting on exactly that, and so, following his example, I created my RoleClaimsMapper –

    public class RoleClaimMapper : ClaimsAuthenticationManager
    {
        public override IClaimsPrincipal Authenticate(string endpointUri, IClaimsPrincipal incomingPrincipal)
        {
            //load configuration section for component
            RoleClaimsMapperConfigurationSection config = 
                (RoleClaimsMapperConfigurationSection)ConfigurationManager.GetSection("RoleClaimsMapper");
            //create a collection of claim types and populate from configuratoin
            List<string> claimsToMap = new List<string>(config.RoleClaims.Count);
            foreach (RoleClaimConfigurationElement claimElement in config.RoleClaims)
                claimsToMap.Add(claimElement.ClaimType);
                
            //loop on all identities, we really only expect one, but can easily support multiple.
            foreach (IClaimsIdentity identity in incomingPrincipal.Identities)
            {
                //extract the claims that we need to map (matching the configured list of claims)
                IEnumerable<Claim> roleClaims = 
                    identity.Claims.Where<Claim>(c => claimsToMap.Contains(c.ClaimType));
                //now create a role claim (using the MS role claim type) for each claim found; 
                //need to keep this outside claim loop so we don't modify the collection while iterating
                List<Claim> claimsToAdd = new List<Claim>(roleClaims.Count()); 
                foreach (Claim claim in roleClaims)
                    claimsToAdd.Add(new Claim(Microsoft.IdentityModel.Claims.ClaimTypes.Role, claim.Value,claim.ValueType,"local",claim.Issuer));
                //add new claims to current identity
                identity.Claims.AddRange(claimsToAdd);
            }

            return incomingPrincipal;
        }
    }

I then configured my authentication manager with the framework –

<microsoft.identityModel>
    <claimsAuthenticationManager type="RoleClaimMapper,Identity.Utilities" />
  

and added my bit of custom configuration

  <RoleClaimsMapper>
    <RoleClaims>
      <add Type="http://someDomain.com/identity/claims/SomeRole"/>
      <add Type="http://someDomain.com/identity/claims/AnotherRole"/>
    </RoleClaims>
  </RoleClaimsMapper>

As you can see this code would take a list of claim types from configuration, and map all claims of these types to roles, adding them to the identity’s claims collection using the required claim type (leaving the original claim intact), and voila – when the app executes it can check the roles, corresponding to the values supplied in my custom claims using –

HttpContext.Current.User.IsInRole(“[custom claim value"]”);
Very nice indeed!

MIX 09

Two weeks ago we held our MIX conference in Las Vegas.  MIX is my favorite conference of the year – since it nicely integrates development and design topics together in a single event, and is usually accompanied by some pretty cool product announcements.

I gave a first day MIX keynote again this year, and in it I talked about and announced a bunch of new Microsoft web development products.  These included:

My keynote also included a ton of demos and highlighted a bunch of great customers including: StackOverflow, NetFlix, NBC, Bondi Publishing, and KEXP.

Click here to watch the day one MIX keynote online.  Bill Buxton led off the keynote with a great talk about user experience for 20 minutes – I then talked for an hour and 50 minutes after him.

You can also watch all the breakout sessions from MIX online for free here (Greg Duncan has an easy to navigate list of them here as well).

I’ll be doing more in-depth blog posts in the days ahead on many of the technologies we introduced/announced and all the cool things you can do with them. 

Hope this helps,

Scott

Updated “How to maintain and troubleshoot BizTalk Server databases” article

Updated “How to maintain and troubleshoot BizTalk Server databases” article

 
The article on Microsoft support about maintaining and troubleshooting BizTalk Server databases has been reviewed and  updated. It even now applies to BizTalk 2009 databases (although I’m not sure they’ve added too much about 2009 there).  It’s definitely worth checking out if you are involved in maintaining and supporting BizTalk Server databases.
The support page link […]

Preserving white space in BizTalk map

Hi all

Alister Whitford has a question today on the online forums about preserving white
space in a map. He thought that the functionality has changed between BizTalk 2006
and BizTalk 2006 R2. He has done a great job looking into stuff and it appears he
is right. You can check out he thread here: http://social.msdn.microsoft.com/Forums/en-US/biztalkgeneral/thread/7dd28a9b-16b5-4c0e-90db-843caf4689ee where
he also shows how not to preserve white space in R2 and thus have the same functionality
as in 2006 (non-R2).

Hope this helps someone

—

eliasen

“Weird” subscription when dealing with no subscribers found

“Weird” subscription when dealing with no subscribers found

Hi all

Disclaimer: I do NOT encourage the usage of he information in this blog post.
The post is merely about some silly experiment, he results thereof and a conclusion
on it.

So, this friend
of mine (and former colleague) mentions every now and then that he isn’t all that
sure that the “No subscribers found” should be an error but maybe more a warning.
His man argument is, that if I have two subscribers for something, say all incoming
orders are put into an archive file drop and also sent to the ERP system, and the
send port that sends to the ERP system is unenlisted, then no errors will occur in
BizTalk, but from a business point of view, the system is definitely not working.
So the fact that you don’t get the error that indicates something is wrong with routing
is not actually very useful, because parts of the system may be down after all.

Anyway, we were discussing what to do about this in case you just don’t want that
error to occur if no subscribers were found. We came up with two options:

  1. Add a send port that uses Tomas Restrepos /dev/null adapter. you can find it at http://winterdom.com/dev/bts/index.html –
    look for “BizTalk 2006 R2 Null Send
    Adapter”. Using this adapter in the send port will cause everything going through
    the port to magically disappear.
  2. Mostly for fun we came up with the idea to have an orchestration that only as one
    receive shape. This receive shape should receive a message of type System.Xml.XmlDocument
    – since this will let the orchestration receive any message types. Also, it would
    have to be a direct bound port, so the orhestration would get ALL messages that are
    published to the MessageBox, so we would never get the “No subscribers found” error.
    Now, naturally, this solution is extremely silly, since we would fire up an orchestration
    for all published messages. But we started thinking what the subscription would look
    like.

The rest of this post is to explore item 2 above to find out how the subscription
would look like.

To do this, I created four scenarios – just to explain it to you.

The four scenarios are:

  1. An orchestration that receives a message of type ReceiveSchema.xsd and is linked to
    a “Specify Later” port. This is the normal and widely used scenario.
  2. An orchestration that receives a message of type System.Xml.XmlDocument from a “Specify
    Later” port. The common way of receiving binary files or any file without caring about
    what files they are.
  3. An orchestration that receives a message of type ReceiveSchema.xsd and is linked to
    a direct bound port. This is the common way to receive ALL published orders, no matter
    what receive port or orchestration they were published from.
  4. An orchestration that received a message of type System.Xml.XmlDocument and is linked
    to a direct bound port. This is not something I have ever seen used, but this is what
    I want to find out about 🙂

So, to summon up the subscriptions:

Scenario Subsription Description
1

http://schemas.microsoft.com/BizTalk/2003/system-properties.ReceivePortID ==
{C464C9C6-F4BB-4ADF-9322-B2E89E6C8885}  And

http://schemas.microsoft.com/BizTalk/2003/system-properties.MessageType ==
http://ReceiveEverything.ReceiveSchema#ReceiveSchemaRoot

This is the most common subscription. It consists of both a ReceivePortID (Because
the logical port is bound to a physical port) and the message type (Because I am using
a strongly typed message).
2 http://schemas.microsoft.com/BizTalk/2003/system-properties.ReceivePortID ==
{C464C9C6-F4BB-4ADF-9322-B2E89E6C8885}
This subscription is partly like the first one. The ReceivePortID part is the same,
but no message type is specified. This is because I am using System.Xml.XmlDocument
as message type, and this is just a “catch all” message type.
3 http://schemas.microsoft.com/BizTalk/2003/system-properties.MessageType ==
http://ReceiveEverything.ReceiveSchema#ReceiveSchemaRoot
This subscription has the part of the first subscription that was missing from the
second one and it doesn’t have the part that was actually in the second subscription.
This is because I am now using a direct bound port, and therefore the port ID becomes
irrelevant in the subscription. I am using a strongly typed message, though, so the
message type is relevant.
4   Surprised? A completely empty subscription. Kind of makes sense, when you think about
it, since we are using a direct port, so the port ID is irrelevant and we are using
a untyped message, making the message type irrelevant.

Now then As I wrote, it makes sense, but it wasn’t what I was expecting, actually.
With this empty subscription, I STILL get the “No subscribers found” error when I
pick up a message and publish it into the Message Box.

So instead of doing this, I started thinking about what else to do. So I created a
receive port with a receive location and let a message go through it and get suspended.
Looking at the details of the context of the message that was suspended I gor this:

ReceiveLocationSuspended

So I need a subscription that is not empty, but that will make sure my orchestration
gets EVERYTING that is published into the MessageBox. This is done by setting the
filter on he receive shape of my orchestration in scenario 4. The filter will have
to include one of he above properties that is promoted. But looking at them I really
don’t expect a message created inside an orchestration and then sent to the messagebox
to have any of those properties set. So I decided to create a small orchestration
that will simply just send a message to the messagebox. The context of the message
published to the MesageBox looks like this:

OrchesrationSuspended

As you can see, no overlap at all.

So, as I see it, a filter like “BTS.ReceivePortID exists OR BTS.Operation exists”
should do the trick. Now, this subscription works in my small example, but I cannot
guarantee it will work for all scenarios. I can’t think of an example right now where
either the ReceivePortID or the Operation doesn’t exist, but there might be examples.

So Basically, the whole idea about having an orchestration taking in ALL published
messages to avoid errors about no subscribers is REALLY silly and should not be implemented.
And if you choose to do it anyway, please remember that the above filter isn’t guaranteed
to work in all scenarios I was just playing around 🙂

Not sure this will ever help anyone but there goes 🙂

—

eliasen