by community-syndication | Jul 6, 2009 | BizTalk Community Blogs via Syndication
Hi all
So, yesterday I had to loop through all properties on a message inside a pipeline
component.
When you program a general pipeline component, you get an Execute method that looks
like this:
public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
Now, in order to loop through the properties, the common solution is like this (and
you can find this in many many blog posts around the great internet):
for (int i = 0; i <= pInMsg.CountProperties; i++)
{
string name;
string ns;
object value = pInMsg.Context.ReadAt(i, out name, out ns);
// Do something with the vale, name and namespace
}
Now, this is quite all right as it is, but there is one small pitfall that I don’t
think most people realize; The CountProperties property is a uint, meaning that it
can contain values up to 2^32 = 4294967296. Unfortunately, the first parameter to
the ReadAt method is an int, which only holds values up to (2^31) – 1 = 2147483647.
So, if there are, say 3000000000 properties, then the CountProperties property will
return the correct number of properties, but there is no way of calling the ReadAt
method to get the property.
This is kind of silly.
Now, to be fair, I think that the most properties I have seen on a message ever may
have been around 40-50 properties. So there is a looooong way to 2 billion properties
🙂 So in real life, I don’t expect anyone to run into this limitation – if you do,
I’ll buy you a beer! 🙂
BUT, just to be sure, what you should do to be absolutely correct in your code is
this:
uint counter = pInMsg.CountProperties;
string name;
string ns;
if (counter > int.MaxValue)
{
counter = int.MaxValue;
}
for (int i = 0; i < counter; i++)
{
object value = pInMsg.Context.ReadAt(i, out name, out ns);
// Do something with the vale, name and namespace
}
And then, off course, you should somehow notify someone that there were more properties
than you could handle – like a Debug statement, an error in the eventlog or the such
perhaps even throw an exception BEFORE trying to enumerate the properties, sine it
would be useless, the result you get.
Anyway hope this is somehow a help to someone not sure how, though 🙂
—
eliasen
by community-syndication | Jul 6, 2009 | BizTalk Community Blogs via Syndication
I’ve just added a few webcasts to Cloud TV:
%u00b7 WCF – Windows Authentication
%u00b7 Transactions and Compensation
%u00b7 Creating a Highly Available BTS 09 Environment
%u00b7 All you need to know about the SAP Adapter
%u00b7 All you need to know about the SQL Adapter
Thanks to Mick Badran and the other “Light and Easy” BizTalk guys.
The site is here.
Please let me know via the contact form if you have any webcasts you would like me to add.
by community-syndication | Jul 6, 2009 | BizTalk Community Blogs via Syndication
Background
EPiServer implements standard provider functionality for role and membership access through the ASP.NET framework. The most common membership- and role provider is the SQL provider….
Daniel Berg’s blog about ASP.NET, EPiServer, SharePoint, BizTalk
by community-syndication | Jul 5, 2009 | BizTalk Community Blogs via Syndication
=======================================================================
IMPORTANT: this is my old blog and is not being updated anymore.
For my new site/blog/RSS, please visit http://blog.brianloesgen.com
=======================================================================
by community-syndication | Jul 5, 2009 | BizTalk Community Blogs via Syndication
It looks as though the VirtualBox Team have added a nice new feature in their 3.0 release – the full-screen toolbar!
When running a VM in full-screen mode, moving your mouse to the bottom of the screen displays the new toolbar, as shown below.
All of the features available when running the VM in windowed mode are […]
by community-syndication | Jul 4, 2009 | BizTalk Community Blogs via Syndication
Ive just been working on upgrading the build generator to support BizTalk 2009 projects. While doing this one of the things i wish to do is to change the compile step to use MsBuild rather than dev env.
I found a little issue which others who use MsBuild may come across when migrating custom scripts.
Previously for BizTalk 2006R2 scripts I used to use the below command:
<Exec Command='”$(DevEnvPath)” $(SolutionName) /Build $(ConfigurationName)’ />
This would compile the whole solution using devenv.
I changed the script to the following:
<MSBuild Projects =”$(SolutionPath)” Properties=”Configuration=$(ConfigurationName);” />
and also changed the property on the project to use ToolsVersion=”3.5″
This is how I expected the build to need to be and it would mean our script would take advantage of using the MsBuild task inline. When I ran the script I get the following error:
“Solution file error MSB5014: File format version is not recognized. MSBuild can only read solution files between versions 7.0 and 9.0, inclusive”
My initial thoughts made me think this was more complicated than it actually was. I was looking at using the Exec command rather than the MsBuild task for the compile which I could get to work. Then suddenly the answer hit me.
The problem was that I forgot that the .cmd file I use to call the MsBuild file was configured to use the v2.0 version of MsBuild rather than 3.5. As soon as I corrected this it worked fine.
So if you have the above error remember to double check the original call to start your build script wether it be from TFS/Cruise Controlor a custom file etc.
by community-syndication | Jul 4, 2009 | BizTalk Community Blogs via Syndication
I’ve been looking with Windows Azure for a months now, and thought it would be about time to launch my own Azure hosted site.
Cloud TV is a community based website for hosting webcasts relating to Microsoft technologies. The idea for the Cloud TV project is to develop a cool application using Windows Azure that can show off the potential of Azure and the ease of use for existing .net developers and to create a community site for developers to contribute content in the form of webcasts.
It’s along the same lines as the “Bloggers Guides”, a non-profit community based site that will be a great resource for developers. If you have any webcasts that you would like to have hosted there, please let me know.
I have a basic “Upload” page that allows you to submit a webcast. All webcasts will be approved before publication to prevent abuse (I don’t want to get back from vacation and find a ton of illegal content on it). If you have issues with the upload page, please contact me and I can upload and publish your content.
It’s also time for the “Outside USA” Azure Developer Challenge, so please cast a vote sometime between the 10th and 20th July.
The site is here.
by community-syndication | Jul 3, 2009 | BizTalk Community Blogs via Syndication
A few days ago I received an overnight email from Microsoft presenting me with an MVP award in BizTalk. Needless to say I am very excited and happy about it! It is not often that this kind of news is blogged about by one of the best in the field before you do. […]
by community-syndication | Jul 3, 2009 | BizTalk Community Blogs via Syndication
WSCF-Blue, the WCF successor to the popular WSCF (Web Services Contract First) tool is now available in its first beta release at CodePlex.I’m delighted to be a part of the team working alongside guys like Christian Weyer, Buddhike De Silva, Edward Bakker and Alex Meyer-Gleaves.
If you aren’t familar with the tool, basically WSCF provides tooling […]
by community-syndication | Jul 3, 2009 | BizTalk Community Blogs via Syndication
Hi all
During my years on the forums, I have seen plenty, plenty and plenty more posts about
the SQL Server Adapter schema generator closing unexpectedly, without any errors or
any artifacts created.
Today I ran into it myself for the very first time with a BizTalk 2009 installation.
I did some searching and found this post: http://support.microsoft.com/kb/917847 –
which only applies to BizTalk 2004 and BizTalk 2006.
This blog post is just to let everyone know that it applies to BizTalk 2009 as well.
Good luck out there
—
eliasen