Saturday, 03 October 2009

Hi all

Jon Skeet, who has been a C# MVP since 2003, as I understand it was to have his MVP renewed on October 1’st 2009, but his employer Google advised him not to be renewed, so he had to tell Microsoft to not consider him for renewal. You can see Jons blog entry here.

To be honest, I think it is very petty way Google is thinking.

So to Jon: Great work, keep it up, and hopefully either Google will come around or you will find a better job and get your MVP status back.

--
eliasen

Saturday, 03 October 2009 14:40:03 (Romance Daylight Time, UTC+02:00)  #    Comments [0]  | 

Hi all

Now, I am aware that people following my blog are probably very likely to follow Richard Seroters blog as well, but just in case you haven’t noticed, Richard tortured me with his 4 questions this time :-)

You can find his questions and my answers here.

Now, being interviewed by Richard and thus having a link to my blog appear on his blog entry is bound to generate some traffic to my blog from people who either didn’t know me or didn’t visit my blog… So naturally, the first about 12 hour after Richard posted his interview, my blog was down because the webhosting company that hosts eliasen.dk had changed something… or something else, who knows? :-)

As you can see, though, my blog is again up and running and will hopefully stay this way! :-)

--
eliasen

Saturday, 03 October 2009 14:22:35 (Romance Daylight Time, UTC+02:00)  #    Comments [0]  | 
Friday, 18 September 2009

Hi all

I am REALLY excited to announce, that I will be co-authoring a book on BizTalk. I will be a part of a terrific team consisting of

  • Anush Kumar
  • Brian Loesgen
  • Charles Young
  • Jon Flanders
  • Scot Colestock
  • Tom Canter
  • Me :-)

Together we will be writing “BizTalk Server 2009 Unleashed”, which is so new, that you cannot find it on the web page of the publisher or any other sites. It is so new, that we haven’t even signed our contracts with the publisher yet, which may cause someone to quit the project if they are not happy about the contract… so nothing promised yet.

But, needless to say, I am really excited, and giving the team, also feeling quite humble :-).

This will be my first book.

Wohooo

--
eliasen

Friday, 18 September 2009 22:06:38 (Romance Daylight Time, UTC+02:00)  #    Comments [11]  | 

Hi all

So, sorry to see it, but it appears it has been almost two months since my last blog post – hope to get back on track soon.

Since the last time, I have installed Windows 7 RTM on my laptop, and one of the reasons I haven’t blogged is, that I couldn’t get Windows Live Writer Backup to restore my backup of Windows Live Writer from my old Windows XP installation. That turned out to be a silly thing… For others; You cannot restore using WLW Backup without having run Windows Live Writer first. It isn’t enough to install it, it must have been run also. Oh well.

 

I hope to entertain you all some more from now on…

 

--
eliasen

Friday, 18 September 2009 21:55:49 (Romance Daylight Time, UTC+02:00)  #    Comments [0]  | 

Hi all

Some weeks ago, I had a customer that had an Order XML and needed to fetch all the names of the ordered items based on the item number that was in the XML.

He contacted me because the solution he had thought of didn’t work. What he did was that he mapped the Order XML to a SQL Adapter schema that called an SP in SQL Server to get the item name based on the item number. The issue he ran into was, that the SP got called multiple times – once for each item, and the SQL adapter didn’t seem to batch all the results into one result for his orchestration.

So, given this simplified Order:

<ns0:Order xmlns:ns0="http://MultipleCallsToSP.Order">
  <Header>
    <CustomerName>CustomerName_0</CustomerName>
    <OrderNumber>OrderNumber_0</OrderNumber>
  </Header>
  <OrderLines>
    <OrderLine>
      <ItemNumber>21</ItemNumber>
      <Quantity>42</Quantity>
    </OrderLine>
    <OrderLine>
      <ItemNumber>42</ItemNumber>
      <Quantity>21</Quantity>
    </OrderLine>
  </OrderLines>
</ns0:Order>

He mapped it to this XML:

<ns0:GetItemNameRequest xmlns:ns0="http://eliasen.dk">
  <ns0:GetItemName ItemID="21" />
  <ns0:GetItemName ItemID="42" /> 
</ns0:GetItemNameRequest>

This was then sent to SQL Server using the SQL Adapter to call a SP named “GetItemName” which just takes an ItemID (int) as parameter and returns the ItemName hat matches the ItemID.

Now, the schema that is generated for the SQL Server request actually doesn’t allow for multiple GetItemName elements to be created, but that is changeable :-) If you set it to have maxOcurs = unbounded, then it can occur multiple times, and what happens is that the SP is called multiple times. Unfortunately, only one of the ItemNames is returned – the rest is ignored.

So the customer came to me because naturally, he needed all the ItemNames and not just one of them. I have suggested 5 possible solutions, which I will describe here.

First option
Use the pattern described at http://blog.eliasen.dk/2006/11/05/LoopingAroundElementsOfAMessage.aspx to loop around the order lines and build the resulting XML one order line at a time.

Second option
Use enveloping in the receive location in order to get one orchestration started for each order line.

Third option
Use the Database Lookup functoid to retrieve the ItemName based on the ItemID

Fourth option
Generate a comma separated list of ItemID’s in the map, and let the stored procedure use that list to return the relevant ItemNames. This has some consequences for the stored procedure. Before it looked like this:

SELECT ItemNumber, ItemName
FROM Items
WHERE Items.ItemNumber = @ItemID
FOR XML AUTO, ELEMENTS

Now, it looks like this:

SELECT ItemNumber, ItemName
FROM Items
WHERE EXISTS (select * from dbo.Split(‘,’,@items) where [Items].ItemNumber = ID)
FOR XML AUTO, ELEMENTS

@items is the parameter for the SP, which is just an nvarchar that is to contain the comma separated list.

For this to work you need the Split function, which looks like this:

CREATE FUNCTION [dbo].[Split] (@sep char(1), @s varchar(512))
RETURNS table
AS
RETURN
(    
                WITH Pieces(pn, start, stop) AS (
                      SELECT 1, 1, CHARINDEX(@sep, @s)
                      UNION ALL      
                      SELECT pn + 1, stop + 1, CHARINDEX(@sep, @s, stop + 1)      
                      FROM Pieces      
                      WHERE stop > 0    
                 )
                 SELECT pn, CONVERT(int, SUBSTRING(@s, start, CASE WHEN stop > 0 THEN stop-start ELSE 512 END)) AS ID
FROM Pieces
)

In order to generate the comma separated list in your map, I have written two blog posts about this issue, which you can find at http://blog.eliasen.dk/2009/06/22/HandlingCommaSeparatedValuesInsideAMapPartI.aspx and http://blog.eliasen.dk/2009/06/27/HandlingCommaSeparatedValuesInsideAMapPartII.aspx

Fifth option
The fifth and last option i want to mention is, that with the new SQL Server LOB adapter from Adapter Pack 2.0, it appears that you can do it like the customer wanted to do it in the first place with sending one XML to SQL Server and getting an accumulated response back from SQL Server based on several calls to a stored procedure. I haven’t had time to test this, but look out for another blog post about this :-)

 

Hope this helps someone.

 

--
eliasen

Friday, 18 September 2009 21:47:51 (Romance Daylight Time, UTC+02:00)  #    Comments [0]  | 
Tuesday, 28 July 2009

Hi all

Just to let you know, I am now listed on http://www.biztalkblogs.com along with lots of other cool BizTalk bloggers :-)

--
eliasen

Tuesday, 28 July 2009 17:40:29 (Romance Daylight Time, UTC+02:00)  #    Comments [0]  | 
Thursday, 23 July 2009

Hi all

I have just released version 5 of my pipeline components library.

It has the following additions:

  • SuspendAfterMap. In BizTalk 2009 (which is the only supported BizTalk version for this pipeline component) there has been added support for recoverable interchanges for errors occurring during mapping on receive ports after disassembling. This is achieved by setting a specific promoted property to “true”. I have created a pipeline component that will do this for you.
  • WriteProperties. This pipeline component serves almost NO purpose at all, except I used it for debugging to see what properties existed on a message going through BizTalk. It will write out all context of a message to the eventlog, one event at a time.

It has the following new features:

  • Promote. The pipeline component used for promoting a value based on an XPath expression and thereby enabling you to promote a specific instance of a reoccurring element has been enhanced by a “constant”. So instead of having to set the value of some property to the result of an XPath expression you can just enter a constant instead. If you enter both a constant and an XPath expression the constant wins. This new feature is quite handy if you need to set the value of for instance MIME.FileName to a specific value or any other property for that matter.

You can find the newest versions at http://eebiztalkpipelinecom.codeplex.com/

--
eliasen

Thursday, 23 July 2009 00:26:18 (Romance Daylight Time, UTC+02:00)  #    Comments [2]  | 
Wednesday, 22 July 2009

Hi all

I have just released version 9.1 of my functoid library. Actually, nothing much new has appeared. I had accidentally left out the functoid I described at http://blog.eliasen.dk/2009/03/08/SolvingTheIfThenElseProblemInAMapPartIII.aspx from version 9, so now it is reintroduced – and it has also been added to the documentation.

Find the newest version of the functoids library at http://eebiztalkfunctoids.codeplex.com – thanks.

--
eliasen

Wednesday, 22 July 2009 23:59:05 (Romance Daylight Time, UTC+02:00)  #    Comments [0]  | 
Tuesday, 21 July 2009

Hi all

I have been running into too many issues with BizTalk 2009 on VS.NET 2008 lately. This post is just to mention them and let everyone else know that they are not the only one – and that they will be reported to MS and hopefully fixed quickly.

Build action of schemas
Some times the “build action” of a schema in your BizTalk project is set to “None” instead of “BtsCompile”. When this happens, the schema is not compiled into the assembly and can therefore not be used for pipeline components, maps, orchestration messages, and so on. It happens if you drag a schema from your explorer into your project, but it also happens sometimes when you drag a schema between two projects inside VS.NET.

More build action of schemas
The above error could be more easy to live with, if it weren’t absolutely impossible to know when the “Build action” property of the schema in visible in VS.NET – some times the property is visible and you can change the value. Other times it is not. Quite confusing. I have found that if I add a schema to a project, then the property is suddenly visible for all schemas in the project. Change the ones that need changing and delete the schema you added.

Auto save a map before schemas are chosen
When you add a new map then at some point VS.NET auto saves the map, but if this happens before you have chosen both the source and destination schema you suddenly get an error, which you really do not expect, because you weren’t doing anything at the time of the error. This also occurred in previous versions of BizTalk.

Map looses information about schemas
I have seen several times, that even after choosing source- and destination schema for a map and dragging a couple of links in the map and saving it, then at compile time, I get an error about the map not having source- and destination schemas. So I need to choose them again, and redo all the links, because they have magically disappeared. This happens for maps that uses both schemas from the same project as schemas from referenced projects.

Output window
The output window seems to not always show all information when compiling/deploying. Some times the information comes all at the end instead of being written to the output windows as it happens. Other times, I can rebuild my entire solution and the output windows will only show me the one warning that occurred during compilation.

Dragging elements in Schema Editor
Dragging elements inside the schema editor has had me baffled since BizTalk 2002. Some times, I need more than 20 tries to get an element to be dragged – and sometimes it just works. Annoying? Indeed it is!

Copy local fails
If I have a project (P2) that references another project (P1), then after I have added an item to P1 and recompiled it, everything seems OK. BUT, if I then deploy from within V.NET, things start to go wrong. From then on, it seems that the “Copy local” property of the project reference is ignored. Whenever I recompile P2, I do NOT get the P1.dll copied to the local folder of P2. This causes all sorts of stuff as also explained here by Ryan: http://dotnet.org.za/ryancrawcour/archive/2009/07/17/biztalk-2009-amp-visual-studio-2008-annoyance-2.aspx

Setting properties for more than one project at the same time
See here: http://dotnet.org.za/ryancrawcour/archive/2009/07/15/biztalk-2009-feature-missing.aspx for Ryans thoughts on this.

--
eliasen

Tuesday, 21 July 2009 22:22:24 (Romance Daylight Time, UTC+02:00)  #    Comments [12]  | 

Hi all

Microsoft have finally released some pricing information about Azure. Find it here: http://www.microsoft.com/azure/pricing.mspx

--
eliasen

Tuesday, 21 July 2009 17:43:40 (Romance Daylight Time, UTC+02:00)  #    Comments [0]  | 

Theme design by Jelle Druyts