<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>eliasen - BizTalk 2006</title>
    <link>http://blog.eliasen.dk/</link>
    <description>Just another BizTalk guy</description>
    <language>en-us</language>
    <copyright>Jan Eliasen</copyright>
    <lastBuildDate>Sat, 15 Nov 2008 20:49:40 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.2.8279.16125</generator>
    <managingEditor>jan@eliasen.dk</managingEditor>
    <webMaster>jan@eliasen.dk</webMaster>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=d8bc8e42-e351-4d99-908e-b809e90b614d</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,d8bc8e42-e351-4d99-908e-b809e90b614d.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,d8bc8e42-e351-4d99-908e-b809e90b614d.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=d8bc8e42-e351-4d99-908e-b809e90b614d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi all
</p>
        <p>
I have often wondered why the built-in functoids doesn't encompass an If-Then-Else
functoid. The Value Mapping functoid only has an If-Then-part and not the Else-part.
</p>
        <p>
This is the first of two blog posts. This post will explore how to solve the issue
with the built-in functionality of BizTalk. The next post will be about creating a
custom functoid to do the job instead and the issues that come with this task.
</p>
        <p>
So, using the built-in functionality:
</p>
        <p>
Imagine this input schema:
</p>
        <p>
          <a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseInputSchema.jpg">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="112" alt="IfThenElseInputSchema" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseInputSchema_thumb.jpg" width="147" border="0" />
          </a>
        </p>
        <p>
And imagine this output schema:
</p>
        <p>
          <a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseOutputSchema.jpg">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="84" alt="IfThenElseOutputSchema" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseOutputSchema_thumb.jpg" width="154" border="0" />
          </a>
        </p>
        <p>
My goal, now is to create a map that will map the value of the "ifJan" element to
the destination IF the "qualifier" element equals the word "Jan" and otherwise the
value of the "ifNotJan" element should be mapped.
</p>
        <p>
So basically, given this input:
</p>
        <p>
&lt;ns0:IfThenElseInput xmlns:ns0="<a href="http://IfThenElse.IfThenElseInput&quot;">http://IfThenElse.IfThenElseInput"</a>&gt;<br />
  &lt;qualifier&gt;Jan&lt;/qualifier&gt;<br />
  &lt;ifJan&gt;ifJan&lt;/ifJan&gt;<br />
  &lt;ifNotJan&gt;ifNotJan&lt;/ifNotJan&gt;<br />
&lt;/ns0:IfThenElseInput&gt; 
</p>
        <p>
I want this output:
</p>
        <p>
&lt;ns0:IfThenElseOutput xmlns:ns0="<a href="http://IfThenElse.IfThenElseOutput&quot;">http://IfThenElse.IfThenElseOutput"</a>&gt;<br />
  &lt;field&gt;ifJan&lt;/field&gt;<br />
&lt;/ns0:IfThenElseOutput&gt; 
</p>
        <p>
And given this input:
</p>
        <p>
&lt;ns0:IfThenElseInput xmlns:ns0="<a href="http://IfThenElse.IfThenElseInput&quot;">http://IfThenElse.IfThenElseInput"</a>&gt;<br />
  &lt;qualifier&gt;NotJan&lt;/qualifier&gt;<br />
  &lt;ifJan&gt;ifJan&lt;/ifJan&gt;<br />
  &lt;ifNotJan&gt;ifNotJan&lt;/ifNotJan&gt;<br />
&lt;/ns0:IfThenElseInput&gt;
</p>
        <p>
I want this output:
</p>
        <p>
&lt;ns0:IfThenElseOutput xmlns:ns0="<a href="http://IfThenElse.IfThenElseOutput&quot;">http://IfThenElse.IfThenElseOutput"</a>&gt;<br />
  &lt;field&gt;ifNotJan&lt;/field&gt;<br />
&lt;/ns0:IfThenElseOutput&gt;
</p>
        <p>
Using a map and the built-in functoids, that would look like this:
</p>
        <p>
 <a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Functoids.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="190" alt="IfThenElseMap_Functoids" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Functoids_thumb.jpg" width="451" border="0" /></a></p>
        <p>
Basically, you need one value mapping functoid for each possible value to pass on,
and a logical functoid for each value as well, to use in the value mapping functoid.
The "String Concatenate" functoid is just my way of returning the string to use for
the qualifier - in this case: "Jan".
</p>
        <p>
You can also do it using one scripting functoid like this:
</p>
        <p>
          <a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Scripting_XSLT.jpg">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="138" alt="IfThenElseMap_Scripting_XSLT" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Scripting_XSLT_thumb.jpg" width="451" border="0" />
          </a>
        </p>
        <p>
where the scripting functoid is an "Inline XSLT Call Template" scripting type, and
the script looks likes this:
</p>
        <p>
&lt;xsl:template name="IfThenElse"&gt;<br />
  &lt;xsl:param name="qualifier" /&gt;<br />
  &lt;xsl:param name="ifJan" /&gt;<br />
  &lt;xsl:param name="ifNotJan" /&gt;<br />
  &lt;xsl:element name="field"&gt;<br />
    &lt;xsl:choose&gt;<br />
      &lt;xsl:when test="$qualifier='Jan'"&gt;<br />
        &lt;xsl:value-of select="$ifJan" /&gt;<br />
      &lt;/xsl:when&gt;<br />
      &lt;xsl:otherwise&gt;<br />
        &lt;xsl:value-of select="$ifNotJan" /&gt;<br />
      &lt;/xsl:otherwise&gt;<br />
    &lt;/xsl:choose&gt;<br />
  &lt;/xsl:element&gt;<br />
&lt;/xsl:template&gt; 
</p>
        <p>
Now... IF my good friend Henrik Badsberg is reading this, then by now he is screaming:
"USE A BLOODY C# SCRIPTING FUNCTOID!!!!!" :-) 
</p>
        <p>
This, naturally is also an option: 
</p>
        <p>
          <a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Scripting_CSharp.jpg">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="138" alt="IfThenElseMap_Scripting_CSharp" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Scripting_CSharp_thumb.jpg" width="451" border="0" />
          </a>
        </p>
        <p>
with an "Inline C#" script containing this script: 
</p>
        <p>
public string IfThenElse(string qualifier, string ifJan, string ifNotJan)<br />
{<br />
  if (qualifier == "Jan")<br />
    return ifJan;<br />
  else<br />
    return ifNotJan;<br />
} 
</p>
        <p>
Both scripting solutions can be altered to accept the output of a logical functoid
as the first input. Just change the string "Jan" to "true" in the scripts, and change
the name of the parameter if you want. 
</p>
        <p>
Now then... I am not a big fan of either of these three options. Generally, I avoid
scripting functoids when I can because it is difficult for a new developer to know
what is happening when he opens the map because he will have to open up all scripting
functoids and find out (and remember) what they do. Also, I am not really a big fan
of the first solution either. First of all, there are too many functoids, and it can
messy if this solution is needed several times in a map. Secondly, you get a warning
every time you compile, because you have two inputs to one element.
</p>
        <p>
        </p>
        <div class="wlWriterSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:a5a7990f-4d20-49d8-b310-2511383a432d" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">
          <p>
You can find my project with the three working maps <a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElse.zip" target="_blank">here.</a></p>
        </div>
        <p>
        </p>
        <p>
In my next post, I will look into creating a custom functoid that does the job and
I can tell you right now; That isn't as easy as I had imagined...
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=d8bc8e42-e351-4d99-908e-b809e90b614d" />
      </body>
      <title>Solving the "If-Then-Else" problem in a map - part I</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,d8bc8e42-e351-4d99-908e-b809e90b614d.aspx</guid>
      <link>http://blog.eliasen.dk/2008/11/15/SolvingTheIfThenElseProblemInAMapPartI.aspx</link>
      <pubDate>Sat, 15 Nov 2008 20:49:40 GMT</pubDate>
      <description>&lt;p&gt;
Hi all
&lt;/p&gt;
&lt;p&gt;
I have often wondered why the built-in functoids doesn't encompass an If-Then-Else
functoid. The Value Mapping functoid only has an If-Then-part and not the Else-part.
&lt;/p&gt;
&lt;p&gt;
This is the first of two blog posts. This post will explore how to solve the issue
with the built-in functionality of BizTalk. The next post will be about creating a
custom functoid to do the job instead and the issues that come with this task.
&lt;/p&gt;
&lt;p&gt;
So, using the built-in functionality:
&lt;/p&gt;
&lt;p&gt;
Imagine this input schema:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseInputSchema.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="112" alt="IfThenElseInputSchema" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseInputSchema_thumb.jpg" width="147" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
And imagine this output schema:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseOutputSchema.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="84" alt="IfThenElseOutputSchema" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseOutputSchema_thumb.jpg" width="154" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
My goal, now is to create a map that will map the value of the "ifJan" element to
the destination IF the "qualifier" element equals the word "Jan" and otherwise the
value of the "ifNotJan" element should be mapped.
&lt;/p&gt;
&lt;p&gt;
So basically, given this input:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;ns0:IfThenElseInput xmlns:ns0="&lt;a href="http://IfThenElse.IfThenElseInput&amp;quot;"&gt;http://IfThenElse.IfThenElseInput"&lt;/a&gt;&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;qualifier&amp;gt;Jan&amp;lt;/qualifier&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;ifJan&amp;gt;ifJan&amp;lt;/ifJan&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;ifNotJan&amp;gt;ifNotJan&amp;lt;/ifNotJan&amp;gt;&lt;br&gt;
&amp;lt;/ns0:IfThenElseInput&amp;gt; 
&lt;p&gt;
I want this output:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;ns0:IfThenElseOutput xmlns:ns0="&lt;a href="http://IfThenElse.IfThenElseOutput&amp;quot;"&gt;http://IfThenElse.IfThenElseOutput"&lt;/a&gt;&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;field&amp;gt;ifJan&amp;lt;/field&amp;gt;&lt;br&gt;
&amp;lt;/ns0:IfThenElseOutput&amp;gt; 
&lt;p&gt;
And given this input:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;ns0:IfThenElseInput xmlns:ns0="&lt;a href="http://IfThenElse.IfThenElseInput&amp;quot;"&gt;http://IfThenElse.IfThenElseInput"&lt;/a&gt;&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;qualifier&amp;gt;NotJan&amp;lt;/qualifier&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;ifJan&amp;gt;ifJan&amp;lt;/ifJan&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;ifNotJan&amp;gt;ifNotJan&amp;lt;/ifNotJan&amp;gt;&lt;br&gt;
&amp;lt;/ns0:IfThenElseInput&amp;gt;
&lt;/p&gt;
&lt;p&gt;
I want this output:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;ns0:IfThenElseOutput xmlns:ns0="&lt;a href="http://IfThenElse.IfThenElseOutput&amp;quot;"&gt;http://IfThenElse.IfThenElseOutput"&lt;/a&gt;&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;field&amp;gt;ifNotJan&amp;lt;/field&amp;gt;&lt;br&gt;
&amp;lt;/ns0:IfThenElseOutput&amp;gt;
&lt;/p&gt;
&lt;p&gt;
Using a map and the built-in functoids, that would look like this:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&lt;a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Functoids.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="190" alt="IfThenElseMap_Functoids" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Functoids_thumb.jpg" width="451" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Basically, you need one value mapping functoid for each possible value to pass on,
and a logical functoid for each value as well, to use in the value mapping functoid.
The "String Concatenate" functoid is just my way of returning the string to use for
the qualifier - in this case: "Jan".
&lt;/p&gt;
&lt;p&gt;
You can also do it using one scripting functoid like this:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Scripting_XSLT.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="138" alt="IfThenElseMap_Scripting_XSLT" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Scripting_XSLT_thumb.jpg" width="451" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
where the scripting functoid is an "Inline XSLT Call Template" scripting type, and
the script looks likes this:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;xsl:template name="IfThenElse"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xsl:param name="qualifier" /&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xsl:param name="ifJan" /&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xsl:param name="ifNotJan" /&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xsl:element name="field"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:choose&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:when test="$qualifier='Jan'"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:value-of select="$ifJan" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:when&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:otherwise&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:value-of select="$ifNotJan" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:otherwise&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:choose&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xsl:element&amp;gt;&lt;br&gt;
&amp;lt;/xsl:template&amp;gt; 
&lt;p&gt;
Now... IF my good friend Henrik Badsberg is reading this, then by now he is screaming:
"USE A BLOODY C# SCRIPTING FUNCTOID!!!!!" :-) 
&lt;p&gt;
This, naturally is also an option: 
&lt;p&gt;
&lt;a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Scripting_CSharp.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="138" alt="IfThenElseMap_Scripting_CSharp" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElseMap_Scripting_CSharp_thumb.jpg" width="451" border="0"&gt;&lt;/a&gt; 
&lt;p&gt;
with an "Inline C#" script containing this script: 
&lt;p&gt;
public string IfThenElse(string qualifier, string ifJan, string ifNotJan)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp; if (qualifier == "Jan")&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return ifJan;&lt;br&gt;
&amp;nbsp; else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return ifNotJan;&lt;br&gt;
} 
&lt;p&gt;
Both scripting solutions can be altered to accept the output of a logical functoid
as the first input. Just change the string "Jan" to "true" in the scripts, and change
the name of the parameter if you want. 
&lt;p&gt;
Now then... I am not a big fan of either of these three options. Generally, I avoid
scripting functoids when I can because it is difficult for a new developer to know
what is happening when he opens the map because he will have to open up all scripting
functoids and find out (and remember) what they do. Also, I am not really a big fan
of the first solution either. First of all, there are too many functoids, and it can
messy if this solution is needed several times in a map. Secondly, you get a warning
every time you compile, because you have two inputs to one element.
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:a5a7990f-4d20-49d8-b310-2511383a432d" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;
&lt;p&gt;
You can find my project with the three working maps &lt;a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/CreatinganIfThenElsefunctoid_C6A8/IfThenElse.zip" target="_blank"&gt;here.&lt;/a&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
In my next post, I will look into creating a custom functoid that does the job and
I can tell you right now; That isn't as easy as I had imagined...
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=d8bc8e42-e351-4d99-908e-b809e90b614d" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,d8bc8e42-e351-4d99-908e-b809e90b614d.aspx</comments>
      <category>BizTalk 2004</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=98764827-a434-4104-b030-3d8fb17833a9</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,98764827-a434-4104-b030-3d8fb17833a9.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,98764827-a434-4104-b030-3d8fb17833a9.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=98764827-a434-4104-b030-3d8fb17833a9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi all
</p>
        <p>
In almost all multiple server installations of BizTalk I have encountered, there has
been issues with MSDTC. MSDTC is Microsofts product for handling distributed transactions,
meaning transactions that span multiple servers. BizTalk uses this in high scale,
when running transactions against SQL Server, to maintain consistency in BizTalks
databases.
</p>
        <p>
All issues with MSDTC are solvable - sometimes it is just hard to figure out what
is wrong. 
</p>
        <p>
First of all, always use the DTCTester tool at <a href="http://support.microsoft.com/kb/293799">http://support.microsoft.com/kb/293799</a> to
test your MSDTC installation. If this tool reports no errors and you are still having
issues, then most likely, MSDTC isn't the cause of your issues.
</p>
        <p>
If something is wrong with MSDTC, I have encountered four major issues:
</p>
        <ol>
          <li>
MSDTC doesn't run on either of the server. Solve this by starting MSDTC. Steps to
start MSDTC (Note, that the MMC snapin is buggy, and it might appear that the "Component
Services" node has no children... but it does, trust me :-) ):</li>
        </ol>
        <ol>
          <li>
Go to "Administrative Tools" =&gt; "Component Services"</li>
          <li>
Go to "Component Services" =&gt; "Computers" =&gt; "My Computer"</li>
          <li>
Right click "My Computer" and choose "Start MS DTC".<br /><a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/Transactionsgivingyouaheadache_12380/start_msdtc.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="306" alt="start_msdtc" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/Transactionsgivingyouaheadache_12380/start_msdtc_thumb.jpg" width="522" border="0" /></a></li>
        </ol>
        <li>
MSDTC isn't configured for network access on both servers. Solve this in "add/remove
windows components" here:<br /><a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/Transactionsgivingyouaheadache_12380/install_msdtc_network_access.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="411" alt="install_msdtc_network_access" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/Transactionsgivingyouaheadache_12380/install_msdtc_network_access_thumb.jpg" width="630" border="0" /></a></li>
        <li>
The two servers have the same MS DTC ID. This ocurs if both servers are clones of
the same server or if one of the ervers is a clone of the other server. Usually, when
cloning servers, sysprep is used to clear out those errors, but in case it hasn't
been used, here is how you fix it: 
</li>
        <ol>
          <li>
Run "msdtc -uninstall" from a command prompt</li>
          <li>
reboot</li>
          <li>
Run "msdtc -install" from a command prompt</li>
          <li>
reboot</li>
        </ol>
        <li>
You can't ping the servers by hostname, which is required. This basically means, that
from both servers, you need to be able to ping the other server by hostname - pinging
by IP address isn't enough. If you can't ping by hostname, you have two options:</li>
        <ol>
          <li>
Get the network administrator to update your DNS</li>
          <li>
Enter new information into the hosts file in c:\windows\system32\drivers\etc</li>
        </ol>
        <p>
Hope this helps. 
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=98764827-a434-4104-b030-3d8fb17833a9" />
      </body>
      <title>Transactions giving you a headache</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,98764827-a434-4104-b030-3d8fb17833a9.aspx</guid>
      <link>http://blog.eliasen.dk/2008/11/10/TransactionsGivingYouAHeadache.aspx</link>
      <pubDate>Mon, 10 Nov 2008 18:28:38 GMT</pubDate>
      <description>&lt;p&gt;
Hi all
&lt;/p&gt;
&lt;p&gt;
In almost all multiple server installations of BizTalk I have encountered, there has
been issues with MSDTC. MSDTC is Microsofts product for handling distributed transactions,
meaning transactions that span multiple servers. BizTalk uses this in high scale,
when running transactions against SQL Server, to maintain consistency in BizTalks
databases.
&lt;/p&gt;
&lt;p&gt;
All issues with MSDTC are solvable - sometimes it is just hard to figure out what
is wrong. 
&lt;/p&gt;
&lt;p&gt;
First of all, always use the DTCTester tool at &lt;a href="http://support.microsoft.com/kb/293799"&gt;http://support.microsoft.com/kb/293799&lt;/a&gt; to
test your MSDTC installation. If this tool reports no errors and you are still having
issues, then most likely, MSDTC isn't the cause of your issues.
&lt;/p&gt;
&lt;p&gt;
If something is wrong with MSDTC, I have encountered four major issues:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
MSDTC doesn't run on either of the server. Solve this by starting MSDTC. Steps to
start MSDTC (Note, that the MMC snapin is buggy, and it might appear that the "Component
Services" node has no children... but it does, trust me :-) ):&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;
Go to "Administrative Tools" =&amp;gt; "Component Services"&lt;/li&gt;
&lt;li&gt;
Go to "Component Services" =&amp;gt; "Computers" =&amp;gt; "My Computer"&lt;/li&gt;
&lt;li&gt;
Right click "My Computer" and choose "Start MS DTC".&lt;br&gt;
&lt;a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/Transactionsgivingyouaheadache_12380/start_msdtc.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="306" alt="start_msdtc" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/Transactionsgivingyouaheadache_12380/start_msdtc_thumb.jpg" width="522" border="0"&gt;&lt;/a&gt; 
&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;
MSDTC isn't configured for network access on both servers. Solve this in "add/remove
windows components" here:&lt;br&gt;
&lt;a href="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/Transactionsgivingyouaheadache_12380/install_msdtc_network_access.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="411" alt="install_msdtc_network_access" src="http://blog.eliasen.dk/content/binary/WindowsLiveWriter/Transactionsgivingyouaheadache_12380/install_msdtc_network_access_thumb.jpg" width="630" border="0"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
The two servers have the same MS DTC ID. This ocurs if both servers are clones of
the same server or if one of the ervers is a clone of the other server. Usually, when
cloning servers, sysprep is used to clear out those errors, but in case it hasn't
been used, here is how you fix it: 
&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;
Run "msdtc -uninstall" from a command prompt&lt;/li&gt;
&lt;li&gt;
reboot&lt;/li&gt;
&lt;li&gt;
Run "msdtc -install" from a command prompt&lt;/li&gt;
&lt;li&gt;
reboot&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;
You can't ping the servers by hostname, which is required. This basically means, that
from both servers, you need to be able to ping the other server by hostname - pinging
by IP address isn't enough. If you can't ping by hostname, you have two options:&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;
Get the network administrator to update your DNS&lt;/li&gt;
&lt;li&gt;
Enter new information into the hosts file in c:\windows\system32\drivers\etc&lt;/li&gt;
&lt;/ol&gt;
&gt;
&lt;p&gt;
Hope this helps. 
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=98764827-a434-4104-b030-3d8fb17833a9" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,98764827-a434-4104-b030-3d8fb17833a9.aspx</comments>
      <category>BizTalk 2004</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=3a40aef8-8caf-4a37-bfb9-c2a155616951</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,3a40aef8-8caf-4a37-bfb9-c2a155616951.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,3a40aef8-8caf-4a37-bfb9-c2a155616951.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=3a40aef8-8caf-4a37-bfb9-c2a155616951</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
So... 
</p>
        <p>
People sometimes ask, what is the difference between catching System.Exception and
the General Exception in a Catch Exception shape in the orchestration designer in
BizTalk.
</p>
        <p>
Off course, an obvious difference is, that with the General Exception, you don't get
an object with properties to investigate. But then it seems that the General Exception
is useless... surely there is a point to it?
</p>
        <p>
Well, I was curious about this myself, so I investigated a bit, and found <a href="http://mark.michaelis.net/Blog/ExceptionHandlingChangesInC20.aspx">this
post</a>. So basically, I think the catch of the general exception in BizTalk 2006
is a left over from BizTalk 2004. In BizTalk 2004 it made sense, since you actually
have exceptions thrown at you that didn't derive from System.Exception. That is no
longer possible in .NET 2.0 - they just haven't removed it from the designer - probably
just to be backwards compatible.
</p>
        <p>
That's it...
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=3a40aef8-8caf-4a37-bfb9-c2a155616951" />
      </body>
      <title>System.Exception vs. General Exception</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,3a40aef8-8caf-4a37-bfb9-c2a155616951.aspx</guid>
      <link>http://blog.eliasen.dk/2007/12/12/SystemExceptionVsGeneralException.aspx</link>
      <pubDate>Wed, 12 Dec 2007 18:53:15 GMT</pubDate>
      <description>&lt;p&gt;
So... 
&lt;/p&gt;
&lt;p&gt;
People sometimes ask, what is the difference between catching System.Exception and
the General Exception in a Catch Exception shape in the orchestration designer in
BizTalk.
&lt;/p&gt;
&lt;p&gt;
Off course, an obvious difference is, that with the General Exception, you don't get
an object with properties to investigate. But then it seems that the General Exception
is useless... surely there is a point to it?
&lt;/p&gt;
&lt;p&gt;
Well, I was curious about this myself, so I investigated a bit, and found &lt;a href="http://mark.michaelis.net/Blog/ExceptionHandlingChangesInC20.aspx"&gt;this
post&lt;/a&gt;. So basically, I think the catch of the general exception in BizTalk 2006
is a left over from BizTalk 2004. In BizTalk 2004 it made sense, since you actually
have exceptions thrown at you that didn't derive from System.Exception. That is no
longer possible in .NET 2.0 - they just haven't removed it from the designer - probably
just to be backwards compatible.
&lt;/p&gt;
&lt;p&gt;
That's it...
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=3a40aef8-8caf-4a37-bfb9-c2a155616951" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,3a40aef8-8caf-4a37-bfb9-c2a155616951.aspx</comments>
      <category>BizTalk 2004</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=a46d79f2-1d70-4c51-a3de-21b0a0d03998</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,a46d79f2-1d70-4c51-a3de-21b0a0d03998.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,a46d79f2-1d70-4c51-a3de-21b0a0d03998.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=a46d79f2-1d70-4c51-a3de-21b0a0d03998</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
Recently, I ran into a peculiar problem, which really had me fooled a long time.
</p>
        <p>
Basically, I had a BizTalk Server 2006 R2 solution running. It consisted of 10 assemblies.
One of the orchestrations in each of 9 of the assemblies was exposed as a web service,
all using complex types - no strings, ints and so on.
</p>
        <p>
And then there was the system, that was to call my web services. I had no saying over
that system. We started calling the first web service. Everything went ok. Then they
implemented code to call the second web service, everything OK... all was well (except
some minor things here and there) for the first eight web services.
</p>
        <p>
But at the ninth web service, strange things started to happen.
</p>
        <p>
Basically, the other system would call my web service, IIS would return http 200 OK,
but still, no data came into BizTalk. I had NOTHING in group hub page, nothing in
HAT, nothing in the eventlog, NOTHING! IIS log said: I received a post on this url
and responded with 200 OK - that's it - nothing more.
</p>
        <p>
Really weird - I mean... where did the XML go? Why were there no errors? So we installed
YATT, which is an http sniffer tool, that would be able to tell us what was exatly
sent across the wires. Basically, what we found out was, that allthough the sender
might have send 13000 bytes, the sniffer only reported maybe 10500 bytes. So we started
investigating the network. The two servers were on the same subnet, one hop away from
eachother. So no servers on the route could mingle with the traffic. 
</p>
        <p>
I decided that I would write my own little C# test program, that would call the web
service and see if that failed as well. It didn't. I ended up calling the web service
succesfully with more than 100k (I didn't bother to try anything higher than that.)
</p>
        <p>
But it turned out, that the sniffer must have a bug - it reported all sorts of different
numbers, when using my test program, and none were correct. Apparently, it wasn't
created to handle large packets, but just a few kilobytes. So we installed wireshark
instead (get it from sourceforge). Now THAT is a nice tool! Totally professional (and
free), and it showed us everything that came in and out - no limitations.
</p>
        <p>
So we did a test with my tool, and a test with the other system, and tried comparing
the http headers, the soap action, and so on. It turned out, that all the other web
services, when called by the other system, returned http 202 Accept and not http 200
OK. And when my test program called the web service, it got the http 202 Accept.
</p>
        <p>
We ended up discovering what the issue was. The other system (programmed in .NET)
wasn't calling my web services the "right way". They were sending everything using
httprequests. Now, this is a perfectly legal way of doing it, but it really requires
that you know what you are doing. I mean: They added a header to the httprequest for
the SOAPAction, and then they built up XML with the soap envelope, soap body, elements
for the web method and inside that the actual XML. This was just a string that they sent
using httprequest.
</p>
        <p>
The answer ended up being that the XML that the other system was sending me had invalid
data in elements of type xsd:date. So basically, the XML couldn't be deserialized
into the object that my web method on the web service was expecting. Therefore, the
web method was never called, and therefore there was no data in biztalks log, the
eventlog or anywhere else.
</p>
        <p>
So, I have learned two things from this:
</p>
        <p>
1. You should always accept the help your programming environment gives you. If the
programmer of the other system had added a web reference to the web service and built
XML and deserialized it into the object that was the parameter, he would have gotten
an exception at runtime, that he could debug. The way he did it meant that we got
NO errors at all - the data just disappeared (which I think .NET shouldn't do. Some
sort of warning somewhere would have been nice.)
</p>
        <p>
2. When debugging, don't trust the tools you download you to help debugging :-)
</p>
        <p>
I hope this can help someone.
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=a46d79f2-1d70-4c51-a3de-21b0a0d03998" />
      </body>
      <title>XML disappearing when calling a BizTalk Web Service</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,a46d79f2-1d70-4c51-a3de-21b0a0d03998.aspx</guid>
      <link>http://blog.eliasen.dk/2007/11/21/XMLDisappearingWhenCallingABizTalkWebService.aspx</link>
      <pubDate>Wed, 21 Nov 2007 23:34:20 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
Recently, I ran into a peculiar problem, which really had me fooled a long time.
&lt;/p&gt;
&lt;p&gt;
Basically, I had a BizTalk Server 2006 R2 solution running. It consisted of 10 assemblies.
One of the orchestrations in each of 9 of the assemblies was exposed as a web service,
all using complex types - no strings, ints and so on.
&lt;/p&gt;
&lt;p&gt;
And then there was the system, that was to call my web services. I had no saying over
that system. We started calling the first web service. Everything went ok. Then they
implemented code to call the second web service, everything OK... all was well (except
some minor things here and there) for the first eight web services.
&lt;/p&gt;
&lt;p&gt;
But at the ninth web service, strange things started to happen.
&lt;/p&gt;
&lt;p&gt;
Basically, the other system would call my web service, IIS would return http 200 OK,
but still, no data came into BizTalk. I had NOTHING in group hub page, nothing in
HAT, nothing in the eventlog, NOTHING! IIS log said: I received a post on this url
and responded with 200 OK - that's it - nothing more.
&lt;/p&gt;
&lt;p&gt;
Really weird - I mean... where did the XML go? Why were there no errors? So we installed
YATT, which is an http sniffer tool, that would be able to tell us what was exatly
sent across the wires. Basically, what we found out was, that allthough the sender
might have send 13000 bytes, the sniffer only reported maybe 10500 bytes. So we started
investigating the network. The two servers were on the same subnet, one hop away from
eachother. So no servers on the route could mingle with the traffic. 
&lt;/p&gt;
&lt;p&gt;
I decided that I would write my own little C# test program, that would call the web
service and see if that failed as well. It didn't. I ended up calling the web service
succesfully with more than 100k (I didn't bother to try anything higher than that.)
&lt;/p&gt;
&lt;p&gt;
But it turned out, that the sniffer must have a bug - it reported all sorts of different
numbers, when using my test program, and none were correct. Apparently, it wasn't
created to handle large packets, but just a few kilobytes. So we installed wireshark
instead (get it from sourceforge). Now THAT is a nice tool! Totally professional (and
free), and it showed us everything that came in and out - no limitations.
&lt;/p&gt;
&lt;p&gt;
So we did a test with my tool, and a test with the other system, and tried comparing
the http headers, the soap action, and so on. It turned out, that all the other web
services, when called by the other system, returned http 202 Accept and not http 200
OK. And when my test program called the web service, it got the http 202 Accept.
&lt;/p&gt;
&lt;p&gt;
We ended up&amp;nbsp;discovering what the issue was. The other system (programmed in .NET)
wasn't calling my web services the "right way". They were sending everything using
httprequests. Now, this is a perfectly legal way of doing it, but it really requires
that you know what you are doing. I mean: They added a header to the httprequest for
the SOAPAction, and then they built up XML with the soap envelope, soap body, elements
for the web method and inside that the actual XML. This was just a string that they&amp;nbsp;sent
using httprequest.
&lt;/p&gt;
&lt;p&gt;
The answer ended up being that the XML that the other system was sending me had invalid
data in elements of type xsd:date. So basically, the XML couldn't be deserialized
into the object that my web method on the web service was expecting. Therefore, the
web method was never called, and therefore there was no data in biztalks log, the
eventlog or anywhere else.
&lt;/p&gt;
&lt;p&gt;
So, I have learned two things from this:
&lt;/p&gt;
&lt;p&gt;
1. You should always accept the help your programming environment gives you. If the
programmer of the other system had added a web reference to the web service and built
XML and deserialized it into the object that was the parameter, he would have gotten
an exception at runtime, that he could debug. The way he did it meant that we got
NO errors at all - the data just disappeared (which I think .NET shouldn't do. Some
sort of warning somewhere would have been nice.)
&lt;/p&gt;
&lt;p&gt;
2. When debugging, don't trust the tools you download you to help debugging :-)
&lt;/p&gt;
&lt;p&gt;
I hope this can help someone.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=a46d79f2-1d70-4c51-a3de-21b0a0d03998" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,a46d79f2-1d70-4c51-a3de-21b0a0d03998.aspx</comments>
      <category>.NET</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=082d8501-dff1-4093-a876-69371bf64226</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,082d8501-dff1-4093-a876-69371bf64226.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,082d8501-dff1-4093-a876-69371bf64226.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=082d8501-dff1-4093-a876-69371bf64226</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
I just thought I would share my experiences from the first BizTalk 2006 R2 I have
installed and configured. 
</p>
        <p>
It was on two different boxes - one for SQL Server and one for BizTalk. Domain groups
were created beforehand, as well as a service account for the services. So everything
should be in place.
</p>
        <p>
Installation went fine, naturally, but the configuration wouldn't let me configure
Group and Runtime. I checked the logs, off course, and the first error was this one:
</p>
        <p>
[09:14:15 Info ConfigHelper]  is not a local entity.<br />
[09:14:15 Error ConfigHelper] d:\depot2300\mercury\private\common\configwizard\confighelper\service.cpp(729):
FAILED hr = 80070421
</p>
        <p>
[09:14:15 Warning ConfigHelper] The account name is invalid or does not exist, or
the password is invalid for the account name specified.<br />
[09:14:15 Warning ConfigHelper]  Failed to validate service credentials for account:
%1
</p>
        <p>
So it had to be something about the credentials I have specified. So I unconfigured,
reconfigured, being very carefully to enter the correct credentials - same error.
I tried again, with extra extra focus on not mistyping anything. Same error.
</p>
        <p>
Then I searched some more in the log file, and found this:
</p>
        <p>
2007-09-25 09:16:49:0441 [INFO] WMI Deploying 'C:\Program Files\Microsoft BizTalk
Server 2006\Microsoft.BizTalk.GlobalPropertySchemas.dll'<br />
2007-09-25 09:16:49:0723 [WARN] AdminLib GetBTSMessage: hrErr=80070002; Msg=The system
cannot find the file specified.; 
<br />
2007-09-25 09:16:49:0723 [WARN] AdminLib GetBTSMessage: hrErr=c0c02560; Msg=Failed
to read "KeepDbDebugKey" from the registry.<br />
The system cannot find the file specified.; 
</p>
        <p>
But the file actually existed. Then I searched the log file some more, and found this:
</p>
        <p>
2007-09-25 09:16:49:0863 [INFO] WMI Error occurred during database creation; attempt
to rollback and delete the partially created database'hcpr-hd-axa-01\BizTalkMgmtDb'<br />
2007-09-25 09:16:49:0863 [INFO] WMI Calling CDataSource.Open() against hcpr-hd-axa-01\master<br />
2007-09-25 09:16:49:0879 [INFO] WMI CDataSource.Open() returned<br />
2007-09-25 09:17:09:0942 [WARN] WMI Rollback failed.  Could not delete database.<br />
2007-09-25 09:17:09:0942 [ERR] WMI Failed in pAdmInst-&gt;Create() in CWMIInstProv::PutInstance().
HR=c0c025b3<br />
2007-09-25 09:17:09:0942 [ERR] WMI WMI error description is generated: Exception of
type 'System.EnterpriseServices.TransactionProxyException' was thrown.<br />
2007-09-25 09:17:09:0942 [INFO] WMI CWMIInstProv::PutInstance() finished. HR=c0c025b3<br />
[09:17:09 Error BtsCfg] d:\depot2300\mercury\private\mozart\source\setup\btscfg\btswmi.cpp(358):
FAILED hr = c0c025b3
</p>
        <p>
[09:17:09 Error BtsCfg] Exception of type 'System.EnterpriseServices.TransactionProxyException'
was thrown.<br />
[09:17:09 Error BtsCfg] d:\depot2300\mercury\private\mozart\source\setup\btscfg\btscfg.cpp(1769):
FAILED hr = c0c025b3
</p>
        <p>
This error pointed to some transaction error, so I downloaded and ran <a href="http://support.microsoft.com/kb/293799">dtctester</a> and
it turned out my MSDTC settigns were not good enough. I spend the better part of a
day looking for this. What really had me confused was that the SSODB was created fine
- the BRE-DB was created fine... and the BizTalkMgmtDb database was sometimes created
just fine. I mean... sometimes it would create the BizTalkMgmtDB database and fail
during creation of the MessageBox. Other times it would fail on the Management database.
So seing as two databases were created just fine, I really didn't think there were
any issues with DTC. 
</p>
        <p>
BUT, this just goes to show; Before starting a multibox installation of BizTalk, ALWAYS
run dtc tester first - just to be sure :-)
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=082d8501-dff1-4093-a876-69371bf64226" />
      </body>
      <title>Error configuring BizTalk Server 2006 R2</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,082d8501-dff1-4093-a876-69371bf64226.aspx</guid>
      <link>http://blog.eliasen.dk/2007/10/21/ErrorConfiguringBizTalkServer2006R2.aspx</link>
      <pubDate>Sun, 21 Oct 2007 18:02:05 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
I just thought I would share my experiences from the first BizTalk 2006 R2 I have
installed and configured. 
&lt;/p&gt;
&lt;p&gt;
It was on two different boxes - one for SQL Server and one for BizTalk. Domain groups
were created beforehand, as well as a service account for the services. So everything
should be in place.
&lt;/p&gt;
&lt;p&gt;
Installation went fine, naturally, but the configuration wouldn't let me configure
Group and Runtime. I checked the logs, off course, and the first error was this one:
&lt;/p&gt;
&lt;p&gt;
[09:14:15 Info ConfigHelper]&amp;nbsp; is not a local entity.&lt;br&gt;
[09:14:15 Error ConfigHelper] d:\depot2300\mercury\private\common\configwizard\confighelper\service.cpp(729):
FAILED hr = 80070421
&lt;/p&gt;
&lt;p&gt;
[09:14:15 Warning ConfigHelper] The account name is invalid or does not exist, or
the password is invalid for the account name specified.&lt;br&gt;
[09:14:15 Warning ConfigHelper] &amp;nbsp;Failed to validate service credentials for account:
%1
&lt;/p&gt;
&lt;p&gt;
So it had to be something about the credentials I have specified. So I unconfigured,
reconfigured, being very carefully to enter the correct credentials - same error.
I tried again, with extra extra focus on not mistyping anything. Same error.
&lt;/p&gt;
&lt;p&gt;
Then I searched some more in the log file, and found this:
&lt;/p&gt;
&lt;p&gt;
2007-09-25 09:16:49:0441 [INFO] WMI Deploying 'C:\Program Files\Microsoft BizTalk
Server 2006\Microsoft.BizTalk.GlobalPropertySchemas.dll'&lt;br&gt;
2007-09-25 09:16:49:0723 [WARN] AdminLib GetBTSMessage: hrErr=80070002; Msg=The system
cannot find the file specified.; 
&lt;br&gt;
2007-09-25 09:16:49:0723 [WARN] AdminLib GetBTSMessage: hrErr=c0c02560; Msg=Failed
to read "KeepDbDebugKey" from the registry.&lt;br&gt;
The system cannot find the file specified.; 
&lt;/p&gt;
&lt;p&gt;
But the file actually existed. Then I searched the log file some more, and found this:
&lt;/p&gt;
&lt;p&gt;
2007-09-25 09:16:49:0863 [INFO] WMI Error occurred during database creation; attempt
to rollback and delete the partially created database'hcpr-hd-axa-01\BizTalkMgmtDb'&lt;br&gt;
2007-09-25 09:16:49:0863 [INFO] WMI Calling CDataSource.Open() against hcpr-hd-axa-01\master&lt;br&gt;
2007-09-25 09:16:49:0879 [INFO] WMI CDataSource.Open() returned&lt;br&gt;
2007-09-25 09:17:09:0942 [WARN] WMI Rollback failed.&amp;nbsp; Could not delete database.&lt;br&gt;
2007-09-25 09:17:09:0942 [ERR] WMI Failed in pAdmInst-&amp;gt;Create() in CWMIInstProv::PutInstance().
HR=c0c025b3&lt;br&gt;
2007-09-25 09:17:09:0942 [ERR] WMI WMI error description is generated: Exception of
type 'System.EnterpriseServices.TransactionProxyException' was thrown.&lt;br&gt;
2007-09-25 09:17:09:0942 [INFO] WMI CWMIInstProv::PutInstance() finished. HR=c0c025b3&lt;br&gt;
[09:17:09 Error BtsCfg] d:\depot2300\mercury\private\mozart\source\setup\btscfg\btswmi.cpp(358):
FAILED hr = c0c025b3
&lt;/p&gt;
&lt;p&gt;
[09:17:09 Error BtsCfg] Exception of type 'System.EnterpriseServices.TransactionProxyException'
was thrown.&lt;br&gt;
[09:17:09 Error BtsCfg] d:\depot2300\mercury\private\mozart\source\setup\btscfg\btscfg.cpp(1769):
FAILED hr = c0c025b3
&lt;/p&gt;
&lt;p&gt;
This error pointed to some transaction error, so I downloaded and ran &lt;a href="http://support.microsoft.com/kb/293799"&gt;dtctester&lt;/a&gt; and
it turned out my MSDTC settigns were not good enough. I spend the better part of a
day looking for this. What really had me confused was that the SSODB was created fine
- the BRE-DB was created fine... and the BizTalkMgmtDb database was sometimes created
just fine. I mean... sometimes it would create the BizTalkMgmtDB database and fail
during creation of the MessageBox. Other times it would fail on the Management database.
So seing as two databases were created just fine, I really didn't think there were
any issues with DTC. 
&lt;/p&gt;
&lt;p&gt;
BUT, this just goes to show; Before starting a multibox installation of BizTalk, ALWAYS
run dtc tester first - just to be sure :-)
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=082d8501-dff1-4093-a876-69371bf64226" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,082d8501-dff1-4093-a876-69371bf64226.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=a2b12e36-c502-4b9a-8372-59837ff94f00</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,a2b12e36-c502-4b9a-8372-59837ff94f00.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,a2b12e36-c502-4b9a-8372-59837ff94f00.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=a2b12e36-c502-4b9a-8372-59837ff94f00</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
The other day I published an orchestration of mine as a web service. Not a big deal.
Then, I needed to export the MSI for my application, so I could install it on the
test server. Now THAT was a Big Deal! :-)
</p>
        <p>
I got this one:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/export_wizard_error.jpg" border="0" />
        </p>
        <p>
A really silly restriction on a quite normal Windows Server 2003 R2 - as you can see,
the entire path of a file, including the filename, must be less than 260 characters
long. And the path itself must be less than 248 characters long.
</p>
        <p>
This had me stunned for a moment, until I took a closer look at what file creation
was the issue. It turns out, that the issue was with creating temporary files in c:\documents
and settings\administrator\local settings\temp. Yes, I am logged in as administrator.
No, I wouldn't normally do that. Quit asking these questions, and let me finish the
post! Right. Then I got clever, if I might say so myself (nobosy else is saying it,
so I suppose I have to do it myself :-) )... Turns out that the temporary files are
created in the %TMP% (NOT the %TEMP% one...) directory. So what to do? Simple - change
the %TMP% environment variable to point at c:\tmp in stead of c:\documents and settings\administrator\local
settings\temp. That's what I did, and it worked. I got my MSI file.
</p>
        <p>
BUT... Well... You know that sometimes you do something that is like peeing in your
pants? At first it is warm, but then it just gets cold and nasty? Well, this is like
that. Because when I then took the MSI file to the test server and tried to install
it (not the import part, but the install part), I got the exact same error. The default
installation path is C:\Program Files\Generated by BizTalk\ - which is also a rather
long path. So in order to install my application, I ended up installing it to c:\biz.
Now having to tell your customer that they can't install the application to a path
longer than 5 characters really isn't an option.
</p>
        <p>
So my clever and very nice workaround to just set the TMP environment variable to
c:\tmp in order to generated the MSI file really wasn't all that clever, since the
installation wasn't acceptable at all. Had the issue just been my own developers box,
I wouldn't have minded... but now I have to go rename all artefacts anyway. Bugger!
</p>
        <p>
So basically, this post is written for people looking for a workaround for the error
they get with long filenames/paths. My suggestion: Rename your artefacts, and don't
wet your pants! :-)
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=a2b12e36-c502-4b9a-8372-59837ff94f00" />
      </body>
      <title>The specified path, file name, or both are too long.</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,a2b12e36-c502-4b9a-8372-59837ff94f00.aspx</guid>
      <link>http://blog.eliasen.dk/2007/10/14/TheSpecifiedPathFileNameOrBothAreTooLong.aspx</link>
      <pubDate>Sun, 14 Oct 2007 19:52:42 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
The other day I published an orchestration of mine as a web service. Not a big deal.
Then, I needed to export the MSI for my application, so I could install it on the
test server. Now THAT was a Big Deal! :-)
&lt;/p&gt;
&lt;p&gt;
I got this one:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/export_wizard_error.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
A really silly restriction on a quite normal Windows Server 2003 R2 - as you can see,
the entire path of a file, including the filename, must be less than&amp;nbsp;260 characters
long. And the path itself must be less than 248 characters long.
&lt;/p&gt;
&lt;p&gt;
This had me stunned for&amp;nbsp;a moment, until I took a closer look at what file creation
was the issue. It turns out, that the issue was with creating temporary files in c:\documents
and settings\administrator\local settings\temp. Yes, I am logged in as administrator.
No, I wouldn't normally do that. Quit asking these questions, and let me finish the
post! Right. Then I got clever, if I might say so myself (nobosy else is saying it,
so I suppose I have to do it myself :-) )... Turns out that the temporary files are
created in the %TMP% (NOT the %TEMP% one...) directory. So what to do? Simple - change
the %TMP% environment variable to point at c:\tmp in stead of c:\documents and settings\administrator\local
settings\temp. That's what I did, and it worked. I got my MSI file.
&lt;/p&gt;
&lt;p&gt;
BUT... Well... You know that sometimes you do something that is like peeing in&amp;nbsp;your
pants? At first it is warm, but then it just gets cold and nasty? Well, this is like
that. Because when I then took the MSI file to the test server and tried to install
it (not the import part, but the install part), I got the exact same error. The default
installation path is C:\Program Files\Generated by BizTalk\ - which is also a rather
long path. So in order to install my application, I ended up installing it to c:\biz.
Now having to tell your customer that they can't install the application to a path
longer than 5 characters really isn't an option.
&lt;/p&gt;
&lt;p&gt;
So my clever and very nice workaround to just set the TMP environment variable to
c:\tmp in order to generated the MSI file really wasn't all that clever, since the
installation wasn't acceptable at all. Had the issue just been my own developers box,
I wouldn't have minded... but now I have to go rename all artefacts anyway. Bugger!
&lt;/p&gt;
&lt;p&gt;
So basically, this post is written for people looking for a workaround for the error
they get with long filenames/paths. My suggestion: Rename your artefacts, and don't
wet your pants! :-)
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=a2b12e36-c502-4b9a-8372-59837ff94f00" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,a2b12e36-c502-4b9a-8372-59837ff94f00.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=52d63060-73ae-4ebf-b45d-c0c97edea756</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,52d63060-73ae-4ebf-b45d-c0c97edea756.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,52d63060-73ae-4ebf-b45d-c0c97edea756.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=52d63060-73ae-4ebf-b45d-c0c97edea756</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
Well, some people have their BizTalk vNext wishlist on their blog. I'd like to add
a couple of requests to the growing list :-)
</p>
        <ol>
          <li>
For development purposes, it would be really nice to be able to rightclick a receive
location that is disabled and choose "Execute". If for instance I have a SQL adapter
receive location that is supposed to poll every minute, then I don't want to have
to quickly disable the receive location once it has been fired. I want to keep it
disabled, so data wont go through my system when I am not ready, and then just execute
it whenever I am ready.</li>
          <li>
Deployment of single assembly from VS.NET. If I have three projects in my solution:
Schemas, Maps and Orchestrations, and both Maps and Orchestrations reference Schemas,
then I can not deploy them all at the same time from VS.NET :-( Deploying Orchestrations
will make VS.nET deploy Schemas as well - even if there are no changes to it. To deploy
Schemas, the current Schemas assemblymust be undeplyed, and therefore, the Maps assembly
must also be undeployed. So VS.NET will Undeploy Orchestrations, Undeploy Maps, Undeploy
Schemas, Deploy Schemas, Deploy Orchestrations. This isn't acceptable, because
Maps isn't deployed anymore. If I then deploy Maps, the same thing happens, only the
Orchestrations gets undeployed and it isn't redeployed. To me, VS.NET should ONLY
interfere like that if I deploy the entire solution. If I deploy just project, then
just let me do so! Right now, I would have to let Orchestrations reference Maps even
if it isn't necessary and then always deploy Orchestrations.</li>
          <li>
Restart Host Instances only once. Right now, if I deploye my solution from VS.NET,
and this solution has 10 proejcts that are all set to "Restart Host Instances" on
deployment, then the host instances will get restarted 10 times. Would be nice if
VS.NET could figure this out and only do it once.</li>
          <li>
Specify the node that is body, when using enveloping and not just the parent. It makes
great sense, that I can specify a node and all child elements are then submitted as
seperate messages from the receive pipeline. This is how we can receive orders, invoices,
etc. in the same XML. BUT, if I receive XML where I only need the Orders, then I would
like to point at the Orders element so that is all I get. Right now I have to use
standard enveloping, and implement logic to just delete the invoices, etc. Not really
nice, I think.</li>
        </ol>
        <p>
That's it for now :-)
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=52d63060-73ae-4ebf-b45d-c0c97edea756" />
      </body>
      <title>BizTalk vNext wishlist</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,52d63060-73ae-4ebf-b45d-c0c97edea756.aspx</guid>
      <link>http://blog.eliasen.dk/2007/10/06/BizTalkVNextWishlist.aspx</link>
      <pubDate>Sat, 06 Oct 2007 22:40:36 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
Well, some people have their BizTalk vNext wishlist on their blog. I'd like to add
a couple of requests to the growing list :-)
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
For development purposes, it would be really nice to be able to rightclick a receive
location that is disabled and choose "Execute". If for instance I have a SQL adapter
receive location that is supposed to poll every minute, then I don't want to have
to quickly disable the receive location once it has been fired. I want to keep it
disabled, so data wont go through my system when I am not ready, and then just execute
it whenever I am ready.&lt;/li&gt;
&lt;li&gt;
Deployment of single assembly from VS.NET. If I have three projects in my solution:
Schemas, Maps and Orchestrations, and both Maps and Orchestrations reference Schemas,
then I can not deploy them all at the same time from VS.NET :-( Deploying Orchestrations
will make VS.nET deploy Schemas as well - even if there are no changes to it. To deploy
Schemas, the current Schemas assemblymust be undeplyed, and therefore, the Maps assembly
must also be undeployed. So VS.NET will Undeploy Orchestrations, Undeploy Maps, Undeploy
Schemas, Deploy Schemas, Deploy Orchestrations.&amp;nbsp;This isn't acceptable, because
Maps isn't deployed anymore. If I then deploy Maps, the same thing happens, only the
Orchestrations gets undeployed and it isn't redeployed. To me, VS.NET should ONLY
interfere like that if I deploy the entire solution. If I deploy just project, then
just let me do so! Right now, I would have to let Orchestrations reference Maps even
if it isn't necessary and then always deploy Orchestrations.&lt;/li&gt;
&lt;li&gt;
Restart Host Instances only once. Right now, if I deploye my solution from VS.NET,
and this solution has 10 proejcts that are all set to "Restart Host Instances" on
deployment, then the host instances will get restarted 10 times. Would be nice if
VS.NET could figure this out and only do it once.&lt;/li&gt;
&lt;li&gt;
Specify the node that is body, when using enveloping and not just the parent. It makes
great sense, that I can specify a node and all child elements are then submitted as
seperate messages from the receive pipeline. This is how we can receive orders, invoices,
etc. in the same XML. BUT, if I receive XML where I only need the Orders, then I would
like to point at the Orders element so that is all I get. Right now I have to use
standard enveloping, and implement logic to just delete the invoices, etc. Not really
nice, I think.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
That's it for now :-)
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=52d63060-73ae-4ebf-b45d-c0c97edea756" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,52d63060-73ae-4ebf-b45d-c0c97edea756.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=7d789f06-d9de-4149-9e1b-11f91613b768</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,7d789f06-d9de-4149-9e1b-11f91613b768.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,7d789f06-d9de-4149-9e1b-11f91613b768.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=7d789f06-d9de-4149-9e1b-11f91613b768</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
A guy on the newsgroups recently needed to create exactly 5 elements in the output
of his map, no matter how many records appeared in the input.
</p>
        <p>
Well, I am always looking for new things to try out, and frankly, my XSLT coding skills
could be better, so I thought I'd give it a shot.
</p>
        <p>
I created a project with the following input schema:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/CreateXRecords_Input.JPG" border="0" />
        </p>
        <p>
The schema is for an XML document, and has a header (1..1), a LoopingRecord (1..1)
and a footer (1..1). The LoopingRecord has a Field5 element, that can appear at most
5 times.
</p>
        <p>
The output schema looks like this:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/CreateXRecords_Output.JPG" border="0" />
        </p>
        <p>
This schema is for a flat file. It baiscally has the same signature as the input schema
- exception being that the Field1 element has minOccurs=5. It MUST be present 5 times
- this is a schema for a positional file.
</p>
        <p>
The map is pretty simple:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/CreateXRecords_Map1.JPG" border="0" />
        </p>
        <p>
Header and footer are mapped using regular mapping techniques. But the Detail-element
is created using a custom scripting functoid.
</p>
        <p>
The string concatenate functoid only has one input, the string "5". This is because
I want to create exactly 5 elements in the ouput.
</p>
        <p>
The custom scripting functoid is an "Inline XSLT Call TEmplate" scripting functoid
with the following code:
</p>
        <p>
&lt;xsl:template name="CreateXElements"&gt;<br />
   &lt;xsl:param name="totalCount" /&gt;<br />
      &lt;Detail&gt;<br />
         &lt;xsl:for-each select="/*[local-name()='InputRoot']/*[local-name()='LoopingRecord']/*[local-name()='Field5']"&gt;<br />
            &lt;DetailLoop&gt;<br />
               &lt;Field1&gt;&lt;xsl:value-of
select="text()" /&gt;&lt;/Field1&gt;<br />
            &lt;/DetailLoop&gt;<br />
         &lt;/xsl:for-each&gt;<br />
         &lt;xsl:variable name="countRecords"
select="count(/*[local-name()='InputRoot']/*[local-name()='LoopingRecord']/*[local-name()='Field5'])"
/&gt;<br />
         &lt;xsl:if test="$countRecords&amp;lt;$totalCount
+ 1"&gt;<br />
            &lt;xsl:call-template
name="BuildTheRest"&gt;<br />
               &lt;xsl:with-param
name="counter"&gt;&lt;xsl:value-of select="$countRecords + 1" /&gt;&lt;/xsl:with-param&gt;<br />
               &lt;xsl:with-param
name="totalCount"&gt;&lt;xsl:value-of select="$totalCount" /&gt;&lt;/xsl:with-param&gt;<br />
            &lt;/xsl:call-template&gt;<br />
         &lt;/xsl:if&gt;<br />
      &lt;/Detail&gt;<br />
&lt;/xsl:template&gt;<br />
&lt;xsl:template name="BuildTheRest"&gt;<br />
   &lt;xsl:param name="counter" /&gt;<br />
   &lt;xsl:param name="totalCount" /&gt;<br />
      &lt;DetailLoop&gt;<br />
         &lt;Field1&gt;&lt;/Field1&gt;<br />
      &lt;/DetailLoop&gt;<br />
      &lt;xsl:if test="$counter&amp;lt;$totalCount"&gt;<br />
         &lt;xsl:call-template name="BuildTheRest"&gt;<br />
            &lt;xsl:with-param
name="newCounter"&gt;&lt;xsl:value-of select="$counter + 1" /&gt;&lt;/xsl:with-param&gt;<br />
         &lt;/xsl:call-template&gt;<br />
      &lt;/xsl:if&gt;<br />
&lt;/xsl:template&gt;
</p>
        <p>
Basically, I start by copying existing nodes to the destination. As I have explained
in <a href="http://blog.eliasen.dk/PermaLink,guid,44fab7d1-edde-4d75-b477-6e1dc676c34a.aspx">this
post</a> you need to use XSLT for the whole thing. You can't copy the existing nodes
using the mapper and create the new nodes using XSLT. After the existing nodes have
been copied, I create the new empty nodes, by recursively calling a template that
will create a single element for me. 
</p>
        <p>
You can find my entire project here: <a href="http://blog.eliasen.dk/content/binary/CreateXNumberOfElements.zip">CreateXNumberOfElements.zip
(23.33 KB)</a></p>
        <p>
I hope this will come in handy for someone in the future.
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=7d789f06-d9de-4149-9e1b-11f91613b768" />
      </body>
      <title>Creating a specific number of elements in destination of map.</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,7d789f06-d9de-4149-9e1b-11f91613b768.aspx</guid>
      <link>http://blog.eliasen.dk/2007/10/06/CreatingASpecificNumberOfElementsInDestinationOfMap.aspx</link>
      <pubDate>Sat, 06 Oct 2007 22:09:42 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
A guy on the newsgroups recently needed to create exactly 5 elements in the output
of his map, no matter how many records appeared in the input.
&lt;/p&gt;
&lt;p&gt;
Well, I am always looking for new things to try out, and frankly, my XSLT coding skills
could be better, so I thought I'd give it a shot.
&lt;/p&gt;
&lt;p&gt;
I created a project with the following input schema:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/CreateXRecords_Input.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
The schema is for an XML document, and has a header (1..1), a LoopingRecord (1..1)
and a footer (1..1). The LoopingRecord has a Field5 element, that can appear at most
5 times.
&lt;/p&gt;
&lt;p&gt;
The output schema looks like this:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/CreateXRecords_Output.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
This schema is for a flat file. It baiscally has the same signature as the input schema
- exception being that the Field1 element has minOccurs=5. It MUST be present 5 times
- this is a schema for a positional file.
&lt;/p&gt;
&lt;p&gt;
The map is pretty simple:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/CreateXRecords_Map1.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Header and footer are mapped using regular mapping techniques. But the Detail-element
is created using a custom scripting functoid.
&lt;/p&gt;
&lt;p&gt;
The string concatenate functoid only has one input, the string "5". This is because
I want to create exactly 5 elements in the ouput.
&lt;/p&gt;
&lt;p&gt;
The custom scripting functoid is an "Inline XSLT Call TEmplate" scripting functoid
with the following code:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;xsl:template name="CreateXElements"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:param name="totalCount" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Detail&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:for-each select="/*[local-name()='InputRoot']/*[local-name()='LoopingRecord']/*[local-name()='Field5']"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;DetailLoop&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Field1&amp;gt;&amp;lt;xsl:value-of
select="text()" /&amp;gt;&amp;lt;/Field1&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/DetailLoop&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/xsl:for-each&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:variable name="countRecords"
select="count(/*[local-name()='InputRoot']/*[local-name()='LoopingRecord']/*[local-name()='Field5'])"
/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:if test="$countRecords&amp;amp;lt;$totalCount
+ 1"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:call-template
name="BuildTheRest"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:with-param
name="counter"&amp;gt;&amp;lt;xsl:value-of select="$countRecords + 1" /&amp;gt;&amp;lt;/xsl:with-param&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:with-param
name="totalCount"&amp;gt;&amp;lt;xsl:value-of select="$totalCount" /&amp;gt;&amp;lt;/xsl:with-param&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/xsl:call-template&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/xsl:if&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Detail&amp;gt;&lt;br&gt;
&amp;lt;/xsl:template&amp;gt;&lt;br&gt;
&amp;lt;xsl:template name="BuildTheRest"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:param name="counter" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:param name="totalCount" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;DetailLoop&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Field1&amp;gt;&amp;lt;/Field1&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/DetailLoop&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:if test="$counter&amp;amp;lt;$totalCount"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:call-template name="BuildTheRest"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:with-param
name="newCounter"&amp;gt;&amp;lt;xsl:value-of select="$counter + 1" /&amp;gt;&amp;lt;/xsl:with-param&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/xsl:call-template&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/xsl:if&amp;gt;&lt;br&gt;
&amp;lt;/xsl:template&amp;gt;
&lt;/p&gt;
&lt;p&gt;
Basically, I start by copying existing nodes to the destination. As I have explained
in &lt;a href="http://blog.eliasen.dk/PermaLink,guid,44fab7d1-edde-4d75-b477-6e1dc676c34a.aspx"&gt;this
post&lt;/a&gt; you need to use XSLT for the whole thing. You can't copy the existing nodes
using the mapper and create the new nodes using XSLT. After the existing nodes have
been copied, I create the new empty nodes, by recursively calling a template that
will create a single element for me. 
&lt;/p&gt;
&lt;p&gt;
You can find my entire project here: &lt;a href="http://blog.eliasen.dk/content/binary/CreateXNumberOfElements.zip"&gt;CreateXNumberOfElements.zip
(23.33 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I hope this will come in handy for someone in the future.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=7d789f06-d9de-4149-9e1b-11f91613b768" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,7d789f06-d9de-4149-9e1b-11f91613b768.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=9ad2375f-9887-4eb3-9ec4-1b00e8e2993d</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,9ad2375f-9887-4eb3-9ec4-1b00e8e2993d.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,9ad2375f-9887-4eb3-9ec4-1b00e8e2993d.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=9ad2375f-9887-4eb3-9ec4-1b00e8e2993d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
An old collegue of mine asked me if there wasn't anyhow he could overwrite the folder
of a send port using the FILE adapter, so that he could decide the entire path
of a file that was to be written from within his orchestration.
</p>
        <p>
After all, you can overwrite many things, like SMTP server to be used in the send
port or the username and password for an FTP connection. So why not the file folder?
</p>
        <p>
Well, I have investigated it a little bit, and I can't get around to making BizTalk
do it.
</p>
        <p>
I tried:
</p>
        <ol>
          <li>
Set the folder on the send port blank, and use the %SourceFileName% as filename and
set its value (The FILE.ReceivedFileName property of the message) inside the orchestration.
This isn't valid, since the folder path can not be empty.</li>
          <li>
Set the folder to c:\ and set the FILE.ReceivedFileName property to be &lt;directory&gt;
+ "\\" + &lt;filename&gt;. This didn't work either. When writing the file, BizTalk
strips all folder names from the FILE.ReceivedFileName value and just wrote the file
with filename in c:\</li>
        </ol>
        <p>
Off course, you can use a dynamic port to do it, but this customer wanted to avoid
seeing all those subscriptions in the subscription viewer.
</p>
        <p>
So I don't see a way around it. And basically, when you know it works like this, it
makes sense that the administrator who has decided what folder files go into also
gets to decide that you can not overwrite this. Oh well, that's life.
</p>
        <p>
Hope this helps someone at some point...
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=9ad2375f-9887-4eb3-9ec4-1b00e8e2993d" />
      </body>
      <title>Overwriting adapter properties</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,9ad2375f-9887-4eb3-9ec4-1b00e8e2993d.aspx</guid>
      <link>http://blog.eliasen.dk/2007/09/18/OverwritingAdapterProperties.aspx</link>
      <pubDate>Tue, 18 Sep 2007 20:29:23 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
An old collegue of mine asked me if there wasn't anyhow he could overwrite the folder
of a send port using the FILE adapter, so that he could&amp;nbsp;decide the entire path
of a file that was to be written from within his orchestration.
&lt;/p&gt;
&lt;p&gt;
After all, you can overwrite many things, like SMTP server to be used in the send
port or the username and password for an FTP connection. So why not the file folder?
&lt;/p&gt;
&lt;p&gt;
Well, I have investigated it a little bit, and I can't get around to making BizTalk
do it.
&lt;/p&gt;
&lt;p&gt;
I tried:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Set the folder on the send port blank, and use the %SourceFileName% as filename and
set its value (The FILE.ReceivedFileName property of the message) inside the orchestration.
This isn't valid, since the folder path can not be empty.&lt;/li&gt;
&lt;li&gt;
Set the folder to c:\ and set the FILE.ReceivedFileName property to be &amp;lt;directory&amp;gt;
+ "\\" + &amp;lt;filename&amp;gt;. This didn't work either. When writing the file, BizTalk
strips all folder names from the FILE.ReceivedFileName value and just wrote the file
with filename in c:\&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Off course, you can use a dynamic port to do it, but this customer wanted to avoid
seeing all those subscriptions in the subscription viewer.
&lt;/p&gt;
&lt;p&gt;
So I don't see a way around it. And basically, when you know it works like this, it
makes sense that the administrator who has decided what folder files go into also
gets to decide that you can not overwrite this. Oh well, that's life.
&lt;/p&gt;
&lt;p&gt;
Hope this helps someone at some point...
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=9ad2375f-9887-4eb3-9ec4-1b00e8e2993d" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,9ad2375f-9887-4eb3-9ec4-1b00e8e2993d.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=c785cba2-0e4c-4973-a752-8dbaae1ee408</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,c785cba2-0e4c-4973-a752-8dbaae1ee408.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,c785cba2-0e4c-4973-a752-8dbaae1ee408.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=c785cba2-0e4c-4973-a752-8dbaae1ee408</wfw:commentRss>
      <title>Promoting reoccuring elements</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,c785cba2-0e4c-4973-a752-8dbaae1ee408.aspx</guid>
      <link>http://blog.eliasen.dk/2007/09/16/PromotingReoccuringElements.aspx</link>
      <pubDate>Sun, 16 Sep 2007 21:22:51 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;Well,
I suppose we have all been there – in order to get the business process running, a
specific element from a schema needs to be promoted in order to route on it, correlate
on it, and so on.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Unfortunately,
elements that can occur more than once can not be promoted. This, off course, makes
perfectly sense, since the property can only hold one value, and how would BizTalk
know which one of the many occurring elements to take the value from at runtime? So
we agree with the limitation, but hope for a nice solution. :-)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;If
you try to promote a reoccurring element, you get this error when adding it to the
list of promoted properties:&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/promote_reoccuring_element_error.jpg" border=0&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;“This
node can occur potentially multiple times in the instance document. Only nodes which
are guaranteed to be unique can be promoted.”&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Right.
Now, some people have found the editor for the XPath describing the element that one
wants to promote. If you have promoted some element, you can click on it like this:&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/promote_reoccuring_element_editor1.JPG" border=0&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Then
you can click on the dot at the right of the line, and get into the editor like this:&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/promote_reoccuring_element_editor2.JPG" border=0&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Now,
wouldn’t it be lovely, if you could just change this expression to include for instance
an index on the reoccurring element? In my example from this screenshot, the “ReoccuringRecord”
record can occur multiple times. So it would be nice, if I could just change the XPath
to be like this:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;/*[local-name()='ExampleRoot'
and namespace-uri()='http://PromotingReoccuringElement.ExampleSchema']/*[local-name()='ReoccuringRecord'
and namespace-uri()=''][1]/*[local-name()=’ElementWhereNumber1IsPromoted’ and namespace-uri()='']&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;By
setting the “[1]” into the XPath, I state that I will be needing the first occurrence
of the ReoccuringRecord and therefore, this XPath expression will always give me exactly
one node. Unfortunately, the engine can not see this, so the error will be the same,
only difference being that this error doesn’t occur until compile time:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Node
"ElementWhereNumber1IsPromoted" - The promoted property field or one of its parents
has Max Occurs greater than 1. Only nodes that are guaranteed to be unique can be
promoted as property fields.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;strong&gt;Bummer!&lt;o:p&gt;&lt;/o:p&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;So
how do we get this working? If I really need to promote a value that occurs in an
element that might occur multiple times, I see four options:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;ol style="MARGIN-TOP: 0cm" type=1&gt;
&lt;li class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Map
to a schema on receive port&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Custom
pipeline component&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Orchestration
to do it and then publish to MessageBox&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Call
pipeline from orchestration&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;I will go these options in more
detail here:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;h3 class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;Option
1: Map to a schema on receive port.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/h3&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;When
a map is executed on a receive port, some extra magic functionality is performed by
BizTalk. After the map has been executed, the message is sent through some code that
promotes properties that are specified inside the destination schema. If you execute
a map inside an orchestration, this doesn’t happen.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;So
you can create a schema that&amp;nbsp;has an extra field, in which you place the value
that needs to be promoted. This element must not be able to occur multiple times.
Promote this new field, and after the map on the receive port has been executed, you
have your value promoted.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;h3 class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;Option
2: Custom Pipeline Component.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/h3&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;It
isn’t that difficult to create a custom pipeline component, that can promote a field
for you. Your Execute method might look just like this:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;public
Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(IPipelineContext pContext,
Microsoft.BizTalk.Message.Interop.IBaseMessage pInMsg)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;pInMsg.Context.Promote("MyProp",
"http://ReoccuringElement.PropertySchema", "MyValue");&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;return
pInMsg;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Of
course, you will probably want to load the body stream of the IBaseMessage somehow,
in order to find the value inside the body to promote and then replace "MyValue" with
the value form within the XML.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Just
use the pipeline component inside a custom receive pipeline, and you are all set.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;h3 class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;Option
3: Orchestration to do it and then publish to MessageBox&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/h3&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Create
a intermediate orchestration, that gets the input message. Then, it should create
a new message of the same type in a message assignment shape like this:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;NewMessage
= InputMessage;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;NewMessage(*)
= InputMessage(*);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;NewMessage(MyNewProperty)
= xpath(InputMessage, xpathexpression);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Then,
use a direct bound port to publish the message to the MessageBox. In order for the
new property to follow the message, you need to initialize a correlation set on the
send shape that is based on this new property.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Let
other orchestrations and send ports subscribe to this message and let then do their
work.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;h3 class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;Option
4: Call pipeline from orchestration&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/h3&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;The
last option is to call a receive pipeline from within your orchestration. This requires
a new schema, that has a field for the value to be promoted, just as in option 1.
Inside your orchestration, map the input message to this new schema, and call a receive
pipeline with this new message as a parameter. Remember to promote the field in this
new schema. There is an article on MSDN about calling a pipeline from within an orchestration,
which can be found at &lt;/font&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa562035.aspx"&gt;&lt;font face="Times New Roman" color=#800080 size=3&gt;http://msdn2.microsoft.com/en-us/library/aa562035.aspx&lt;/font&gt;&lt;/a&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;h2 class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;Upsides
and downsides&lt;/span&gt;
&lt;/h2&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;In order to choose which way to
go in a specific solution, several things need to be considered.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;Basically, I'd go for option 1 almost
anytime. This is because it is best practices to map anything incoming into a canonical
schema anyway. So instead of promoting values inside all your partners schemas - schemas
they might change, you should promote from within your own canonical schema.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;Reasons not to choose option 1 include:
The canonical schema also has a reoccurring element, so it hasn't provided extra functionality
with regards to getting this specific value promoted. Or perhaps, we aren't using
canonical schemas, because there was no time for this when the project was started.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;If we can't go for number 1, I'd
go for number 3. Number 2 requires programming of a pipeline component, which can
be a bottleneck, unless done correct. Also, the pipeline component is a whole new
component to maintain, document and test. Number 4 requires a new schema and therefore
also&amp;nbsp;a map to be built. If I am ready to do this, I'd go for number&amp;nbsp;1 instead.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;span lang=EN-GB style="mso-ansi-language: EN-GB"&gt;If I don't like number 3, for unknown
reasons, I'd go for option 2 - the custom pipeline component. Allthough it is custom
code, and must be done right, and testet and everything... I still feel that creating
a new schema and map in order to call the pipeline in option 4 is overkill, since
I'd go for option number 1 instead, which would also require the new schema and map.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
I hope this explains some details about this issue, and that it helps someone in the
future.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=c785cba2-0e4c-4973-a752-8dbaae1ee408" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,c785cba2-0e4c-4973-a752-8dbaae1ee408.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=f4306b11-74b0-41f5-93e9-224d84405af0</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,f4306b11-74b0-41f5-93e9-224d84405af0.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,f4306b11-74b0-41f5-93e9-224d84405af0.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=f4306b11-74b0-41f5-93e9-224d84405af0</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
The other day, I suddenly found myself in a situation, where I needed to use the "Find
message" functionality and HAT to find a message, and I needed to filter on a promoted
property.
</p>
        <p>
My problems started appearing, when there were no promoted properties to select in
the Message properties filter view. I had chosen my schema, but still, the dropdowns
for promoted properties were empty.
</p>
        <p>
So I checked that tracking of both message bodies and promoted properties were enabled
in the receive port. Yes, they were... so I started wondering what might be the cause
of this. And then I though: Oh yeah, you need to enable tracking of these individually
in HAT. But in HAT I couldn't find anywhere to enable this. That stunned me for a
couple of minutes. Turns out, that was in BizTalk 2004 :-S
</p>
        <p>
Whoops :-)
</p>
        <p>
And the I remembered that I needed to do two things in order to get the tracking of
promoted properties to work:
</p>
        <p>
The first is to enable the tracking in the receive port:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/TrackingReceivePort.JPG" border="0" />
        </p>
        <p>
And the second thing is to enable tracking of each specific promoted property - and
now I remembered it isn't in HAT anymore, it is in BizTalk Server Administration for
each schema. So open BizTalk Server Administration. Go to the application that has
the schema, for which you need to track promoted properties. Go to the schemas collection
of this application, double click on the appropriate schema, go to the tracking pane,
and here you must select the properties to track.
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/TrackingSchemas.JPG" border="0" />
        </p>
        <p>
I googled this a lot, but had great difficulty finding any information... that's the
reason for this post.
</p>
        <p>
I hope others will find it useful in the future.
</p>
        <p>
Comments are welcome
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=f4306b11-74b0-41f5-93e9-224d84405af0" />
      </body>
      <title>Tracking Promoted Properties and using them in HAT</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,f4306b11-74b0-41f5-93e9-224d84405af0.aspx</guid>
      <link>http://blog.eliasen.dk/2007/08/23/TrackingPromotedPropertiesAndUsingThemInHAT.aspx</link>
      <pubDate>Thu, 23 Aug 2007 19:46:55 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
The other day, I suddenly found myself in a situation, where I needed to use the "Find
message" functionality and HAT to find a message, and I needed to filter on a promoted
property.
&lt;/p&gt;
&lt;p&gt;
My problems started appearing, when there were no promoted properties to select in
the Message properties filter view. I had chosen my schema, but still, the dropdowns
for promoted properties were empty.
&lt;/p&gt;
&lt;p&gt;
So I checked that tracking of both message bodies and promoted properties were enabled
in the receive port. Yes, they were... so I started wondering what might be the cause
of this. And then I though: Oh yeah, you need to enable tracking of these individually
in HAT. But in HAT I couldn't find anywhere to enable this. That stunned me for a
couple of minutes. Turns out, that was in BizTalk 2004 :-S
&lt;/p&gt;
&lt;p&gt;
Whoops :-)
&lt;/p&gt;
&lt;p&gt;
And the I remembered that I needed to do two things in order to get the tracking of
promoted properties to work:
&lt;/p&gt;
&lt;p&gt;
The first is to enable the tracking in the receive port:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/TrackingReceivePort.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
And the second thing is to enable tracking of each specific promoted property - and
now I remembered it isn't in HAT anymore, it is in BizTalk Server Administration for
each schema. So open BizTalk Server Administration. Go to the application that has
the schema, for which you need to track promoted properties. Go to the schemas collection
of this application, double click on the appropriate schema, go to the tracking pane,
and here you must select the properties to track.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/TrackingSchemas.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
I googled this a lot, but had great difficulty finding any information... that's the
reason for this post.
&lt;/p&gt;
&lt;p&gt;
I hope others will find it useful in the future.
&lt;/p&gt;
&lt;p&gt;
Comments are welcome
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=f4306b11-74b0-41f5-93e9-224d84405af0" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,f4306b11-74b0-41f5-93e9-224d84405af0.aspx</comments>
      <category>BizTalk 2004</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=005ab036-cef6-47de-aaa0-fa534dbfb960</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,005ab036-cef6-47de-aaa0-fa534dbfb960.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,005ab036-cef6-47de-aaa0-fa534dbfb960.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=005ab036-cef6-47de-aaa0-fa534dbfb960</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
I have just written a <a href="http://blog.eliasen.dk/PermaLink,guid,31e28fa8-d2dc-4eb2-98e5-423bc8d7188c.aspx">blog
post</a> about using the SQL Adapter Wizard and during my tests for this post, I found
the cause of an error that I saw someone in the newsgroups ask about. So I will just
post the answer here.
</p>
        <p>
I got these errors when compiling my project, in which I have used the SQL Adapter
Wizard twice to create a schema for me:
</p>
        <p>
Error 1 illegal name-hiding: 'Orchestration_1' hides 'SQLAdapter.Orchestration_1'
on line 101 C:\Projects\BTS 2006\BlogEntries\SQLAdapter\BizTalk Orchestration_1.odx 102 23 
</p>
        <p>
Error 2 symbol 'Orchestration_1' is already defined; the first definition
is in file C:\Projects\BTS 2006\BlogEntries\SQLAdapter\BizTalk Orchestration.odx on
line 101 C:\Projects\BTS 2006\BlogEntries\SQLAdapter\BizTalk Orchestration_1.odx 102 23
</p>
        <p>
It turns out, that when you use the SQL Adapter Wizard to automatically create schemas
for you, then an orchestration is also created for you. Yes, I knew that, you say?
Well, so did I :-) What I didn't know was that the Wizard is clever enough to give
the two orchestrations different filenames, but stupid enough to give them both the
.NET type name "Orchestration_1". So when compiling the project, you have two orchestrations
with the same fully qualified typename, which off course will fail.
</p>
        <p>
See this screenshot:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/illegal_namehiding.JPG" border="0" />
        </p>
        <p>
As you can see at the lower right vorner of the picture, the "BizTalk Orchestration_1.odx"
has "Orchestration_1" as its typename. Well, "BizTalk Orchestration.odx" has the same.
</p>
        <p>
"So I just change one of them, no problem", you say? Well, there is another problem... If
you look at the port types and multi-part message types in each orchestration, they
are also given the same names. So changing the typename of one of the orchestrations
removes the compilation error, but it will just give you the next set of errors, as
more things are given the same name, and therefor more illegal name-hiding is taking
place. Se the post <a href="http://blog.eliasen.dk/PermaLink,guid,31e28fa8-d2dc-4eb2-98e5-423bc8d7188c.aspx">here</a> about
what you can do to rename things.
</p>
        <p>
I hope this helps someone.
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=005ab036-cef6-47de-aaa0-fa534dbfb960" />
      </body>
      <title>Illegal name-hiding and symbol is already defined errors</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,005ab036-cef6-47de-aaa0-fa534dbfb960.aspx</guid>
      <link>http://blog.eliasen.dk/2007/04/09/IllegalNamehidingAndSymbolIsAlreadyDefinedErrors.aspx</link>
      <pubDate>Mon, 09 Apr 2007 21:40:56 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
I have just written a &lt;a href="http://blog.eliasen.dk/PermaLink,guid,31e28fa8-d2dc-4eb2-98e5-423bc8d7188c.aspx"&gt;blog
post&lt;/a&gt; about using the SQL Adapter Wizard and during my tests for this post, I found
the cause of an error that I saw someone in the newsgroups ask about. So I will just
post the answer here.
&lt;/p&gt;
&lt;p&gt;
I got these errors when compiling my project, in which I have used the SQL Adapter
Wizard twice to create a schema for me:
&lt;/p&gt;
&lt;p&gt;
Error&amp;nbsp;1&amp;nbsp;illegal name-hiding: 'Orchestration_1' hides 'SQLAdapter.Orchestration_1'
on line 101&amp;nbsp;C:\Projects\BTS 2006\BlogEntries\SQLAdapter\BizTalk Orchestration_1.odx&amp;nbsp;102&amp;nbsp;23&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Error&amp;nbsp;2&amp;nbsp;symbol 'Orchestration_1' is already defined; the first definition
is in file C:\Projects\BTS 2006\BlogEntries\SQLAdapter\BizTalk Orchestration.odx on
line 101&amp;nbsp;C:\Projects\BTS 2006\BlogEntries\SQLAdapter\BizTalk Orchestration_1.odx&amp;nbsp;102&amp;nbsp;23
&lt;/p&gt;
&lt;p&gt;
It turns out, that when you use the SQL Adapter Wizard to automatically create schemas
for you, then an orchestration is also created for you. Yes, I knew that, you say?
Well, so did I :-) What I didn't know was that the Wizard is clever enough to give
the two orchestrations different filenames, but stupid enough to give them both the
.NET type name "Orchestration_1". So when compiling the project, you have two orchestrations
with the same fully qualified typename, which off course will fail.
&lt;/p&gt;
&lt;p&gt;
See this screenshot:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/illegal_namehiding.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
As you can see at the lower right vorner of the picture, the "BizTalk Orchestration_1.odx"
has "Orchestration_1" as its typename. Well, "BizTalk Orchestration.odx" has the same.
&lt;/p&gt;
&lt;p&gt;
"So I just change one of them, no problem", you say? Well, there is another problem...&amp;nbsp;If
you look at the port types and multi-part message types in each orchestration, they
are also given the same names. So changing the typename of one of the orchestrations
removes the compilation error, but it will just give you the next set of errors, as
more things are given the same name, and therefor more illegal name-hiding is taking
place. Se the post &lt;a href="http://blog.eliasen.dk/PermaLink,guid,31e28fa8-d2dc-4eb2-98e5-423bc8d7188c.aspx"&gt;here&lt;/a&gt; about
what you can do to rename things.
&lt;/p&gt;
&lt;p&gt;
I hope this helps someone.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=005ab036-cef6-47de-aaa0-fa534dbfb960" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,005ab036-cef6-47de-aaa0-fa534dbfb960.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=31e28fa8-d2dc-4eb2-98e5-423bc8d7188c</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,31e28fa8-d2dc-4eb2-98e5-423bc8d7188c.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,31e28fa8-d2dc-4eb2-98e5-423bc8d7188c.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=31e28fa8-d2dc-4eb2-98e5-423bc8d7188c</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
When using the SQL Adapter wizard to generate schemas for updategrams, queries or
calling stored procedures, the wizard will create an orhestration and a schema for
you in your project. The orchestration is named BizTalk Orchestration.odx (or if this
allready exists, then it will add _1, _2 and so on) and the xsd will be called
SQLService_&lt;chosen_rootnode_in_wizard&gt;.xsd
</p>
        <p>
These names are of course not useful in most scenarios, since most projects have naming
conventions that must be followed. Moreover, the orchestration is often just annoying,
since the database read/update usually must happen in an allready existing orchestration.
</p>
        <p>
What you should do is this:
</p>
        <ol>
          <li>
Rename the xsd to follow your naming conventions</li>
          <li>
Rename the typename of the schema to match the filename</li>
          <li>
Open the automatically created orchestration, and:</li>
        </ol>
        <ul>
          <li>
Update the parts of the two created multi-part messages to point to the new typename
of the schema</li>
          <li>
Rename the port type that is created to something meaningful</li>
          <li>
Rename the multi-part message types that are created to be more meaningful.</li>
          <li>
The last two steps are very important, if you plan to use the SQL Adapter more
than once in the same orchestration, since otherwise you will get type names in both
generated orchestrations that are the same. And this isn't allowed, off course.</li>
        </ul>
        <li>
Cut and paste the port type and multi-part message types from BizTalk Orchestration.odx
to the orchestration where you actually need them.</li>
        <li>
Delete the BizTalk Orchestration.odx file, since it is no longer needed.</li>
        <p>
So basically, the automatically created names of things when using the SQL Adapter
Wizard are useless. And also, the created orchestration is useless after moving the
automatically created types away from it.
</p>
        <p>
I hope this is useful for someone at some point.
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=31e28fa8-d2dc-4eb2-98e5-423bc8d7188c" />
      </body>
      <title>Notes about using the SQL Adapter Wizard</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,31e28fa8-d2dc-4eb2-98e5-423bc8d7188c.aspx</guid>
      <link>http://blog.eliasen.dk/2007/04/09/NotesAboutUsingTheSQLAdapterWizard.aspx</link>
      <pubDate>Mon, 09 Apr 2007 21:27:38 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
When using the SQL Adapter wizard to generate schemas for updategrams, queries or
calling stored procedures, the wizard will create an orhestration and a schema for
you in your project. The orchestration is named BizTalk Orchestration.odx (or if this
allready exists, then it will add _1, _2 and so on)&amp;nbsp;and the xsd will be called
SQLService_&amp;lt;chosen_rootnode_in_wizard&amp;gt;.xsd
&lt;/p&gt;
&lt;p&gt;
These names are of course not useful in most scenarios, since most projects have naming
conventions that must be followed. Moreover, the orchestration is often just annoying,
since the database read/update usually must happen in an allready existing orchestration.
&lt;/p&gt;
&lt;p&gt;
What you should do is this:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Rename the xsd to follow your naming conventions&lt;/li&gt;
&lt;li&gt;
Rename the typename of the schema to match the filename&lt;/li&gt;
&lt;li&gt;
Open the automatically created orchestration, and:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
Update the parts of the two created multi-part messages to point to the new typename
of the schema&lt;/li&gt;
&lt;li&gt;
Rename the port type that is created to something meaningful&lt;/li&gt;
&lt;li&gt;
Rename the multi-part message types that are created to be more meaningful.&lt;/li&gt;
&lt;li&gt;
The&amp;nbsp;last two steps are very important, if you plan to use the SQL Adapter more
than once in the same orchestration, since otherwise you will get type names in both
generated orchestrations that are the same. And this isn't allowed, off course.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Cut and paste the port type and multi-part message types from BizTalk Orchestration.odx
to the orchestration where you actually need them.&lt;/li&gt;
&lt;li&gt;
Delete the BizTalk Orchestration.odx file, since it is no longer needed.&lt;/li&gt;&gt;
&lt;p&gt;
So basically, the automatically created names of things when using the SQL Adapter
Wizard are useless. And also, the created orchestration is useless after moving the
automatically created types away from it.
&lt;/p&gt;
&lt;p&gt;
I hope this is useful for someone at some point.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=31e28fa8-d2dc-4eb2-98e5-423bc8d7188c" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,31e28fa8-d2dc-4eb2-98e5-423bc8d7188c.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=fa80da9a-9c3e-4be4-9413-f31d715647d8</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,fa80da9a-9c3e-4be4-9413-f31d715647d8.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,fa80da9a-9c3e-4be4-9413-f31d715647d8.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=fa80da9a-9c3e-4be4-9413-f31d715647d8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
I had <a href="http://blog.eliasen.dk/PermaLink,guid,18d3629c-a462-40c3-9b9b-25ef7ef1422b.aspx">post</a> some
time ago, which explained how to promote fields from a schema generated by the SQL
Adapter. This post contains some information that could be useful for people searching
the net for information about changing the records in the generated schema into elements.
A search for those words wouldn't have my post in the top 1000 hits, though :-)
</p>
        <p>
So I thought just to have this simple post with a title that will hopefully match
what people search for, and let them find the information.
</p>
        <p>
That's it :-)
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=fa80da9a-9c3e-4be4-9413-f31d715647d8" />
      </body>
      <title>SQL Adapter, changing records to elements</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,fa80da9a-9c3e-4be4-9413-f31d715647d8.aspx</guid>
      <link>http://blog.eliasen.dk/2007/03/04/SQLAdapterChangingRecordsToElements.aspx</link>
      <pubDate>Sun, 04 Mar 2007 21:01:32 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
I had&amp;nbsp;&lt;a href="http://blog.eliasen.dk/PermaLink,guid,18d3629c-a462-40c3-9b9b-25ef7ef1422b.aspx"&gt;post&lt;/a&gt; some
time ago, which explained how to promote fields from a schema generated by the SQL
Adapter. This post contains some information that could be useful for people searching
the net for information about changing the records in the generated schema into elements.
A search for those words wouldn't have my post in the top 1000 hits, though :-)
&lt;/p&gt;
&lt;p&gt;
So I thought just to have this simple post with a title that will hopefully match
what people search for, and let them find the information.
&lt;/p&gt;
&lt;p&gt;
That's it :-)
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=fa80da9a-9c3e-4be4-9413-f31d715647d8" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,fa80da9a-9c3e-4be4-9413-f31d715647d8.aspx</comments>
      <category>BizTalk 2004</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=0547291d-8622-42eb-9598-7c48102a9f81</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,0547291d-8622-42eb-9598-7c48102a9f81.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,0547291d-8622-42eb-9598-7c48102a9f81.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=0547291d-8622-42eb-9598-7c48102a9f81</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
Sometimes I run into this error, when deploying a BizTalk project from VS.NET: "An
error has occurred while establishing a connection to the server.  When connecting
to SQL Server 2005, this failure may be caused by the fact that under the default
settings SQL Server does not allow remote connections. (provider: Named Pipes Provider,
error: 40 - Could not open a connection to SQL Server)"
</p>
        <p>
I take a quick look at it, bang my head in the desk for doing it again, and then I
perform the following steps:
</p>
        <ol>
          <li>
Rightclick on the project and choose Properties</li>
          <li>
Go to "Configuration Properties" =&gt; "Deployment"</li>
          <li>
Change the "Server" property to be the servername of the SQL Server you are deploying
to</li>
          <li>
Save changes</li>
          <li>
Deploy again</li>
        </ol>
        <p>
This happens if you receive a copy of someone elses project - since the servername
is listed in the projectname.btproj.user file that is a part of the project.
</p>
        <p>
Hope someone else gets quickly past this hurdle now it has been blogged.
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=0547291d-8622-42eb-9598-7c48102a9f81" />
      </body>
      <title>Deployment: An error has occurred while establishing a connection to the server</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,0547291d-8622-42eb-9598-7c48102a9f81.aspx</guid>
      <link>http://blog.eliasen.dk/2007/01/14/DeploymentAnErrorHasOccurredWhileEstablishingAConnectionToTheServer.aspx</link>
      <pubDate>Sun, 14 Jan 2007 20:43:48 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
Sometimes I run into this error, when deploying a BizTalk project from VS.NET: "An
error has occurred while establishing a connection to the server.&amp;nbsp; When connecting
to SQL Server 2005, this failure may be caused by the fact that under the default
settings SQL Server does not allow remote connections. (provider: Named Pipes Provider,
error: 40 - Could not open a connection to SQL Server)"
&lt;/p&gt;
&lt;p&gt;
I take a quick look at it, bang my head in the desk for doing it again, and then I
perform the following steps:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Rightclick on the project and choose Properties&lt;/li&gt;
&lt;li&gt;
Go to "Configuration Properties" =&amp;gt; "Deployment"&lt;/li&gt;
&lt;li&gt;
Change the "Server" property to be the servername of the SQL Server you are deploying
to&lt;/li&gt;
&lt;li&gt;
Save changes&lt;/li&gt;
&lt;li&gt;
Deploy again&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
This happens if you receive a copy of someone elses project - since the servername
is listed in the projectname.btproj.user file that is a part of the project.
&lt;/p&gt;
&lt;p&gt;
Hope someone else gets quickly past this hurdle now it has been blogged.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=0547291d-8622-42eb-9598-7c48102a9f81" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,0547291d-8622-42eb-9598-7c48102a9f81.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=5747039e-54f9-4bd0-84a0-5ce679965b2b</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,5747039e-54f9-4bd0-84a0-5ce679965b2b.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,5747039e-54f9-4bd0-84a0-5ce679965b2b.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=5747039e-54f9-4bd0-84a0-5ce679965b2b</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
I have just had a client who was upgrading from the BizTalk Accelerator for SWIFT
2.3SP1 to the 2006 Message Pack, and it didn't go as expected.
</p>
        <p>
Basically, after upgrading, using the migration guide found at <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5f0a2355-b17f-479c-9b14-f784d5da9a95&amp;DisplayLang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=5f0a2355-b17f-479c-9b14-f784d5da9a95&amp;DisplayLang=en</a>,
it didn't work. A warning appeared in the eventlog when trying an MT541 document:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/swift_error.jpg" border="0" />
        </p>
        <p>
An exeption occured inside the rule engine instance executing policy "MT541_Master_Policy"...
Now, the obvious errors were checked for - the policy WAS deployed and undeploying
it gave a whole new error. So something must go wrong at runtime, evaluating the policy.
The policy only consisted of a single rule, but this rule has plenty of actions. I
tried removing the actions one at the time, in new versions of the policy, and finally
found out that it wouldn't work until I had removed ALL the actions.
</p>
        <p>
So, basically, something must be very wrong.
</p>
        <p>
The solution ended up being doing some assembly binding.
</p>
        <p>
The migration guide states that:
</p>
        <p>
"You must configure the assembly bindings on all computers in your environment using
.NET Framework 1.1. You do not need to configure the assembly bindings for computers
using .NET Framework 2.0. "
</p>
        <p>
BUT, it is wrong! When using BizTalk 2006, which, as we all know, is running under
.NET 2.0, you STILL need to do the assembly binding. You just need to do it using
the .NET 2.0 Configuration instead of the .NET 1.1 Configuration, as written in the
migration guide.
</p>
        <p>
After that, the error disappeared, but another one turned up:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/swift_error2.jpg" border="0" />
        </p>
        <p>
Now I was really mad. This error looks just like the first one, it is just another
policy that is going wrong. Anyway, this turned out to be a known bug... sort of: <a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;928259">http://support.microsoft.com/default.aspx?scid=kb;EN-US;928259</a> -
the KB article states that it is for the Accelerator for SWIFT 2.1 - but actually
it is for the 2006 MEssage Pack and applies to BOTH 2.1 AND 2.3.
</p>
        <p>
So I was really in for a difficult job here - having to go against the migration guide
form Microsoft and installing a hotfix that wasn't for this version of the accelerator.
</p>
        <p>
I had actually given up, and I started a support incident with Microsoft, so all these
steps were done as suggested by the support guy. The support incident hasn't cost
me anything, as you might guess :-)
</p>
        <p>
I hope someone else can benefit from this at some point.
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=5747039e-54f9-4bd0-84a0-5ce679965b2b" />
      </body>
      <title>SWIFT MessagePack 2006 upgrade</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,5747039e-54f9-4bd0-84a0-5ce679965b2b.aspx</guid>
      <link>http://blog.eliasen.dk/2007/01/14/SWIFTMessagePack2006Upgrade.aspx</link>
      <pubDate>Sun, 14 Jan 2007 20:31:43 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
I have just had a client who was upgrading from the BizTalk Accelerator for SWIFT
2.3SP1 to the 2006 Message Pack, and it didn't go as expected.
&lt;/p&gt;
&lt;p&gt;
Basically, after upgrading, using the migration guide found at &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5f0a2355-b17f-479c-9b14-f784d5da9a95&amp;amp;DisplayLang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=5f0a2355-b17f-479c-9b14-f784d5da9a95&amp;amp;DisplayLang=en&lt;/a&gt;,
it didn't work. A warning appeared in the eventlog when trying an MT541 document:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/swift_error.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
An exeption occured inside the rule engine instance executing policy "MT541_Master_Policy"...
Now, the obvious errors were checked for - the policy WAS deployed and undeploying
it gave a whole new error. So something must go wrong at runtime, evaluating the policy.
The policy only consisted of a single rule, but this rule has plenty of actions. I
tried removing the actions one at the time, in new versions of the policy, and finally
found out that it wouldn't work until I had removed ALL the actions.
&lt;/p&gt;
&lt;p&gt;
So, basically, something must be very wrong.
&lt;/p&gt;
&lt;p&gt;
The solution ended up being doing some assembly binding.
&lt;/p&gt;
&lt;p&gt;
The migration guide states that:
&lt;/p&gt;
&lt;p&gt;
"You must configure the assembly bindings on all computers in your environment using
.NET Framework 1.1. You do not need to configure the assembly bindings for computers
using .NET Framework 2.0. "
&lt;/p&gt;
&lt;p&gt;
BUT, it is wrong! When using BizTalk 2006, which, as we all know, is running under
.NET 2.0, you STILL need to do the assembly binding. You just need to do it using
the .NET 2.0 Configuration instead of the .NET 1.1 Configuration, as written in the
migration guide.
&lt;/p&gt;
&lt;p&gt;
After that, the error disappeared, but another one turned up:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/swift_error2.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Now I was really mad. This error looks just like the first one, it is just another
policy that is going wrong. Anyway, this turned out to be a known bug... sort of: &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;928259"&gt;http://support.microsoft.com/default.aspx?scid=kb;EN-US;928259&lt;/a&gt;&amp;nbsp;-
the KB article states that it is for the Accelerator for SWIFT 2.1 - but actually
it is for the 2006 MEssage Pack and applies to BOTH 2.1 AND 2.3.
&lt;/p&gt;
&lt;p&gt;
So I was really in for a difficult job here - having to go against the migration guide
form Microsoft and installing a hotfix that wasn't for this version of the accelerator.
&lt;/p&gt;
&lt;p&gt;
I had actually given up, and I started a support incident with Microsoft, so all these
steps were done as suggested by the support guy. The support incident hasn't cost
me anything, as you might guess :-)
&lt;/p&gt;
&lt;p&gt;
I hope someone else can benefit from this at some point.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=5747039e-54f9-4bd0-84a0-5ce679965b2b" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,5747039e-54f9-4bd0-84a0-5ce679965b2b.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=1bee424b-83ae-4011-91d0-5c1b914804f3</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,1bee424b-83ae-4011-91d0-5c1b914804f3.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,1bee424b-83ae-4011-91d0-5c1b914804f3.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=1bee424b-83ae-4011-91d0-5c1b914804f3</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
I was trying to help someone in the BizTalk newsgroups, creating a flat file schema,
and I ran into this very annoying error message: "Unable to match the data in the
input stream.". I got the error message after having created the schema and trying
to validate an instance, using VS.NET 2005.
</p>
        <p>
I searched and searched... 
</p>
        <ul>
          <li>
Someone needed to set the "parser_optimization" to "complexity" - I had allready done
that. 
</li>
          <li>
Someone else needed to set the "lookahead_depth to 0 - I had also tried that. 
</li>
          <li>
Someone needed to set the input type to "Native" instead of XML. Had that been my
problem, I wouldn't have blogged about it - I'd be too embarassed :-)</li>
        </ul>
        <p>
No, the problem was that I had created parts of the schema using the flat file wizard.
It had set one of my records to have "minOccurs" = 18 and "maxOccurs" = 18 as well.
Since my test instance didn't have that many records in it, I got this error message.
Changing the two 18's to the default 1 solved my problem.
</p>
        <p>
I hope Microsoft considers this and perhaps in future releases find a better error
description :-)
</p>
        <p>
In order to test it, you can just download the working schema: <a href="http://blog.eliasen.dk/content/binary/Exolit_FlatFileSchema.xsd">Exolit_FlatFileSchema.xsd
(91.59 KB)</a> and the test instance: <a href="http://blog.eliasen.dk/content/binary/Instance.txt">Instance.txt
(.72 KB)</a> - it will validate. But try to change the minOccurs and maxOccures
of the "Invoices"-record to "18" - and revalidate.
</p>
        <p>
Anyway... Hope this helps someone in the future.
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=1bee424b-83ae-4011-91d0-5c1b914804f3" />
      </body>
      <title>Unable to match the data in the input stream</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,1bee424b-83ae-4011-91d0-5c1b914804f3.aspx</guid>
      <link>http://blog.eliasen.dk/2007/01/14/UnableToMatchTheDataInTheInputStream.aspx</link>
      <pubDate>Sun, 14 Jan 2007 12:41:33 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
I was trying to help someone in the BizTalk newsgroups, creating a flat file schema,
and I ran into this very annoying error message: "Unable to match the data in the
input stream.". I got the error message after having created the schema and trying
to validate an instance, using VS.NET 2005.
&lt;/p&gt;
&lt;p&gt;
I searched and searched... 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Someone needed to set the "parser_optimization" to "complexity" - I had allready done
that. 
&lt;li&gt;
Someone else needed to set the "lookahead_depth to 0 - I had also tried that. 
&lt;li&gt;
Someone needed to set the input type to "Native" instead of XML. Had that been my
problem, I wouldn't have blogged about it - I'd be too embarassed :-)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
No, the problem was that I had created parts of the schema using the flat file wizard.
It had set one of my records to have "minOccurs" = 18 and "maxOccurs" = 18 as well.
Since my test instance didn't have that many records in it, I got this error message.
Changing the two 18's to the default 1 solved my problem.
&lt;/p&gt;
&lt;p&gt;
I hope Microsoft considers this and perhaps in future releases find a better error
description :-)
&lt;/p&gt;
&lt;p&gt;
In order to test it, you can just download the working schema: &lt;a href="http://blog.eliasen.dk/content/binary/Exolit_FlatFileSchema.xsd"&gt;Exolit_FlatFileSchema.xsd
(91.59 KB)&lt;/a&gt;&amp;nbsp;and the test instance: &lt;a href="http://blog.eliasen.dk/content/binary/Instance.txt"&gt;Instance.txt
(.72 KB)&lt;/a&gt;&amp;nbsp;- it will validate. But try to change the minOccurs and maxOccures
of the "Invoices"-record to "18" - and revalidate.
&lt;/p&gt;
&lt;p&gt;
Anyway... Hope this helps someone in the future.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=1bee424b-83ae-4011-91d0-5c1b914804f3" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,1bee424b-83ae-4011-91d0-5c1b914804f3.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=6c176a27-f1f2-4171-9fad-c37b0f04b3d5</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,6c176a27-f1f2-4171-9fad-c37b0f04b3d5.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,6c176a27-f1f2-4171-9fad-c37b0f04b3d5.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=6c176a27-f1f2-4171-9fad-c37b0f04b3d5</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
Should you ever run into this warning in the eventlog, when using the SQL Adapter
for BizTalk: 
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/Streamingnotsupportedovermultiplecolumnresult.jpg" border="0" />
        </p>
        <p>
your problem is that the SQL Adapter is receiving a result set instead of XML.
</p>
        <p>
There are two possibilities:
</p>
        <ol>
          <li>
As we all know, when using the SQL Adapter to call a stored procedure, you must write
"for xml auto, xmldata" (or some variant - I like the "elements" way of things) in
your Stored Procedure in order to let the schema generator generate a schema for you.
After the schema has been generated, you need to remove the ", xmldata" or else schema
data will be returned every time the SP is called instead of real data. Anyway, sometimes
people remove too much from the SP, ie. they remove the entire "for xml auto, xmldata"
instead of just ", xmldata".</li>
          <li>
Sometimes, someone forgets to write "for xml auto" after a select statement in the
receive location.</li>
        </ol>
        <p>
Both will cause the above mentioned error.
</p>
        <p>
Hope this has helped someone.
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=6c176a27-f1f2-4171-9fad-c37b0f04b3d5" />
      </body>
      <title>Streaming not supported over multiple column result</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,6c176a27-f1f2-4171-9fad-c37b0f04b3d5.aspx</guid>
      <link>http://blog.eliasen.dk/2007/01/05/StreamingNotSupportedOverMultipleColumnResult.aspx</link>
      <pubDate>Fri, 05 Jan 2007 22:07:27 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
Should you ever run into this warning in the eventlog, when using the SQL Adapter
for BizTalk: 
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/Streamingnotsupportedovermultiplecolumnresult.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
your problem is that the SQL Adapter is receiving a result set instead of XML.
&lt;/p&gt;
&lt;p&gt;
There are two possibilities:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
As we all know, when using the SQL Adapter to call a stored procedure, you must write
"for xml auto, xmldata" (or some variant - I like the "elements" way of things) in
your Stored Procedure in order to let the schema generator generate a schema for you.
After the schema has been generated, you need to remove the ", xmldata" or else schema
data will be returned every time the SP is called instead of real data. Anyway, sometimes
people remove too much from the SP, ie. they remove the entire "for xml auto, xmldata"
instead of just ", xmldata".&lt;/li&gt;
&lt;li&gt;
Sometimes, someone forgets to write "for xml auto" after a select statement in the
receive location.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Both will cause the above mentioned error.
&lt;/p&gt;
&lt;p&gt;
Hope this has helped someone.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=6c176a27-f1f2-4171-9fad-c37b0f04b3d5" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,6c176a27-f1f2-4171-9fad-c37b0f04b3d5.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=87efe6ca-a0be-42d6-96d0-7c04f9bf7a3a</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,87efe6ca-a0be-42d6-96d0-7c04f9bf7a3a.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,87efe6ca-a0be-42d6-96d0-7c04f9bf7a3a.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=87efe6ca-a0be-42d6-96d0-7c04f9bf7a3a</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
I have just played quickly with receiving flat files.
</p>
        <p>
Often, people create a receive pipeline for each flat file messagetype that must be
received. This is done because the flat file disassembler needs to know exactly which
document schema is to be used to parse the incoming message, as opposed to the XML
disassembler, which will find the schema at runtime. So instead of having several
flat file disassemblers in one pipeline, often, many pipelines are created.
</p>
        <p>
BUT, I'd just like to point out that with BizTalk 2006, you can change properties
of the pipeline components on a per instance level. So double click on your receive
location, click the ellipsis on the pipeline and go to the "DocumentSpecName" property
of the flat file disassembler. Why they haven't called it "Document Schema" as it
is called in the pipeline designer, I don't know!
</p>
        <p>
Anyway, here you can specify which document schema this pipeline instance should use.
You must specify the fully qualified .NET typename of the schema, however. And it
is a textbox, not a drop down, as in the designer. You can get the .NET typename by
clicking on the .xsd in solution explorer, and taking it from the "Fually Qualified
Name" property.
</p>
        <p>
Hope this was helpful
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=87efe6ca-a0be-42d6-96d0-7c04f9bf7a3a" />
      </body>
      <title>Changing "Document Schema" on pipeline instance</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,87efe6ca-a0be-42d6-96d0-7c04f9bf7a3a.aspx</guid>
      <link>http://blog.eliasen.dk/2006/12/22/ChangingDocumentSchemaOnPipelineInstance.aspx</link>
      <pubDate>Fri, 22 Dec 2006 20:47:24 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
I have just played quickly with receiving flat files.
&lt;/p&gt;
&lt;p&gt;
Often, people create a receive pipeline for each flat file messagetype that must be
received. This is done because the flat file disassembler needs to know exactly which
document schema is to be used to parse the incoming message, as opposed to the XML
disassembler, which will find the schema at runtime. So instead of having several
flat file disassemblers in one pipeline, often, many pipelines are created.
&lt;/p&gt;
&lt;p&gt;
BUT, I'd just like to point out that with BizTalk 2006, you can change properties
of the pipeline components on a per instance level. So double click on your receive
location, click the ellipsis on the pipeline and go to the "DocumentSpecName" property
of the flat file disassembler. Why they haven't called it "Document Schema" as it
is called in the pipeline designer, I don't know!
&lt;/p&gt;
&lt;p&gt;
Anyway, here you can specify which document schema this pipeline instance should use.
You must specify the fully qualified .NET typename of the schema, however. And it
is a textbox, not a drop down, as in the designer.&amp;nbsp;You can get the .NET&amp;nbsp;typename&amp;nbsp;by
clicking on the .xsd in solution explorer, and taking it from the "Fually Qualified
Name" property.
&lt;/p&gt;
&lt;p&gt;
Hope this was helpful
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=87efe6ca-a0be-42d6-96d0-7c04f9bf7a3a" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,87efe6ca-a0be-42d6-96d0-7c04f9bf7a3a.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=18d3629c-a462-40c3-9b9b-25ef7ef1422b</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,18d3629c-a462-40c3-9b9b-25ef7ef1422b.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,18d3629c-a462-40c3-9b9b-25ef7ef1422b.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=18d3629c-a462-40c3-9b9b-25ef7ef1422b</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
When generating a schema based on the SQL Adapter, there are some options for manipulating
the XML.
</p>
        <p>
I always use the "for xml auto, elements" version, because I'm an "element-kind-of-guy".
Others use the "for xml auto" for several reasons:
</p>
        <ol>
          <li>
It is the default 
</li>
          <li>
Attributes create smaller XML 
</li>
          <li>
They like attributes</li>
        </ol>
        <p>
None the less, I'm an "element-kind-of-guy" and I do what I want! :-)
</p>
        <p>
Anyway, the schemas that are the result of this leave my schema with loads of records
instead of elements, meaning that I can not promote the result to distinguished fields.
</p>
        <p>
There is a way of changing this, though... allthough I really don't consider it to
be a nice solution :-)
</p>
        <p>
As an example, I have the following table in a database:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/sql_adapter_records_test_table.JPG" border="0" />
        </p>
        <p>
And I have this stored procedure to get the values:
</p>
        <p>
CREATE PROCEDURE [dbo].[Get_eliasen]<br />
AS<br />
BEGIN<br />
 -- SET NOCOUNT ON added to prevent extra result sets from<br />
 -- interfering with SELECT statements.<br />
 SET NOCOUNT ON;
</p>
        <p>
    -- Insert statements for procedure here<br />
 SELECT * from eliasen for xml auto, elements, xmldata<br />
END
</p>
        <p>
Basically, it returns all rows from the table. The schema generated from this stored
procedure will look like this:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/sql_adapter_records_test_schema_records.JPG" border="0" />
        </p>
        <p>
The "seqno", "field1", "field" and "field3" are records and not elements. If I want
to change them to be elements instead, I need to open the XSD in a text editor and
do this manually:
</p>
        <p>
As an example, I will change the record "seqno" into an elements.
</p>
        <p>
The original XSD looks like this:
</p>
        <p>
&lt;?xml version="1.0"?&gt;<br />
&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
version="1.0" xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"&gt;<br />
  &lt;xs:annotation&gt;<br />
    &lt;xs:appinfo&gt;<br />
      &lt;msbtssql:sqlScript value="exec [Get_eliasen]" xmlns:msbtssql="<a href="http://schemas.microsoft.com/BizTalk/2003">http://schemas.microsoft.com/BizTalk/2003</a>"
/&gt;<br />
    &lt;/xs:appinfo&gt;<br />
  &lt;/xs:annotation&gt;<br />
  &lt;xs:element name="SQLAdaterRecordsTestRequest"&gt;<br />
    &lt;xs:complexType&gt;<br />
      &lt;xs:sequence&gt;<br />
        &lt;xs:element minOccurs="0" maxOccurs="unbounded"
name="eliasen" xmlns:q1="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
type="q1:eliasenType" /&gt;<br />
      &lt;/xs:sequence&gt;<br />
    &lt;/xs:complexType&gt;<br />
  &lt;/xs:element&gt;<br />
  &lt;xs:complexType name="eliasenType"&gt;<br />
    &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;<br />
      &lt;xs:element name="seqno" xmlns:q2="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
type="q2:seqnoType" /&gt;<br />
      &lt;xs:element name="field1" xmlns:q3="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
type="q3:field1Type" /&gt;<br />
      &lt;xs:element name="field2" xmlns:q4="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
type="q4:field2Type" /&gt;<br />
      &lt;xs:element name="field3" xmlns:q5="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
type="q5:field3Type" /&gt;<br />
    &lt;/xs:choice&gt;<br />
  &lt;/xs:complexType&gt;<br />
  &lt;xs:complexType name="seqnoType"&gt;<br />
    &lt;xs:simpleContent&gt;<br />
      &lt;xs:extension base="xs:long" /&gt;<br />
    &lt;/xs:simpleContent&gt;<br />
  &lt;/xs:complexType&gt;<br />
  &lt;xs:complexType name="field1Type"&gt;<br />
    &lt;xs:simpleContent&gt;<br />
      &lt;xs:extension base="xs:string" /&gt;<br />
    &lt;/xs:simpleContent&gt;<br />
  &lt;/xs:complexType&gt;<br />
  &lt;xs:complexType name="field2Type"&gt;<br />
    &lt;xs:simpleContent&gt;<br />
      &lt;xs:extension base="xs:string" /&gt;<br />
    &lt;/xs:simpleContent&gt;<br />
  &lt;/xs:complexType&gt;<br />
  &lt;xs:complexType name="field3Type"&gt;<br />
    &lt;xs:simpleContent&gt;<br />
      &lt;xs:extension base="xs:string" /&gt;<br />
    &lt;/xs:simpleContent&gt;<br />
  &lt;/xs:complexType&gt;<br />
&lt;/xs:schema&gt;
</p>
        <p>
And I will change it into this:
</p>
        <p>
&lt;?xml version="1.0"?&gt;<br />
&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
version="1.0" xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"&gt;<br />
  &lt;xs:annotation&gt;<br />
    &lt;xs:appinfo&gt;<br />
      &lt;msbtssql:sqlScript value="exec [Get_eliasen]" xmlns:msbtssql="<a href="http://schemas.microsoft.com/BizTalk/2003">http://schemas.microsoft.com/BizTalk/2003</a>"
/&gt;<br />
    &lt;/xs:appinfo&gt;<br />
  &lt;/xs:annotation&gt;<br />
  &lt;xs:element name="SQLAdaterRecordsTestRequest"&gt;<br />
    &lt;xs:complexType&gt;<br />
      &lt;xs:sequence&gt;<br />
        &lt;xs:element minOccurs="0" maxOccurs="unbounded"
name="eliasen" xmlns:q1="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
type="q1:eliasenType" /&gt;<br />
      &lt;/xs:sequence&gt;<br />
    &lt;/xs:complexType&gt;<br />
  &lt;/xs:element&gt;<br />
  &lt;xs:complexType name="eliasenType"&gt;<br />
    &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;<br />
      &lt;xs:element name="seqno" type="xs:long" /&gt;<br />
      &lt;xs:element name="field1" xmlns:q3="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
type="q3:field1Type" /&gt;<br />
      &lt;xs:element name="field2" xmlns:q4="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
type="q4:field2Type" /&gt;<br />
      &lt;xs:element name="field3" xmlns:q5="<a href="http://eliasen.dk/SQLAdaterRecordsTest">http://eliasen.dk/SQLAdaterRecordsTest</a>"
type="q5:field3Type" /&gt;<br />
    &lt;/xs:choice&gt;<br />
  &lt;/xs:complexType&gt;<br />
  &lt;xs:complexType name="field1Type"&gt;<br />
    &lt;xs:simpleContent&gt;<br />
      &lt;xs:extension base="xs:string" /&gt;<br />
    &lt;/xs:simpleContent&gt;<br />
  &lt;/xs:complexType&gt;<br />
  &lt;xs:complexType name="field2Type"&gt;<br />
    &lt;xs:simpleContent&gt;<br />
      &lt;xs:extension base="xs:string" /&gt;<br />
    &lt;/xs:simpleContent&gt;<br />
  &lt;/xs:complexType&gt;<br />
  &lt;xs:complexType name="field3Type"&gt;<br />
    &lt;xs:simpleContent&gt;<br />
      &lt;xs:extension base="xs:string" /&gt;<br />
    &lt;/xs:simpleContent&gt;<br />
  &lt;/xs:complexType&gt;<br />
&lt;/xs:schema&gt;
</p>
        <p>
So what have I done?
</p>
        <ol>
          <li>
I Found the definition of the record "seqno". It was based on the type "q2:seqnoType". 
</li>
          <li>
I found where the "seqnoType" type was declared, and noted that it extended "xs:long". 
</li>
          <li>
I changed the type of "seqno" from "q2:seqnoType" to be "xs:long". 
</li>
          <li>
I removed the q2 namespace declaration from the seqno element, as it was no longer
needed. 
</li>
          <li>
I removed the "seqnoType" type declaration, as it was no longer needed.</li>
        </ol>
        <p>
That's it. Save the XSD and reload it in your schema editor - you will get this: 
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/sql_adapter_records_test_schema_elements.JPG" border="0" />
        </p>
        <p>
But it sure would be nice to have the option of just changing it in the properties
of an elements in the schema editor...
</p>
        <p>
Hope this helps someone.
</p>
        <p>
EDIT on the 4'th of march 2007: Remember also that the record just below the root
node must be set as "maxOccurs=1" instead of unbounded. Otherwise, you can not promote
the fields below the record, obviously.
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=18d3629c-a462-40c3-9b9b-25ef7ef1422b" />
      </body>
      <title>Promoting elements from SQL Adapter Schemas</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,18d3629c-a462-40c3-9b9b-25ef7ef1422b.aspx</guid>
      <link>http://blog.eliasen.dk/2006/12/17/PromotingElementsFromSQLAdapterSchemas.aspx</link>
      <pubDate>Sun, 17 Dec 2006 22:42:35 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
When generating a schema based on the SQL Adapter, there are some options for manipulating
the XML.
&lt;/p&gt;
&lt;p&gt;
I always use the "for xml auto, elements" version, because I'm an "element-kind-of-guy".
Others use the "for xml auto" for several reasons:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
It is the default 
&lt;li&gt;
Attributes create smaller XML 
&lt;li&gt;
They like attributes&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
None the less, I'm an "element-kind-of-guy" and I do what I want! :-)
&lt;/p&gt;
&lt;p&gt;
Anyway, the schemas that are the result of this leave my schema with loads of records
instead of elements, meaning that I can not promote the result to distinguished fields.
&lt;/p&gt;
&lt;p&gt;
There is a way of changing this, though... allthough I really don't consider it to
be a nice solution :-)
&lt;/p&gt;
&lt;p&gt;
As an example, I have the following table in a database:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/sql_adapter_records_test_table.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
And I have this stored procedure to get the values:
&lt;/p&gt;
&lt;p&gt;
CREATE&amp;nbsp;PROCEDURE [dbo].[Get_eliasen]&lt;br&gt;
AS&lt;br&gt;
BEGIN&lt;br&gt;
&amp;nbsp;-- SET NOCOUNT ON added to prevent extra result sets from&lt;br&gt;
&amp;nbsp;-- interfering with SELECT statements.&lt;br&gt;
&amp;nbsp;SET NOCOUNT ON;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -- Insert statements for procedure here&lt;br&gt;
&amp;nbsp;SELECT&amp;nbsp;* from eliasen for xml auto, elements, xmldata&lt;br&gt;
END
&lt;/p&gt;
&lt;p&gt;
Basically, it returns all rows from the table. The schema generated from this stored
procedure will look like this:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/sql_adapter_records_test_schema_records.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
The "seqno", "field1", "field" and "field3" are records and not elements. If I want
to change them to be elements instead, I need to open the XSD in a text editor and
do this manually:
&lt;/p&gt;
&lt;p&gt;
As an example, I will change the record "seqno" into an elements.
&lt;/p&gt;
&lt;p&gt;
The original XSD looks like this:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;?xml version="1.0"?&amp;gt;&lt;br&gt;
&amp;lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
version="1.0" xmlns:xs="&lt;a href="http://www.w3.org/2001/XMLSchema"&gt;http://www.w3.org/2001/XMLSchema&lt;/a&gt;"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:annotation&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:appinfo&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;msbtssql:sqlScript value="exec [Get_eliasen]" xmlns:msbtssql="&lt;a href="http://schemas.microsoft.com/BizTalk/2003"&gt;http://schemas.microsoft.com/BizTalk/2003&lt;/a&gt;"
/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:appinfo&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:annotation&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:element name="SQLAdaterRecordsTestRequest"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:sequence&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element minOccurs="0" maxOccurs="unbounded"
name="eliasen" xmlns:q1="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
type="q1:eliasenType" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:element&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:complexType name="eliasenType"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:choice minOccurs="0" maxOccurs="unbounded"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="seqno" xmlns:q2="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
type="q2:seqnoType" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="field1" xmlns:q3="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
type="q3:field1Type" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="field2" xmlns:q4="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
type="q4:field2Type" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="field3" xmlns:q5="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
type="q5:field3Type" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:choice&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:complexType name="seqnoType"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:extension base="xs:long" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:complexType name="field1Type"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:extension base="xs:string" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:complexType name="field2Type"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:extension base="xs:string" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:complexType name="field3Type"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:extension base="xs:string" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;lt;/xs:schema&amp;gt;
&lt;/p&gt;
&lt;p&gt;
And I will change it into this:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;?xml version="1.0"?&amp;gt;&lt;br&gt;
&amp;lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
version="1.0" xmlns:xs="&lt;a href="http://www.w3.org/2001/XMLSchema"&gt;http://www.w3.org/2001/XMLSchema&lt;/a&gt;"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:annotation&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:appinfo&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;msbtssql:sqlScript value="exec [Get_eliasen]" xmlns:msbtssql="&lt;a href="http://schemas.microsoft.com/BizTalk/2003"&gt;http://schemas.microsoft.com/BizTalk/2003&lt;/a&gt;"
/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:appinfo&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:annotation&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:element name="SQLAdaterRecordsTestRequest"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:sequence&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element minOccurs="0" maxOccurs="unbounded"
name="eliasen" xmlns:q1="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
type="q1:eliasenType" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:sequence&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:element&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:complexType name="eliasenType"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:choice minOccurs="0" maxOccurs="unbounded"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="seqno" type="xs:long" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="field1" xmlns:q3="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
type="q3:field1Type" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="field2" xmlns:q4="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
type="q4:field2Type" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:element name="field3" xmlns:q5="&lt;a href="http://eliasen.dk/SQLAdaterRecordsTest"&gt;http://eliasen.dk/SQLAdaterRecordsTest&lt;/a&gt;"
type="q5:field3Type" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:choice&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:complexType name="field1Type"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:extension base="xs:string" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:complexType name="field2Type"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:extension base="xs:string" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xs:complexType name="field3Type"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xs:extension base="xs:string" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xs:simpleContent&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xs:complexType&amp;gt;&lt;br&gt;
&amp;lt;/xs:schema&amp;gt;
&lt;/p&gt;
&lt;p&gt;
So what have I done?
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
I Found the definition of the record "seqno". It was based on the type "q2:seqnoType". 
&lt;li&gt;
I found where the "seqnoType" type was declared, and noted that it extended "xs:long". 
&lt;li&gt;
I&amp;nbsp;changed the type of "seqno" from "q2:seqnoType" to be "xs:long". 
&lt;li&gt;
I removed the q2 namespace declaration from the seqno element, as it was no longer
needed. 
&lt;li&gt;
I removed the "seqnoType" type declaration, as it was no longer&amp;nbsp;needed.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
That's it. Save the XSD and reload it in your schema editor - you will get this: 
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/sql_adapter_records_test_schema_elements.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
But it sure would be nice to have the option of just changing it in the properties
of an elements in the schema editor...
&lt;/p&gt;
&lt;p&gt;
Hope this helps someone.
&lt;/p&gt;
&lt;p&gt;
EDIT on the 4'th of march 2007: Remember also that the record just below the root
node must be set as "maxOccurs=1" instead of unbounded. Otherwise, you can not promote
the fields below the record, obviously.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=18d3629c-a462-40c3-9b9b-25ef7ef1422b" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,18d3629c-a462-40c3-9b9b-25ef7ef1422b.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=83d9f5af-60b4-45ad-bdc1-1e345b83772f</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,83d9f5af-60b4-45ad-bdc1-1e345b83772f.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,83d9f5af-60b4-45ad-bdc1-1e345b83772f.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=83d9f5af-60b4-45ad-bdc1-1e345b83772f</wfw:commentRss>
      <slash:comments>8</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
I ran into this issue today. It turned out that the error occured in an expression
shape that used xpath to get a value from a message into a variable.
</p>
        <p>
Having been using xpath expressions inside my orchestrations for a long time,
I am really not used to having them fail on me :-) And this particular xpath expression
was copied from the "Instance XPath" property of the element in the schema editor.
So it shouldn't fail. I did add a "[1]" to the xpath because I needed to access the
first element of a re-occuring element, but still - not something I hadn't done plenty
of times before.
</p>
        <p>
Actually, it took quite some time before I discovered what was wrong. My expression
was:
</p>
        <p>
DeliveryDate = xpath(OrderMessage, "/*[local-name..........");
</p>
        <p>
and I needed to change it to
</p>
        <p>
DeliveryDate = xpath(OrderMessage, "string(/*[local-name..........)");
</p>
        <p>
Again, something I have done a million times... this time I just forgot it. And honestly,
I really don't think the error message gives a very good idea of what is wrong...
</p>
        <p>
Hope this gets indexed and someone later on will find it helpful :-)
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=83d9f5af-60b4-45ad-bdc1-1e345b83772f" />
      </body>
      <title>&amp;lt;element xmlns=''&amp;gt; was not expected</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,83d9f5af-60b4-45ad-bdc1-1e345b83772f.aspx</guid>
      <link>http://blog.eliasen.dk/2006/12/09/ltelementXmlnsgtWasNotExpected.aspx</link>
      <pubDate>Sat, 09 Dec 2006 22:24:28 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
I ran into this issue today. It turned out that the error occured in an expression
shape that used xpath to get a value from a message into a variable.
&lt;/p&gt;
&lt;p&gt;
Having been using xpath expressions inside my orchestrations for&amp;nbsp;a long time,
I am really not used to having them fail on me :-) And this particular xpath expression
was copied from the "Instance XPath" property of the element in the schema editor.
So it shouldn't fail. I did add a "[1]" to the xpath because I needed to access the
first element of a re-occuring element, but still - not something I hadn't done plenty
of times before.
&lt;/p&gt;
&lt;p&gt;
Actually, it took quite some time before I discovered what was wrong. My expression
was:
&lt;/p&gt;
&lt;p&gt;
DeliveryDate = xpath(OrderMessage, "/*[local-name..........");
&lt;/p&gt;
&lt;p&gt;
and I needed to change it to
&lt;/p&gt;
&lt;p&gt;
DeliveryDate = xpath(OrderMessage, "string(/*[local-name..........)");
&lt;/p&gt;
&lt;p&gt;
Again, something I have done a million times... this time I just forgot it. And honestly,
I really don't think the error message gives a very good idea of what is wrong...
&lt;/p&gt;
&lt;p&gt;
Hope this gets indexed and someone later on will find it helpful :-)
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=83d9f5af-60b4-45ad-bdc1-1e345b83772f" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,83d9f5af-60b4-45ad-bdc1-1e345b83772f.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=528ae49c-ece6-4a47-b661-e3340172bfcd</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,528ae49c-ece6-4a47-b661-e3340172bfcd.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,528ae49c-ece6-4a47-b661-e3340172bfcd.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=528ae49c-ece6-4a47-b661-e3340172bfcd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
On my current project, I ran into a small issue. In my orchestration, I created a
record in a table in a database. The stored procedure that created the record also
returned the ID of the record. This ID was to be emailed to a trading partner in the
body of an html email. The trading partner could reply, and I needed to correlate
on the ID of the record in the database.
</p>
        <p>
But how to do that? The body of the email is one long <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdk/htm/ebiz_prog_email_ibad.asp">rawstring</a> with
the ID embedded in the HTML.
</p>
        <p>
Off course, there was the obvious way; Just use a property that is never used in some
property schema. I happen to know that my solution will never actually use the POP3.Subject
property, and therefore I can use it for my purposes. So when I create the Message
to be sent out by email to the trading partner, I put the ID inside the POP3.Subject
property. When the message is sent, I initialize a correlation set that is based on
this single property. I have then also promoted some element of the reply from the
trading partner to the same property, and this works just great.
</p>
        <p>
BUT, I am not a fan of misusing properties like that. I find it a bit ugly. So I looked
for alternatives, and then I found the <a href="http://www.winterdom.com/weblog/2005/03/06/BizTalk2004NullSendAdapterSample.aspx">/dev/null</a> adapter
written by BizTalk MVP Tomas Restrepo. Baiscally, the adapter discards anything it
receives. Tomas writes that it can be used to subscribe to anything in order to avoid
getting the "No subscribers found" errors, but I found another use for it.
</p>
        <p>
So I created a dummy schema that only had one element in it and promoted that element
to a property of my own property schema. I also promoted the appropriate element from
the reply from the trading partner to the same property. In my orchestration, I then
created a correlation set based on this property, and I added a send port that sends
out an instance of the dummy schema just after sending out the email to a port using
the /dev/null adapter. The message doesn't go anywhere, but the correlation set gets
initialized and I can follow it later on in my orchestration.
</p>
        <p>
See my solution at <a href="http://blog.eliasen.dk/content/binary/CorrelationAfterSMTPSend.zip">CorrelationAfterSMTPSend.zip
(94,37 KB)</a></p>
        <p>
Remember that you must download and install the /dev/null adapter before trying this.
</p>
        <p>
And see the solution without using Tomas' adapter here: <a href="http://blog.eliasen.dk/content/binary/CorrelationAfterSMTPSendWithoutDevNull.zip">CorrelationAfterSMTPSendWithoutDevNull.zip
(78,18 KB)</a></p>
        <p>
Pros and cons... Well, the first obvious solution is much simpler, as it doesn't require
a dummy schema, it doesn't require a property schema and the orchestration doesn't
need to create and instance of the dummy schema and send it out. On the other hand,
it really isn't pretty to use the properties like that.
</p>
        <p>
The second solution requires installing an adapter, registering it, and all the legwork
described above. But the solution uses my own properties and the POP3.Subject property
can be use later on, should it be necessary.
</p>
        <p>
Oh well, use whichever you like best :-)
</p>
        <p>
Hope this was helpful to someone.
</p>
        <p>
 
</p>
        <p>
          <strong>Updated on the 10'th December 2006:</strong>
        </p>
        <p>
Well, had I taken the time to think it over again before writing the blog entry, I
would have realized that my first obvious approach, which is using the POP3.Subject
property doesn't actually have to use an existing property in an existing property
schema. I could just as easily have created my own property schema and used that instead.
</p>
        <p>
The reason I abandoned this approach was, that after creating the property schema
and creating a property inside the property schema, to which I promoted fields in
the schemas, I couldn't assign values to it in message assignment shapes. The property
just didn't show up using intellisense in the message assignment shapes.
</p>
        <p>
So I went ahead and used the POP3-Subject property instead. BUT, I discovered that
I can actually assign values to my own properties. I just need to change a property
of the property element in the property schema. The property element needs
to be marked as "MessageContextPropertyBase" in the "Property Schema Base" property
of the property element in the property schema.
</p>
        <p>
So, I have abandoned the /dev/null adapter, although I liked the idea :-) And am now
using my own property. The best of the two worlds! :-)
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=528ae49c-ece6-4a47-b661-e3340172bfcd" />
      </body>
      <title>How to correlate on a value inside the body of an email?</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,528ae49c-ece6-4a47-b661-e3340172bfcd.aspx</guid>
      <link>http://blog.eliasen.dk/2006/12/09/HowToCorrelateOnAValueInsideTheBodyOfAnEmail.aspx</link>
      <pubDate>Sat, 09 Dec 2006 22:17:36 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
On my current project, I ran into a small issue. In my orchestration, I created a
record in a table in a database. The stored procedure that created the record also
returned the ID of the record. This ID was to be emailed to a trading partner in the
body of an html email. The trading partner could reply, and I needed to correlate
on the ID of the record in the database.
&lt;/p&gt;
&lt;p&gt;
But how to do that? The body of the email is one long &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdk/htm/ebiz_prog_email_ibad.asp"&gt;rawstring&lt;/a&gt;&amp;nbsp;with
the ID embedded in the HTML.
&lt;/p&gt;
&lt;p&gt;
Off course, there was the obvious way; Just use a property that is never used in some
property schema. I happen to know that my solution will never actually use the POP3.Subject
property, and therefore I can use it for my purposes. So when I create the Message
to be sent out by email to the trading partner, I put the ID inside the POP3.Subject
property. When the message is sent, I initialize a correlation set that is based on
this single property. I have then also promoted some element of the reply from the
trading partner to the same property, and this works just great.
&lt;/p&gt;
&lt;p&gt;
BUT, I am not a fan of misusing properties like that. I find it a bit ugly. So I looked
for alternatives, and then I found&amp;nbsp;the &lt;a href="http://www.winterdom.com/weblog/2005/03/06/BizTalk2004NullSendAdapterSample.aspx"&gt;/dev/null&lt;/a&gt;&amp;nbsp;adapter
written by BizTalk MVP Tomas Restrepo. Baiscally, the adapter discards anything it
receives. Tomas writes that it can be used to subscribe to anything in order to avoid
getting the "No subscribers found" errors, but I found another use for it.
&lt;/p&gt;
&lt;p&gt;
So I created a dummy schema that only had one element in it and promoted that element
to a property of my own property schema. I also promoted the appropriate element from
the reply from the trading partner to the same property. In my orchestration, I then
created a correlation set based on this property, and I added a send port that sends
out an instance of the dummy schema just after sending out the email to a port using
the /dev/null adapter. The message doesn't go anywhere, but the correlation set gets
initialized and I can follow it later on in my orchestration.
&lt;/p&gt;
&lt;p&gt;
See my solution at &lt;a href="http://blog.eliasen.dk/content/binary/CorrelationAfterSMTPSend.zip"&gt;CorrelationAfterSMTPSend.zip
(94,37 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Remember that you must download and install the /dev/null adapter before trying this.
&lt;/p&gt;
&lt;p&gt;
And see the solution without using Tomas' adapter here: &lt;a href="http://blog.eliasen.dk/content/binary/CorrelationAfterSMTPSendWithoutDevNull.zip"&gt;CorrelationAfterSMTPSendWithoutDevNull.zip
(78,18 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Pros and cons... Well, the first obvious solution is much simpler, as it doesn't require
a dummy schema, it doesn't require a property schema and the orchestration doesn't
need to create and instance of the dummy schema and send it out. On the other hand,
it really isn't pretty&amp;nbsp;to use the properties like that.
&lt;/p&gt;
&lt;p&gt;
The second solution requires installing an adapter, registering it, and all the legwork
described above. But the solution uses my own properties and the POP3.Subject property
can be use later on, should it be necessary.
&lt;/p&gt;
&lt;p&gt;
Oh well, use whichever you like best :-)
&lt;/p&gt;
&lt;p&gt;
Hope this was helpful to someone.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Updated on the 10'th December 2006:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Well, had I taken the time to think it over again before writing the blog entry, I
would have realized that my first obvious approach, which is using the POP3.Subject
property doesn't actually have to use an existing property in an existing property
schema. I could just as easily have created my own property schema and used that instead.
&lt;/p&gt;
&lt;p&gt;
The reason I abandoned this approach was, that after creating the property schema
and creating a property inside the property schema, to which I promoted fields in
the schemas, I couldn't assign values to it in message assignment shapes. The property
just didn't show up using intellisense in the message assignment shapes.
&lt;/p&gt;
&lt;p&gt;
So I went ahead and used the POP3-Subject property instead. BUT, I discovered that
I can actually assign values to my own properties. I just need to change a property
of the property element in the property schema.&amp;nbsp;The property element&amp;nbsp;needs
to be marked as "MessageContextPropertyBase" in the "Property Schema Base" property
of the property element in the property schema.
&lt;/p&gt;
&lt;p&gt;
So, I have abandoned the /dev/null adapter, although I liked the idea :-) And am now
using my own property. The best of the two worlds! :-)
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=528ae49c-ece6-4a47-b661-e3340172bfcd" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,528ae49c-ece6-4a47-b661-e3340172bfcd.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=49bf2fe6-37f5-40c1-aa1e-85b9a8ca25f8</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,49bf2fe6-37f5-40c1-aa1e-85b9a8ca25f8.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,49bf2fe6-37f5-40c1-aa1e-85b9a8ca25f8.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=49bf2fe6-37f5-40c1-aa1e-85b9a8ca25f8</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
          <strong>Updated at the bottom with a solution.</strong>
        </p>
        <p>
I have this very weird problem. I have created a functoid, but silly, as I am, I created
an icon for it that was way to big. So I wanted to remove the functoid from the
toolbox and deploy another functoid instead.
</p>
        <p>
This turned out to be quite a difficult task. I have removed the functoid from GAC
and I have removed it from the "Mapper Extensions" folder of the BizTalk installation
folder. I have then reset the toolbox. The functoid is STILL there. Actually, I can
do whatever I want, even boot the server, but the functoid stays in the toolbox. If
I move my mouse over it in the toolbox, VS.NET 2005 will crash very hard, so
this isn't desirable :-) If I am very quick, I can go to the functoid, right click
on it and delete it from the toolbox. Yiepee, it is gone. BUT, resetting the toolbox
makes the functoid reappear :-(
</p>
        <p>
Another guy has the same problem, and at this moment, a support incident with Microsoft
is being evaluated. Microsoft have reproduced the behaviour, they claim, so I am awaiting
the answer to this peculiar problem any time now.
</p>
        <p>
I will post the solution here, off course.
</p>
        <p>
Update with a solution posted on 9'th December 2006:
</p>
        <p>
          <strong>Solution 1:</strong>
        </p>
        <p>
Log on to Windows, using a username other than that, under which this error occurs.
The ser must have administrative priviledges.
</p>
        <p>
Right click on "My Computer", Select Properties, Advanced Tab, User Profiles -&gt;
Settings and delete the profile that is experiencing the problem.
</p>
        <p>
Logout, and login as the user that had the problem. The problem should now be gone.
</p>
        <p>
This solution has a great drawback, though - the profile is deleted (duh!) This means
that alll your settings for all kinds of programs are removed and you need to recreate
them. For instance, VS.NET 2005 thinks it is the first time it is started the next
time you start it.
</p>
        <p>
          <strong>Solution 2:</strong>
        </p>
        <p>
Microsoft stated another solution that should work, but this one I haven't tested:
</p>
        <ol>
          <li>
Ungac the Assembly</li>
          <li>
Remove the Assembly from Mapper Extension Folder.</li>
          <li>
Choose Items on the Toolbox and Unselect the offending items</li>
          <li>
Then do a Reset Toolbox</li>
        </ol>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=49bf2fe6-37f5-40c1-aa1e-85b9a8ca25f8" />
      </body>
      <title>Removing functoid from toolbox</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,49bf2fe6-37f5-40c1-aa1e-85b9a8ca25f8.aspx</guid>
      <link>http://blog.eliasen.dk/2006/12/05/RemovingFunctoidFromToolbox.aspx</link>
      <pubDate>Tue, 05 Dec 2006 20:59:06 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Updated at the bottom with a solution.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
I have this very weird problem. I have created a functoid, but silly, as I am, I created
an icon for it that was way to big. So&amp;nbsp;I wanted to remove the functoid from the
toolbox and deploy another functoid instead.
&lt;/p&gt;
&lt;p&gt;
This turned out to be quite a difficult task. I have removed the functoid from GAC
and I have removed it from the "Mapper Extensions" folder of the BizTalk installation
folder. I have then reset the toolbox. The functoid is STILL there. Actually, I can
do whatever I want, even boot the server, but the functoid stays in the toolbox. If
I&amp;nbsp;move my mouse over it in the toolbox, VS.NET 2005 will crash very hard, so
this isn't desirable :-) If I am very quick, I can go to the functoid, right click
on it and delete it from the toolbox. Yiepee, it is gone. BUT, resetting the toolbox
makes the functoid reappear :-(
&lt;/p&gt;
&lt;p&gt;
Another guy has the same problem, and at this moment, a support incident with Microsoft
is being evaluated. Microsoft have reproduced the behaviour, they claim, so I am awaiting
the answer to this peculiar problem any time now.
&lt;/p&gt;
&lt;p&gt;
I will post the solution here, off course.
&lt;/p&gt;
&lt;p&gt;
Update with a solution posted on 9'th December 2006:
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Solution 1:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Log on to Windows, using a username other than that, under which this error occurs.
The ser must have administrative priviledges.
&lt;/p&gt;
&lt;p&gt;
Right click on "My Computer", Select Properties, Advanced Tab, User Profiles -&amp;gt;
Settings and delete the profile that is experiencing the problem.
&lt;/p&gt;
&lt;p&gt;
Logout, and login as the user that had the problem. The problem should now be gone.
&lt;/p&gt;
&lt;p&gt;
This solution has a great drawback, though - the profile is deleted (duh!) This means
that alll your settings for all kinds of programs are removed and you need to recreate
them. For instance, VS.NET 2005 thinks it is the first time it is started the next
time you start it.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Solution 2:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Microsoft stated another solution that should work, but this one I haven't tested:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Ungac the Assembly&lt;/li&gt;
&lt;li&gt;
Remove the Assembly from Mapper Extension Folder.&lt;/li&gt;
&lt;li&gt;
Choose Items on the Toolbox and Unselect the offending items&lt;/li&gt;
&lt;li&gt;
Then do a Reset Toolbox&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=49bf2fe6-37f5-40c1-aa1e-85b9a8ca25f8" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,49bf2fe6-37f5-40c1-aa1e-85b9a8ca25f8.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=31a59f27-a350-4325-987d-94b3da075f35</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,31a59f27-a350-4325-987d-94b3da075f35.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,31a59f27-a350-4325-987d-94b3da075f35.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=31a59f27-a350-4325-987d-94b3da075f35</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
A guy on the microsoft.public.biztalk.something newsgroup is having problems splitting
an incoming flat file into several files. The dataformat he has is this:
</p>
        <p>
HH06SGLN00084CR<br />
31102006~06~Miss~ABD~DEF GHI ~ZZZZZ~F~31111111~~BD46A~233435~NUTRITION &amp; FOOD
SCIENCE~1~88888888~ AN ADDRESS SOMEWHERE~AB18ZZ~AAAA33333333T~04444.00~01200.00~00000.00~00000.00~F~Y~P~Y~N~N~N~<br />
01112006~06~Miss~ASODIFN~DSFJ ~BSODIFJSDF~F~55555555~~Q190E~444444~ENGLISH &amp; POPULAR
CULTURE~1~66666666~ ANOTHER ADDRESS ~CF51NT~EEEE94857463H~01200.00~01200.00~00000.00~00000.00~F~Y~F~Y~Y~N~N~<br />
TT000024
</p>
        <p>
The first line is a header, with identifier "HH". The last line is the trailer with
identifier "TT". In between are many body lines, one per line.
</p>
        <p>
He would like to create schemas for the header, the body and the trailer and use them
in a custom receive pipeline, using the flat file disassembler to split it up, so
he gets one XML document per body line.
</p>
        <p>
Unfortunately, this doesn't seem to be doable. What seems to happen is that when parsing
the document, first the header schema is used. It describes a single line, and this
line in the incoming file is then parsed. Then, the body schema is used for parsing
the rest of the incoming document. Since the body lines don't have tag identifiers,
though, it seems that BizTalk will continue to parse the document, and this includes
parsing the last line, which is the trailer. BizTalk doesn't know when to stop parsing
for body lines. Therefore, this error appears in the eventlog:
</p>
        <p>
-- BEGIN ERROR<br />
Source: "Flat file disassembler" Receive Port: "ReceiveFlatFile" URI: "C:\Projects\BTS
2006\NewsgroupHelp\BodyWithoutTagIdentifierFlatFile\Instances\In\*.txt" Reason: Unexpected
data found while looking for:<br />
'~'<br />
The current definition being parsed is BodyRoot. The stream offset where the error
occured is 404. The line number where the error occured is 4. The column where the
error occured is 0.<br />
-- END ERROR
</p>
        <p>
Baiscally, the flat file disassembler can't find the ~ character on the last line,
which isn't supposed to be there, since this line is the trailer. So BizTalk gives
up and fails.
</p>
        <p>
What I have come up with isn't actually pretty, but it does seem to work :-)
</p>
        <p>
I have created a schema for the entire flat file. And I have created a schema for
the entire flat file without the trailer. Then, I created a schema for the header,
and a schema for the body. I have made heavily use of the flat file schema wizard,
because there are many elements in the body lines :-)
</p>
        <p>
Then, I created a map between the two main schemas, effectively removing the trailer
from the input.
</p>
        <p>
I also created three custom pipelines:
</p>
        <ol>
          <li>
A pipeline for receiving the complete flat file 
</li>
          <li>
A pipeline for sending out the flat file without its trailer 
</li>
          <li>
A pipeline for splitting the flat file without trailer into several body documents,
using the header- and body schemas.</li>
        </ol>
        <p>
So the solution is:
</p>
        <p>
Let BizTalk read in the complete flat file, and use a map on the receive (or send)
port to convert it into the same structure without the trailer. Then output it to
a file. Let another receive location pick the new file up, and use the pipeline with
body- and header schemas to split it up into several documents.
</p>
        <p>
Pitfalls are: Remember to use different combinations of rootnode and target namespaces
for each schema. After copying a schema it is easy to forget to change it. Also, change
the .NET typename of the schema after copying it. The compiler will remind you
of that if you forget it, though :-)
</p>
        <p>
I really wanted to not use a flat file for the intermediate step and use XML instead,
but I couldn't get it to work. I would have to have a schema for the output and another
schema for the input, which was an envelope with an "Any"-element inside it, and these
two schemas would need to have the same rootnode and target namespace. So I dropped
it, and stayed with the flat file, allthough I hated it :-)
</p>
        <p>
My .NET project can be found here: <a href="http://blog.eliasen.dk/content/binary/BodyWithoutTagIdentifierFlatFile.zip">BodyWithoutTagIdentifierFlatFile.zip
(99,28 KB)</a></p>
        <p>
I hope this has been of some help. The conclusion basically is that it can't be done,
splitting an incoming flat file up using header, body and trailer schemas, if the
body doesn't have a tag identifier.
</p>
        <p>
UPDATE on 5'th December 2006: Greg Forsythe has another solution to the problem, which
he has written in the newsgroup. I quote:
</p>
        <p>
-- BEGIN QUOTE
</p>
        <p>
There is another way of doing this:<br />
Create a document schema with an optional trailer record.<br />
This will debatch each record, with the last document having a trailer 
<br />
record. This can be removed/ignored in the first map
</p>
        <p>
--  END QUOTE
</p>
        <p>
I haven't tried it, but it makes sense, and why didn't I think of that?
</p>
        <p>
-- 
<br />
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=31a59f27-a350-4325-987d-94b3da075f35" />
      </body>
      <title>Flat file trailer when body doesn't have a tag identifier</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,31a59f27-a350-4325-987d-94b3da075f35.aspx</guid>
      <link>http://blog.eliasen.dk/2006/12/04/FlatFileTrailerWhenBodyDoesntHaveATagIdentifier.aspx</link>
      <pubDate>Mon, 04 Dec 2006 23:14:35 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
A guy on the microsoft.public.biztalk.something newsgroup is having problems splitting
an incoming flat file into several files. The dataformat he has is this:
&lt;/p&gt;
&lt;p&gt;
HH06SGLN00084CR&lt;br&gt;
31102006~06~Miss~ABD~DEF GHI ~ZZZZZ~F~31111111~~BD46A~233435~NUTRITION &amp;amp; FOOD
SCIENCE~1~88888888~ AN ADDRESS SOMEWHERE~AB18ZZ~AAAA33333333T~04444.00~01200.00~00000.00~00000.00~F~Y~P~Y~N~N~N~&lt;br&gt;
01112006~06~Miss~ASODIFN~DSFJ ~BSODIFJSDF~F~55555555~~Q190E~444444~ENGLISH &amp;amp; POPULAR
CULTURE~1~66666666~ ANOTHER ADDRESS ~CF51NT~EEEE94857463H~01200.00~01200.00~00000.00~00000.00~F~Y~F~Y~Y~N~N~&lt;br&gt;
TT000024
&lt;/p&gt;
&lt;p&gt;
The first line is a header, with identifier "HH". The last line is the trailer with
identifier "TT". In between are many body lines, one per line.
&lt;/p&gt;
&lt;p&gt;
He would like to create schemas for the header, the body and the trailer and use them
in a custom receive pipeline, using the flat file disassembler to split it up, so
he gets one XML document per body line.
&lt;/p&gt;
&lt;p&gt;
Unfortunately, this doesn't seem to be doable. What seems to happen is that when parsing
the document, first the header schema is used. It describes a single line, and this
line in the incoming file is then parsed.&amp;nbsp;Then, the body schema is used for parsing
the rest of the incoming document. Since the body lines don't have tag identifiers,
though, it seems that BizTalk will continue to parse the document, and this includes
parsing the last line, which is the trailer. BizTalk doesn't know when to stop parsing
for body lines. Therefore, this error appears in the eventlog:
&lt;/p&gt;
&lt;p&gt;
-- BEGIN ERROR&lt;br&gt;
Source: "Flat file disassembler" Receive Port: "ReceiveFlatFile" URI: "C:\Projects\BTS
2006\NewsgroupHelp\BodyWithoutTagIdentifierFlatFile\Instances\In\*.txt" Reason: Unexpected
data found while looking for:&lt;br&gt;
'~'&lt;br&gt;
The current definition being parsed is BodyRoot. The stream offset where the error
occured is 404. The line number where the error occured is 4. The column where the
error occured is 0.&lt;br&gt;
-- END ERROR
&lt;/p&gt;
&lt;p&gt;
Baiscally, the flat file disassembler can't find the ~ character on the last line,
which isn't supposed to be there, since this line is the trailer. So BizTalk gives
up and fails.
&lt;/p&gt;
&lt;p&gt;
What I have come up with isn't actually pretty, but it does seem to work :-)
&lt;/p&gt;
&lt;p&gt;
I have created a schema for the entire flat file. And I have created a schema for
the entire flat file without the trailer. Then, I created a schema for the header,
and a schema for the body. I have made heavily use of the flat file schema wizard,
because there are many elements in the body lines :-)
&lt;/p&gt;
&lt;p&gt;
Then, I created a map between the two main schemas, effectively removing the trailer
from the input.
&lt;/p&gt;
&lt;p&gt;
I also created&amp;nbsp;three custom&amp;nbsp;pipelines:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
A pipeline for receiving the complete flat file 
&lt;li&gt;
A pipeline for sending out the flat file without its trailer 
&lt;li&gt;
A pipeline for splitting the flat file without trailer into several body documents,
using the header- and body schemas.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
So the solution is:
&lt;/p&gt;
&lt;p&gt;
Let BizTalk read in the complete flat file, and use a map on the receive (or send)
port to convert it into the same structure without the trailer. Then output it to
a file. Let another receive location pick the new file up, and use the pipeline with
body- and header schemas to split it up into several documents.
&lt;/p&gt;
&lt;p&gt;
Pitfalls are: Remember to use different combinations of rootnode and target namespaces
for each schema. After copying a schema it is easy to forget to change it. Also, change
the .NET typename of the schema after copying it.&amp;nbsp;The compiler will remind you
of that if you forget it, though&amp;nbsp;:-)
&lt;/p&gt;
&lt;p&gt;
I really wanted to not use a flat file for the intermediate step and use XML instead,
but I couldn't get it to work. I would have to have a schema for the output and another
schema for the input, which was an envelope with an "Any"-element inside it, and these
two schemas would need to have the same rootnode and target namespace. So I dropped
it, and stayed with the flat file, allthough I hated it :-)
&lt;/p&gt;
&lt;p&gt;
My .NET project can be found here: &lt;a href="http://blog.eliasen.dk/content/binary/BodyWithoutTagIdentifierFlatFile.zip"&gt;BodyWithoutTagIdentifierFlatFile.zip
(99,28 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I hope this has been of some help. The conclusion basically is that it can't be done,
splitting an incoming flat file up using header, body and trailer schemas, if the
body doesn't have a tag identifier.
&lt;/p&gt;
&lt;p&gt;
UPDATE on 5'th December 2006: Greg Forsythe has another solution to the problem, which
he has written in the newsgroup. I quote:
&lt;/p&gt;
&lt;p&gt;
-- BEGIN QUOTE
&lt;/p&gt;
&lt;p&gt;
There is another way of doing this:&lt;br&gt;
Create a document schema with an optional trailer record.&lt;br&gt;
This will debatch each record, with the last document having a trailer 
&lt;br&gt;
record. This can be removed/ignored in the first map
&lt;/p&gt;
&lt;p&gt;
--&amp;nbsp; END QUOTE
&lt;/p&gt;
&lt;p&gt;
I haven't tried it, but it makes sense, and&amp;nbsp;why didn't I think of that?
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;br&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=31a59f27-a350-4325-987d-94b3da075f35" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,31a59f27-a350-4325-987d-94b3da075f35.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=6c7ac8ec-3f3e-49e4-a15a-76c736d30654</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,6c7ac8ec-3f3e-49e4-a15a-76c736d30654.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,6c7ac8ec-3f3e-49e4-a15a-76c736d30654.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=6c7ac8ec-3f3e-49e4-a15a-76c736d30654</wfw:commentRss>
      <slash:comments>13</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
A guy on the microsoft.public.biztalk.orchestration newsgroup has asked about looping
around elements inside an orchestration, and I thought I'd just write some lines about
the issue here, for everybody to see in the future.
</p>
        <p>
The problem is, that he has the following document structure:
</p>
        <p>
&lt;Employees&gt;<br />
&lt;Employee title="mgr"&gt;<br />
&lt;/Employee&gt;<br />
&lt;Employee title="vp"&gt;<br />
&lt;/Employee&gt;<br />
&lt;Employee title="ceo"&gt;<br />
&lt;/Employee&gt;<br />
&lt;/Employees&gt;
</p>
        <p>
And he wants to do something with each employee, based on what the title is. As I
see it, there are two options:
</p>
        <ol>
          <li>
Loop through the Employee-elements inside the orchestration 
</li>
          <li>
Use an envelope to split the incoming Employees-message into several Employee-messages</li>
        </ol>
        <p>
          <font size="4">Suggestion 1</font>
        </p>
        <p>
I have proposed the following two schemas:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/EmployeesSchema.JPG" border="0" /> for
the big message that arrives and <img src="http://blog.eliasen.dk/content/binary/EmployeeSchema.JPG" border="0" /> for
the individual Employee. Note, that I have promoted "title" as a distinguished field.
</p>
        <p>
I then create an orchestration, that takes an instance of the Employees schema as
input, and loop around the employees. The orchestration looks like this: 
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/LoopAroundEmployee.Loop_Orchestration.jpg" border="0" />
        </p>
        <p>
It receives the incoming message, and then initializes a couple of variables. The
first expression shape, named "Initialize Loop variables" contains the following three
lines:
</p>
        <p>
empCount = xpath(InputMessage, "count(/*[local-name()='Employees' and namespace-uri()='']/*[local-name()='Employee'
and namespace-uri()=''])");<br />
counter = 1;<br />
counterStr = "1";
</p>
        <p>
Basically, I get the number of employee-elements, and initialize the counter. The
stringcounter is used to build xpath expression later, as you will see.
</p>
        <p>
Then, I loop. The loop condition is "counter &lt;= empCount" - so I want to loop as
long as there are employees.
</p>
        <p>
Inside the scope, I have declared a message employeeMessage, which is of the type
of a single employee.
</p>
        <p>
In the message assignment shape, I do this:
</p>
        <p>
EmployeeMessage = xpath(InputMessage, "/*[local-name()='Employees' and namespace-uri()='']/*[local-name()='Employee'
and namespace-uri()=''][" + counterStr + "]");
</p>
        <p>
It takes the employee from the big incoming message that corresponds to the counter
and assigns it to the message that is to be constructed.
</p>
        <p>
In the next expression shape, I just write the content of the distinguished field
"title" of the employee to the eventlog.
</p>
        <p>
And in the final expression shape, I increment the counter variables:
</p>
        <p>
counter = counter + 1;<br />
counterStr = System.Convert.ToString(counter);
</p>
        <p>
So by doing this, I am looping over the employees inside the employees-message, and
I have access to all the values inside the single employee. I didn't have to have
schema number 2, describing a single employee, I could have just used xpath all the
way down, or maybe declare an XmlNode variable to hold the employee-element instead.
But I like this solution better.
</p>
        <p>
Another option I have now is that I can add a decision shape, and based on the title
value, I can call different orchestrations, that will handle a specific employee-type.
Or perhaps I could just send the employee message to a direct-bound send port and
have other orchestrations subscribe to the employee message type. This would require
the title to be a promoted property instead of a distinguished field, though, in order
to route on it.
</p>
        <p>
          <font size="4">Suggestion 2</font>
        </p>
        <p>
I propose using an XML Envelope to split the incoming file into several employee-messages
and let the orchestration handle them individually.
</p>
        <p>
To do this, I have created two schemas:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/EmployeesEnvelopeSchema.JPG" border="0" /> for
the envelope and <img src="http://blog.eliasen.dk/content/binary/EmployeeFromEnvelopeSchema.JPG" border="0" /> for
the employee. <strong>Note:</strong> I have changed the names of the root nodes in
both schemas. Naturally, in real life you wouldn't do this. The only reason I did
this is to be able to have both my examples deployed at the same time. If I hadn't
done it, I would have had multiple schemas deployed with the same combination
of target namespace and root node, which we all know is <strong>BAD</strong>. On the
schema for the envelope, I have clicked on the "&lt;Schema&gt;"-node and in the properties
windows, I have set "Envelope" to "Yes". Then, I clicked on the "EmployeesEnvelope"-node
and in the properties window, I set the "Body XPath" property to point at the "EmployeesEnvelope"-element.
</p>
        <p>
Then, I created an orchestration, that takes an employee as the input - not the employees-type,
but the single employee. It looks like this: 
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/LoopAroundEmployeeEnvelope.Employee_Orchestration.jpg" border="0" />
        </p>
        <p>
So here I have a much smaller, simpler, and faster orchestration than the one
from suggestion 1. 
</p>
        <p>
After the solution is deployed, I create a receive location, and remember to use the
default XMLReceive pipeline. The disassembler stage will look at the incoming message,
determine the message type, see it is an envelope, split the message into smaller
messages, and publish them individually with their own message type.
</p>
        <p>
If I need different orchestrations depending on the value of the title attribute,
I can promote it to a promoted property instead of a distinguished field, and add
it to a filter on the receive shape in each orchestration.
</p>
        <p>
          <font size="4">Examples:</font>
        </p>
        <p>
I have my two samples here: <a href="http://blog.eliasen.dk/content/binary/LoopAroundEmployee.zip">LoopAroundEmployee.zip
(68,66 KB)</a> and here: <a href="http://blog.eliasen.dk/content/binary/LoopAroundEmployeeEnvelope.zip">LoopAroundEmployeeEnvelope.zip
(48,64 KB)</a></p>
        <p>
I hope this has been useful for someone. If you have any questions, just ask.
</p>
        <p>
-- 
</p>
        <p>
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=6c7ac8ec-3f3e-49e4-a15a-76c736d30654" />
      </body>
      <title>Looping around elements of a message</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,6c7ac8ec-3f3e-49e4-a15a-76c736d30654.aspx</guid>
      <link>http://blog.eliasen.dk/2006/11/05/LoopingAroundElementsOfAMessage.aspx</link>
      <pubDate>Sun, 05 Nov 2006 13:04:11 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
A guy on the microsoft.public.biztalk.orchestration newsgroup has asked about looping
around elements inside an orchestration, and I thought I'd just write some lines about
the issue here, for everybody to see in the future.
&lt;/p&gt;
&lt;p&gt;
The problem is, that he has the following document structure:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;Employees&amp;gt;&lt;br&gt;
&amp;lt;Employee title="mgr"&amp;gt;&lt;br&gt;
&amp;lt;/Employee&amp;gt;&lt;br&gt;
&amp;lt;Employee title="vp"&amp;gt;&lt;br&gt;
&amp;lt;/Employee&amp;gt;&lt;br&gt;
&amp;lt;Employee title="ceo"&amp;gt;&lt;br&gt;
&amp;lt;/Employee&amp;gt;&lt;br&gt;
&amp;lt;/Employees&amp;gt;
&lt;/p&gt;
&lt;p&gt;
And he wants to do something with each employee, based on what the title is. As I
see it, there are two options:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Loop through the Employee-elements inside the orchestration 
&lt;li&gt;
Use an envelope to split the incoming Employees-message into several Employee-messages&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&lt;font size=4&gt;Suggestion 1&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
I have proposed the following two schemas:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/EmployeesSchema.JPG" border=0&gt;&amp;nbsp;for
the big message that arrives and &lt;img src="http://blog.eliasen.dk/content/binary/EmployeeSchema.JPG" border=0&gt;&amp;nbsp;for
the individual Employee. Note, that I have promoted "title" as a distinguished field.
&lt;/p&gt;
&lt;p&gt;
I then create an orchestration, that takes an instance of the Employees schema as
input, and loop around the employees. The orchestration looks like this: 
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/LoopAroundEmployee.Loop_Orchestration.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
It receives the incoming message, and then initializes a couple of variables. The
first expression shape, named "Initialize Loop variables" contains the following three
lines:
&lt;/p&gt;
&lt;p&gt;
empCount = xpath(InputMessage, "count(/*[local-name()='Employees' and namespace-uri()='']/*[local-name()='Employee'
and namespace-uri()=''])");&lt;br&gt;
counter = 1;&lt;br&gt;
counterStr = "1";
&lt;/p&gt;
&lt;p&gt;
Basically, I get the number of employee-elements, and initialize the counter. The
stringcounter is used to build xpath expression later, as you will see.
&lt;/p&gt;
&lt;p&gt;
Then, I loop. The loop condition is "counter &amp;lt;= empCount" - so I want to loop as
long as there are employees.
&lt;/p&gt;
&lt;p&gt;
Inside the scope, I have declared a message employeeMessage, which is of the type
of a single employee.
&lt;/p&gt;
&lt;p&gt;
In the message assignment shape, I do this:
&lt;/p&gt;
&lt;p&gt;
EmployeeMessage = xpath(InputMessage, "/*[local-name()='Employees' and namespace-uri()='']/*[local-name()='Employee'
and namespace-uri()=''][" + counterStr + "]");
&lt;/p&gt;
&lt;p&gt;
It takes the employee from the big incoming message that corresponds to the counter
and assigns it to&amp;nbsp;the message that is to be constructed.
&lt;/p&gt;
&lt;p&gt;
In the next expression shape, I just write the content of the distinguished field
"title" of the employee to the eventlog.
&lt;/p&gt;
&lt;p&gt;
And in the final expression shape, I increment the counter variables:
&lt;/p&gt;
&lt;p&gt;
counter = counter + 1;&lt;br&gt;
counterStr = System.Convert.ToString(counter);
&lt;/p&gt;
&lt;p&gt;
So by doing this, I am looping over the employees inside the employees-message, and
I have access to all the values inside the single employee. I didn't have to have
schema number 2, describing a single employee, I could have just used xpath all the
way down, or maybe declare an XmlNode variable to hold the employee-element instead.
But I like this solution better.
&lt;/p&gt;
&lt;p&gt;
Another option I have now is that I can add a decision shape, and based on the title
value, I can call different orchestrations, that will handle a specific employee-type.
Or perhaps I could just send the employee message to a direct-bound send port and
have other orchestrations subscribe to the employee message type. This would require
the title to be a promoted property instead of a distinguished field, though, in order
to route on it.
&lt;/p&gt;
&lt;p&gt;
&lt;font size=4&gt;Suggestion 2&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
I propose using an XML Envelope to split the incoming file into several employee-messages
and let the orchestration handle them individually.
&lt;/p&gt;
&lt;p&gt;
To do this, I have created two schemas:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/EmployeesEnvelopeSchema.JPG" border=0&gt;&amp;nbsp;for
the envelope and &lt;img src="http://blog.eliasen.dk/content/binary/EmployeeFromEnvelopeSchema.JPG" border=0&gt;&amp;nbsp;for
the employee. &lt;strong&gt;Note:&lt;/strong&gt; I have changed the names of the root nodes in
both schemas. Naturally, in real life you wouldn't do this. The only reason I did
this is to be able to have both my examples deployed at the same time. If I hadn't
done it,&amp;nbsp;I would have had multiple schemas deployed with the same combination
of target namespace and root node, which we all know is &lt;strong&gt;BAD&lt;/strong&gt;. On the
schema for the envelope, I have clicked on the "&amp;lt;Schema&amp;gt;"-node and in the properties
windows, I have set "Envelope" to "Yes". Then, I clicked on the "EmployeesEnvelope"-node
and in the properties window, I set the "Body XPath" property to point at the "EmployeesEnvelope"-element.
&lt;/p&gt;
&lt;p&gt;
Then, I created an orchestration, that takes an employee as the input - not the employees-type,
but the single employee. It looks like this: 
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/LoopAroundEmployeeEnvelope.Employee_Orchestration.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
So here I have a much smaller,&amp;nbsp;simpler, and faster orchestration than the one
from suggestion 1. 
&lt;/p&gt;
&lt;p&gt;
After the solution is deployed, I create a receive location, and remember to use the
default XMLReceive pipeline. The disassembler stage will look at the incoming message,
determine the message type, see it is an envelope, split the message into smaller
messages, and publish them individually with their own message type.
&lt;/p&gt;
&lt;p&gt;
If I need different orchestrations depending on the value of the title attribute,
I can promote it to a promoted property instead of a distinguished field, and add
it to a filter on the receive shape in each orchestration.
&lt;/p&gt;
&lt;p&gt;
&lt;font size=4&gt;Examples:&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
I have my two samples here: &lt;a href="http://blog.eliasen.dk/content/binary/LoopAroundEmployee.zip"&gt;LoopAroundEmployee.zip
(68,66 KB)&lt;/a&gt;&amp;nbsp;and here: &lt;a href="http://blog.eliasen.dk/content/binary/LoopAroundEmployeeEnvelope.zip"&gt;LoopAroundEmployeeEnvelope.zip
(48,64 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I hope this has been useful for someone. If you have any questions, just ask.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;/p&gt;
&lt;p&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=6c7ac8ec-3f3e-49e4-a15a-76c736d30654" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,6c7ac8ec-3f3e-49e4-a15a-76c736d30654.aspx</comments>
      <category>BizTalk 2004</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=1ea5c9ee-4318-48bc-8f87-d2a5ce9262bf</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,1ea5c9ee-4318-48bc-8f87-d2a5ce9262bf.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,1ea5c9ee-4318-48bc-8f87-d2a5ce9262bf.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=1ea5c9ee-4318-48bc-8f87-d2a5ce9262bf</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Hi!<br /><br />
Recently a couple of different question askers at the microsoft.public.biztalk.something
newsgroups have been asking questions about how to expose a BizTalk orchestration
that takes an System.Xml.XmlDocument as input and also returnes a System.Xml.XmlDocument.<br /><br />
Basically, it is straight forward:<br /><ol><li>
You define two messages in your orchestration as being of the type "System.Xml.XmlDocument"</li><li>
You add a receive shape that accepts one of the messages</li><li>
You add a construct shape that constructs the return message</li><li>
You add a send shape that sends the output message</li><li>
You add a <b>public</b> request-response port and connect the receive- and send shapes
to this port.</li><li>
You publish the orchestration using the Web Services Publishing Wizard.</li></ol>
A couple of issues:<br /><ol><li>
If you are deploying the web service to the same web site as your Windows SharePoint
Services is running on, you have to exclude the path to the new web service, so that
WSS wont try to take over the calls to the web service. This is done like this:</li></ol><ul><li>
Administrative Tools</li><li>
SharePoint Central Administration</li><li>
Configure Virtual Server Settings</li><li>
Choose the web site you have extended with WSS and to which you now want to deploy
a web service</li><li>
Define Managed Paths</li><li>
Under "Add new Path", add your path and click "excluded path" and "OK"</li></ul><li>
The virtual directory that is created by the wizard must run under an application
pool that is running under a user that is a member of the "BizTalk Isolated Host Users".
Otherwise you will get a SOAP exception when trying to call the web service.</li>
And another thing that someone had dificulty with: When writing a small application
to test the published web service, he got an error that said:<br />
Compilation error:<br /><br />
            Error   
1    The best overloaded method match for 
<br />
'UNTTest.ws.UntypedWebService_Orchestration_That_Receives_and_Sends_XML_InputOutputPort.SendXMLAndGetAnswer(ref 
<br />
System.Xml.XmlNode)' has some invalid arguments    C:\Documents and 
<br />
Settings\simon.brooks\My Documents\UNTTest\Form1.cs    25   
13    UNTTest<br /><br />
            Error   
2    Argument '1': cannot convert from 'ref 
<br />
System.Xml.XmlDocument' to 'ref System.Xml.XmlNode'    C:\Documents
and 
<br />
Settings\simon.brooks\My Documents\UNTTest\Form1.cs    25   
41    UNTTest<br /><br />
Basically, the web service doesn't take an XmlDocument as a parameter, as one would
have expected, but an XmlNode instead.<br /><br />
So after creating an XmlDocument to send to the web service, define an XmlNode object,
and set it to point to the DocumentElement property of the XmlDcoument, and send that
instead.<br />
Like this:<br />
            XmlDocument xmldoc
= new XmlDocument();<br />
            xmldoc.LoadXml("&lt;rootnode&gt;&lt;element1&gt;value1&lt;/element1&gt;&lt;/rootnode&gt;");<br />
            XmlNode node =
xmldoc.DocumentElement;<br />
            WebserviceReference
ws = new WebserviceReference();<br />
            ws.Operation_1(ref
node);<br /><br />
I hope this helps.<br /><br />
My sampel BizTalk project can be found here: <a href="http://blog.eliasen.dk/content/binary/UntypedWebService.zip">UntypedWebService.zip
(102.58 KB)</a><br /><br />
Should you have any comments, feel free to post them.<br /><br />
-- 
<br />
eliasen<br /><img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=1ea5c9ee-4318-48bc-8f87-d2a5ce9262bf" /></body>
      <title>publishing an orchestration that accepts and sends System.Xml.XmlDocument</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,1ea5c9ee-4318-48bc-8f87-d2a5ce9262bf.aspx</guid>
      <link>http://blog.eliasen.dk/2006/10/22/publishingAnOrchestrationThatAcceptsAndSendsSystemXmlXmlDocument.aspx</link>
      <pubDate>Sun, 22 Oct 2006 22:01:48 GMT</pubDate>
      <description>Hi!&lt;br&gt;
&lt;br&gt;
Recently a couple of different question askers at the microsoft.public.biztalk.something
newsgroups have been asking questions about how to expose a BizTalk orchestration
that takes an System.Xml.XmlDocument as input and also returnes a System.Xml.XmlDocument.&lt;br&gt;
&lt;br&gt;
Basically, it is straight forward:&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;
You define two messages in your orchestration as being of the type "System.Xml.XmlDocument"&lt;/li&gt;
&lt;li&gt;
You add a receive shape that accepts one of the messages&lt;/li&gt;
&lt;li&gt;
You add a construct shape that constructs the return message&lt;/li&gt;
&lt;li&gt;
You add a send shape that sends the output message&lt;/li&gt;
&lt;li&gt;
You add a &lt;b&gt;public&lt;/b&gt; request-response port and connect the receive- and send shapes
to this port.&lt;/li&gt;
&lt;li&gt;
You publish the orchestration using the Web Services Publishing Wizard.&lt;/li&gt;
&lt;/ol&gt;
A couple of issues:&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;
If you are deploying the web service to the same web site as your Windows SharePoint
Services is running on, you have to exclude the path to the new web service, so that
WSS wont try to take over the calls to the web service. This is done like this:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
Administrative Tools&lt;/li&gt;
&lt;li&gt;
SharePoint Central Administration&lt;/li&gt;
&lt;li&gt;
Configure Virtual Server Settings&lt;/li&gt;
&lt;li&gt;
Choose the web site you have extended with WSS and to which you now want to deploy
a web service&lt;/li&gt;
&lt;li&gt;
Define Managed Paths&lt;/li&gt;
&lt;li&gt;
Under "Add new Path", add your path and click "excluded path" and "OK"&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
The virtual directory that is created by the wizard must run under an application
pool that is running under a user that is a member of the "BizTalk Isolated Host Users".
Otherwise you will get a SOAP exception when trying to call the web service.&lt;/li&gt;&gt;
And another thing that someone had dificulty with: When writing a small application
to test the published web service, he got an error that said:&lt;br&gt;
Compilation error:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error&amp;nbsp;&amp;nbsp;&amp;nbsp;
1&amp;nbsp;&amp;nbsp;&amp;nbsp; The best overloaded method match for 
&lt;br&gt;
'UNTTest.ws.UntypedWebService_Orchestration_That_Receives_and_Sends_XML_InputOutputPort.SendXMLAndGetAnswer(ref 
&lt;br&gt;
System.Xml.XmlNode)' has some invalid arguments&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Documents and 
&lt;br&gt;
Settings\simon.brooks\My Documents\UNTTest\Form1.cs&amp;nbsp;&amp;nbsp;&amp;nbsp; 25&amp;nbsp;&amp;nbsp;&amp;nbsp;
13&amp;nbsp;&amp;nbsp;&amp;nbsp; UNTTest&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error&amp;nbsp;&amp;nbsp;&amp;nbsp;
2&amp;nbsp;&amp;nbsp;&amp;nbsp; Argument '1': cannot convert from 'ref 
&lt;br&gt;
System.Xml.XmlDocument' to 'ref System.Xml.XmlNode'&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\Documents
and 
&lt;br&gt;
Settings\simon.brooks\My Documents\UNTTest\Form1.cs&amp;nbsp;&amp;nbsp;&amp;nbsp; 25&amp;nbsp;&amp;nbsp;&amp;nbsp;
41&amp;nbsp;&amp;nbsp;&amp;nbsp; UNTTest&lt;br&gt;
&lt;br&gt;
Basically, the web service doesn't take an XmlDocument as a parameter, as one would
have expected, but an XmlNode instead.&lt;br&gt;
&lt;br&gt;
So after creating an XmlDocument to send to the web service, define an XmlNode object,
and set it to point to the DocumentElement property of the XmlDcoument, and send that
instead.&lt;br&gt;
Like this:&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlDocument xmldoc
= new XmlDocument();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmldoc.LoadXml("&amp;lt;rootnode&amp;gt;&amp;lt;element1&amp;gt;value1&amp;lt;/element1&amp;gt;&amp;lt;/rootnode&amp;gt;");&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlNode node =
xmldoc.DocumentElement;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WebserviceReference
ws = new WebserviceReference();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ws.Operation_1(ref
node);&lt;br&gt;
&lt;br&gt;
I hope this helps.&lt;br&gt;
&lt;br&gt;
My sampel BizTalk project can be found here: &lt;a href="http://blog.eliasen.dk/content/binary/UntypedWebService.zip"&gt;UntypedWebService.zip
(102.58 KB)&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
Should you have any comments, feel free to post them.&lt;br&gt;
&lt;br&gt;
-- 
&lt;br&gt;
eliasen&lt;br&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=1ea5c9ee-4318-48bc-8f87-d2a5ce9262bf" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,1ea5c9ee-4318-48bc-8f87-d2a5ce9262bf.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=44fab7d1-edde-4d75-b477-6e1dc676c34a</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,44fab7d1-edde-4d75-b477-6e1dc676c34a.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,44fab7d1-edde-4d75-b477-6e1dc676c34a.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=44fab7d1-edde-4d75-b477-6e1dc676c34a</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
Every now and then, I come across the need of adding a node to the output of a BizTalk
map.
</p>
        <p>
Now, if I just want to add some node which isn't dependent on the input, I can just
use a custom scripting functoid which is an XSLT template that just craeted the node
for me, like this:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/addinganode1.JPG" border="0" />
        </p>
        <p>
Use the "Inline XSLT Call Template" instead, if you need parameters to your XSLT.
</p>
        <p>
BUT, sometimes I need to add a node to a list of existing nodes. One example of this
I came across was the need to have a log inside the XML structure that was updated
every time BizTalk touched the document. So there would be a structure inside the
XML like this:
</p>
        <p>
&lt;TheLog&gt;<br />
&lt;LogEntry&gt;This is the first log entry and it was added by Jan&lt;/LogEntry&gt;<br />
&lt;LogEntry&gt;This is the second entry and it was added by BizTalk&lt;/LogEntry&gt;<br />
&lt;/TheLog&gt;
</p>
        <p>
So BizTalk needed to add a line to TheLog when BizTalk mapped the document. 
</p>
        <p>
Another example is a guy on the microsoft.public.biztalk.general newsgroup that needs
to add an OrderItem to an existing list of OrderItems.
</p>
        <p>
To do this, I have only found one solution, which is a custom xslt script that does
the whole thing.
</p>
        <p>
My example input schema:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/addinganode_inputschema.JPG" border="0" />
        </p>
        <p>
My example output schema:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/addinganode_outputschema.JPG" border="0" />
        </p>
        <p>
In both schemas, the "Order"-element can occur multiple times.
</p>
        <p>
The map looks like this:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/addinganode_map.JPG" border="0" />
        </p>
        <p>
Basically, just one scripting functoid. Note that no links go from the source document.
The scripting functoid is a "Inline XSLT" type, and the source is this:
</p>
        <p>
&lt;xsl:for-each select="//Orders/Order"&gt;<br />
&lt;xsl:element name="Order"&gt;<br />
&lt;xsl:element name="Ordernumber"&gt;&lt;xsl:value-of select="Ordernumber" /&gt;&lt;/xsl:element&gt;<br />
&lt;xsl:element name="OrderAmount"&gt;&lt;xsl:value-of select="Amount" /&gt;&lt;/xsl:element&gt;<br />
&lt;/xsl:element&gt;<br />
&lt;/xsl:for-each&gt;
</p>
        <p>
&lt;xsl:element name="Order"&gt;<br />
    &lt;xsl:element name="Ordernumber"&gt;400&lt;/xsl:element&gt;<br />
    &lt;xsl:element name="OrderAmount"&gt;40&lt;/xsl:element&gt;<br />
&lt;/xsl:element&gt;
</p>
        <p>
Basically, the for-each creates line in the output according to the input XML document.
And the xsl:element after the for-each creates the new node.
</p>
        <p>
You can find my BizTalk 2006 project here: <a href="http://blog.eliasen.dk/content/binary/AddingANode.zip">AddingANode.zip
(16,89 KB)</a> - it should work with BizTalk 2004 as well.
</p>
        <p>
I hope this has helped someone. Comments are welcome.
</p>
        <p>
-- 
</p>
        <p>
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=44fab7d1-edde-4d75-b477-6e1dc676c34a" />
      </body>
      <title>Adding a node to the output of a BizTalk map</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,44fab7d1-edde-4d75-b477-6e1dc676c34a.aspx</guid>
      <link>http://blog.eliasen.dk/2006/10/13/AddingANodeToTheOutputOfABizTalkMap.aspx</link>
      <pubDate>Fri, 13 Oct 2006 21:26:57 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
Every now and then, I come across the need of adding a node to the output of a BizTalk
map.
&lt;/p&gt;
&lt;p&gt;
Now, if I just want to add some node which isn't dependent on the input, I can just
use a custom scripting functoid which is an XSLT template that just craeted the node
for me, like this:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/addinganode1.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Use the "Inline XSLT Call Template" instead, if you need parameters to your XSLT.
&lt;/p&gt;
&lt;p&gt;
BUT, sometimes I need to add a node to a list of existing nodes. One example of this
I came across was the need to have a log inside the XML structure that was updated
every time BizTalk touched the document. So there would be a structure inside the
XML like this:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;TheLog&amp;gt;&lt;br&gt;
&amp;lt;LogEntry&amp;gt;This is the first log entry and it was added by Jan&amp;lt;/LogEntry&amp;gt;&lt;br&gt;
&amp;lt;LogEntry&amp;gt;This is the second entry and it was added by BizTalk&amp;lt;/LogEntry&amp;gt;&lt;br&gt;
&amp;lt;/TheLog&amp;gt;
&lt;/p&gt;
&lt;p&gt;
So BizTalk needed to add a line to TheLog when BizTalk mapped the document. 
&lt;/p&gt;
&lt;p&gt;
Another example is a guy on the microsoft.public.biztalk.general newsgroup that needs
to add an OrderItem to an existing list of OrderItems.
&lt;/p&gt;
&lt;p&gt;
To do this, I have only found one solution, which is a custom xslt script that does
the whole thing.
&lt;/p&gt;
&lt;p&gt;
My example input schema:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/addinganode_inputschema.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
My example output schema:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/addinganode_outputschema.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
In both schemas, the "Order"-element can occur multiple times.
&lt;/p&gt;
&lt;p&gt;
The map looks like this:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/addinganode_map.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Basically, just one scripting functoid. Note that no links go from the source document.
The scripting functoid is a "Inline XSLT" type, and the source is this:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;xsl:for-each select="//Orders/Order"&amp;gt;&lt;br&gt;
&amp;lt;xsl:element name="Order"&amp;gt;&lt;br&gt;
&amp;lt;xsl:element name="Ordernumber"&amp;gt;&amp;lt;xsl:value-of select="Ordernumber" /&amp;gt;&amp;lt;/xsl:element&amp;gt;&lt;br&gt;
&amp;lt;xsl:element name="OrderAmount"&amp;gt;&amp;lt;xsl:value-of select="Amount" /&amp;gt;&amp;lt;/xsl:element&amp;gt;&lt;br&gt;
&amp;lt;/xsl:element&amp;gt;&lt;br&gt;
&amp;lt;/xsl:for-each&amp;gt;
&lt;/p&gt;
&lt;p&gt;
&amp;lt;xsl:element name="Order"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:element name="Ordernumber"&amp;gt;400&amp;lt;/xsl:element&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:element name="OrderAmount"&amp;gt;40&amp;lt;/xsl:element&amp;gt;&lt;br&gt;
&amp;lt;/xsl:element&amp;gt;
&lt;/p&gt;
&lt;p&gt;
Basically, the for-each creates line in the output according to the input XML document.
And the xsl:element after the for-each creates the new node.
&lt;/p&gt;
&lt;p&gt;
You can find my BizTalk 2006 project here: &lt;a href="http://blog.eliasen.dk/content/binary/AddingANode.zip"&gt;AddingANode.zip
(16,89 KB)&lt;/a&gt;&amp;nbsp;- it should work with BizTalk 2004 as well.
&lt;/p&gt;
&lt;p&gt;
I hope this has helped someone. Comments are welcome.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;/p&gt;
&lt;p&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=44fab7d1-edde-4d75-b477-6e1dc676c34a" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,44fab7d1-edde-4d75-b477-6e1dc676c34a.aspx</comments>
      <category>BizTalk 2004</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=56dfe07d-386b-4706-b7f9-7d9d15861459</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,56dfe07d-386b-4706-b7f9-7d9d15861459.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,56dfe07d-386b-4706-b7f9-7d9d15861459.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=56dfe07d-386b-4706-b7f9-7d9d15861459</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
A user in the microsoft.public.biztalk.general newsgroup has a challenge he'd like
solved.
</p>
        <p>
Basically, he has this structure:
</p>
        <p>
&lt;Root&gt;<br />
  &lt;Employee&gt;<br />
     &lt;EmployeeID&gt;1&lt;/EmployeeID&gt;<br />
     &lt;JobsAssigned&gt;10&lt;/JobsAssigned&gt;<br />
  &lt;/Employee&gt;<br />
  &lt;Employee&gt;<br />
     &lt;EmployeeID&gt;2&lt;/EmployeeID&gt;<br />
     &lt;JobsAssigned&gt;5&lt;/JobsAssigned&gt;<br />
  &lt;/Employee&gt;<br />
  &lt;Employee&gt;<br />
     &lt;EmployeeID&gt;3&lt;/EmployeeID&gt;<br />
     &lt;JobsAssigned&gt;8&lt;/JobsAssigned&gt;<br />
  &lt;/Employee&gt;<br />
&lt;/Root&gt;
</p>
        <p>
And he needs to find the EmployeeID of the employee that has the least jobs assigned
to him/her. In this case, he needs the value "2".
</p>
        <p>
This is a case, where the "Cumulative Minimum" functoid can be used.
</p>
        <p>
So, I have this input schema:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/instance_schema_cumulative_minimum.JPG" border="0" />
        </p>
        <p>
and I have this fictitious output schema:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/output_schema_cumulative_minimum.JPG" border="0" />
        </p>
        <p>
To do the task, I use this map:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/map_cumulative_minimum.JPG" border="0" />
        </p>
        <p>
Basically, I just map the fields, and then I make sure the "MinValues"-record is only
created when the JobsAssigned value is equal to the cumulative minimum of the JobsAssigned.
</p>
        <p>
The "Cumulative Minimum" functoid will return the smallest number of all the numbers
it is given as input.
</p>
        <p>
So, given the above mentioned input instance, the output of this map will be:
</p>
        <p>
&lt;ns0:OutputRoot xmlns:ns0="<a href="http://CumulativeMinimum.OutputSchema">http://CumulativeMinimum.OutputSchema</a>"&gt;<br />
&lt;MinValues&gt;<br />
  &lt;Employee&gt;2&lt;/Employee&gt; 
<br />
  &lt;JobsAssigned&gt;5&lt;/JobsAssigned&gt; <br />
&lt;/MinValues&gt;<br />
&lt;/ns0:OutputRoot&gt;
</p>
        <p>
which, luckily, was what we needed :-)
</p>
        <p>
Given an instance with more than one Employee hacing the same number of JobsAssigned
and if this number is the minimum, the map will actually create a node for each.
</p>
        <p>
As I don't know more of what the question-asker wants, I will let this be enough for
now. Should it not be ok to return more than one EmployeeID in the output, the map
will need to be changed.
</p>
        <p>
I hope this has helped someone.
</p>
        <p>
You can find a BizTalk 2006 project here: <a href="http://blog.eliasen.dk/content/binary/CumulativeMinimum.zip">CumulativeMinimum.zip
(4,51 KB)</a></p>
        <p>
The same will work for BizTalk 2004 - I just haven't been bothered creating the example.
Let me know if you need it.
</p>
        <p>
-- 
</p>
        <p>
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=56dfe07d-386b-4706-b7f9-7d9d15861459" />
      </body>
      <title>Cumulative Minimum - an example</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,56dfe07d-386b-4706-b7f9-7d9d15861459.aspx</guid>
      <link>http://blog.eliasen.dk/2006/10/13/CumulativeMinimumAnExample.aspx</link>
      <pubDate>Fri, 13 Oct 2006 20:23:30 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
A user in the microsoft.public.biztalk.general newsgroup has a challenge he'd like
solved.
&lt;/p&gt;
&lt;p&gt;
Basically, he has this structure:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;Root&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;Employee&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;EmployeeID&amp;gt;1&amp;lt;/EmployeeID&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;JobsAssigned&amp;gt;10&amp;lt;/JobsAssigned&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/Employee&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;Employee&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;EmployeeID&amp;gt;2&amp;lt;/EmployeeID&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;JobsAssigned&amp;gt;5&amp;lt;/JobsAssigned&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/Employee&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;Employee&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;EmployeeID&amp;gt;3&amp;lt;/EmployeeID&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;JobsAssigned&amp;gt;8&amp;lt;/JobsAssigned&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/Employee&amp;gt;&lt;br&gt;
&amp;lt;/Root&amp;gt;
&lt;/p&gt;
&lt;p&gt;
And he needs to find the EmployeeID of the employee that has the least jobs assigned
to him/her. In this case, he needs the value "2".
&lt;/p&gt;
&lt;p&gt;
This is a case, where the "Cumulative Minimum" functoid can be used.
&lt;/p&gt;
&lt;p&gt;
So, I have this input schema:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/instance_schema_cumulative_minimum.JPG" border="0"&gt;
&lt;/p&gt;
&lt;p&gt;
and I have this fictitious output schema:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/output_schema_cumulative_minimum.JPG" border="0"&gt;
&lt;/p&gt;
&lt;p&gt;
To do the task, I use this map:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/map_cumulative_minimum.JPG" border="0"&gt;
&lt;/p&gt;
&lt;p&gt;
Basically, I just map the fields, and then I make sure the "MinValues"-record is only
created when the JobsAssigned value is equal to the cumulative minimum of the JobsAssigned.
&lt;/p&gt;
&lt;p&gt;
The "Cumulative Minimum" functoid will return the smallest number of all the numbers
it is given as input.
&lt;/p&gt;
&lt;p&gt;
So, given the above mentioned input instance, the output of this map will be:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;ns0:OutputRoot xmlns:ns0="&lt;a href="http://CumulativeMinimum.OutputSchema"&gt;http://CumulativeMinimum.OutputSchema&lt;/a&gt;"&amp;gt;&lt;br&gt;
&amp;lt;MinValues&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;Employee&amp;gt;2&amp;lt;/Employee&amp;gt; 
&lt;br&gt;
&amp;nbsp; &amp;lt;JobsAssigned&amp;gt;5&amp;lt;/JobsAssigned&amp;gt;&amp;nbsp;&lt;br&gt;
&amp;lt;/MinValues&amp;gt;&lt;br&gt;
&amp;lt;/ns0:OutputRoot&amp;gt;
&lt;/p&gt;
&lt;p&gt;
which, luckily, was what we needed :-)
&lt;/p&gt;
&lt;p&gt;
Given an instance with more than one Employee hacing the same number of JobsAssigned
and if this number is the minimum, the map will actually create a node for each.
&lt;/p&gt;
&lt;p&gt;
As I don't know more of what the question-asker wants, I will let this be enough for
now. Should it not be ok to return more than one EmployeeID in the output, the map
will need to be changed.
&lt;/p&gt;
&lt;p&gt;
I hope this has helped someone.
&lt;/p&gt;
&lt;p&gt;
You can find a BizTalk 2006&amp;nbsp;project here: &lt;a href="http://blog.eliasen.dk/content/binary/CumulativeMinimum.zip"&gt;CumulativeMinimum.zip
(4,51 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
The same will work for BizTalk 2004 - I just haven't been bothered creating the example.
Let me know if you need it.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;/p&gt;
&lt;p&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=56dfe07d-386b-4706-b7f9-7d9d15861459" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,56dfe07d-386b-4706-b7f9-7d9d15861459.aspx</comments>
      <category>BizTalk 2004</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=6d6a1434-15b2-4502-b2a4-347b56b9d58d</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,6d6a1434-15b2-4502-b2a4-347b56b9d58d.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,6d6a1434-15b2-4502-b2a4-347b56b9d58d.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=6d6a1434-15b2-4502-b2a4-347b56b9d58d</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
A colleague of mine, Morten la Cour Thomsen, who is "MCTS: BizTalk Server 2004" AND
"MCTS: BizTalk Server 2006" discovered something strange the other day. In fact, it
is so strange, that I thought I'd share it here on my blog.
</p>
        <p>
Morten was on a project, where he had taken over another persons BizTalk solution.
Unfortunately for Morten, the other guy had decided to put all artefacts into one
single assembly. That's right - all schemas, all maps, pipelines, orchestrations..
the works! Just one big assembly.
</p>
        <p>
This turned out to be quite a problem for the company that had this solution, since
versioning any single artefact meant versioning the whole thing. That is also why
they until now didn't version anything. Should something need to be changed in the
big assembly, four steps were performed:
</p>
        <ol>
          <li>
Stop all receive locations 
</li>
          <li>
Make the change in the artefact that needed changing 
</li>
          <li>
Wait until all long running transactions have stopped 
</li>
          <li>
Deploy the new assembly on top of the old one, leaving all versionnumbers the same</li>
        </ol>
        <p>
Mortens job was to create a better architecture, since it really wasn't ok with the
customer to have to stop receiving new messages until all orchestrations had stopped.
</p>
        <p>
One of the steps Morten came across was that he actually at some point needed to call
an orchestration that was inside this big assembly. The orchestration that Morten
needed to call was being called from other orchestrations inside the assembly, so
it was ready to be called (no activate receive shape, etc.). The only problem for
Morten was, that the orchestration, off course, was internal to the assembly. Morten
could reference the assembly, but he couldn't call the orchestration from within an
"Call Orchestration"-shape.
</p>
        <p>
But that's when Morten tried something that I would never have thought of trying:
He had the source code for the big assembly. And he had the keyfile that had been
used to sign it. So he changed the orchestration to be public, recompiled the big
assembly, referenced the newly compiled assembly, added the former internal orchestration
to his "Call Orchestration"-shape and compiled his own assembly.
</p>
        <p>
He now deployed his own assembly, but left the old big assembly in place. 
</p>
        <p>
Now he had the old big assembly, which still had the internal orchestration inside
it. And he had another deployed assembly, which was compiled against the source code
with a public orchestration. The big assembly was never redeployed!
</p>
        <p>
But it worked! Mortens orchestration is now calling the internal orchestration of
the other assembly, simply because it was compiled against a public orchestration
and the signature of the deployed big assembly matches the signature of his newly
compiled big assembly.
</p>
        <p>
Very weird, indeed. And it probably isn't meant to do that...
</p>
        <p>
I have a sample solution for BizTalk 2004 you can look at right here: <a href="http://blog.eliasen.dk/content/binary/InternalOrchestration.zip">InternalOrchestration.zip
(132 KB)</a></p>
        <p>
And two sample projects for BizTalk 2006 right here: <a href="http://blog.eliasen.dk/content/binary/Calling Internal Orchestration.zip">Calling
Internal Orchestration.zip (146,46 KB)</a></p>
        <p>
In both cases, the code reflects the internal orchestration AFTER it has been set
to public. What you want to do is to
</p>
        <ol>
          <li>
Set the type to "internal" on the called internal orchestration.</li>
          <li>
Build and deploy the assembly with the internal orchestration.</li>
          <li>
Test it to see that it works.</li>
          <li>
Try to build the other assembly. It will fail because of the internal orchestration.</li>
          <li>
Set the type to "public" on the called orchestration.</li>
          <li>
Build and deploy the second assembly WITHOUT redeploying the first assembly.</li>
          <li>
Test it to make sure it works.</li>
        </ol>
        <p>
So, basically, now you have a way of calling an internal orchestration, as long as
you have the source code for it and the key to sign it.
</p>
        <p>
Hope this is useful for someone.
</p>
        <p>
-- 
</p>
        <p>
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=6d6a1434-15b2-4502-b2a4-347b56b9d58d" />
      </body>
      <title>Calling Internal Orchestration from another assembly.</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,6d6a1434-15b2-4502-b2a4-347b56b9d58d.aspx</guid>
      <link>http://blog.eliasen.dk/2006/09/24/CallingInternalOrchestrationFromAnotherAssembly.aspx</link>
      <pubDate>Sun, 24 Sep 2006 21:07:52 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
A colleague of mine, Morten la Cour Thomsen, who is "MCTS: BizTalk Server 2004" AND
"MCTS: BizTalk Server 2006" discovered something strange the other day. In fact, it
is so strange, that I thought I'd share it here on my blog.
&lt;/p&gt;
&lt;p&gt;
Morten was on a project, where he had taken over another persons BizTalk solution.
Unfortunately for Morten, the other guy had decided to put all artefacts into one
single assembly. That's right - all schemas, all maps, pipelines, orchestrations..
the works! Just one big assembly.
&lt;/p&gt;
&lt;p&gt;
This turned out to be quite a problem for the company that had this solution, since
versioning any single artefact meant versioning the whole thing. That is also why
they until now didn't version anything. Should something need to be changed in the
big assembly,&amp;nbsp;four steps were performed:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Stop all receive locations 
&lt;li&gt;
Make the change in the artefact that needed changing 
&lt;li&gt;
Wait until all long running transactions have stopped 
&lt;li&gt;
Deploy the new assembly on top of the old one, leaving all versionnumbers the same&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Mortens job was to create a better architecture, since it really wasn't ok with the
customer to have to stop receiving new messages until all orchestrations had stopped.
&lt;/p&gt;
&lt;p&gt;
One of the steps Morten came across was that he actually at some point needed to call
an orchestration that was inside this big assembly. The orchestration that Morten
needed to call was being called from other orchestrations inside the assembly, so
it was ready to be called (no activate receive shape, etc.). The only problem for
Morten was, that the orchestration, off course, was internal to the assembly. Morten
could reference the assembly, but he couldn't call the orchestration from within an
"Call Orchestration"-shape.
&lt;/p&gt;
&lt;p&gt;
But that's when Morten tried something that I would never have thought of trying:
He had the source code for the big assembly. And he had the keyfile that had been
used to sign it. So he changed the orchestration to be public, recompiled the big
assembly, referenced the newly compiled assembly, added the former internal orchestration
to his "Call Orchestration"-shape and compiled his own assembly.
&lt;/p&gt;
&lt;p&gt;
He now deployed his own assembly, but left the old big assembly in place. 
&lt;/p&gt;
&lt;p&gt;
Now he had the old big assembly, which still had the internal orchestration inside
it. And he had another deployed assembly, which was compiled against the source code
with a public orchestration. The big assembly was never redeployed!
&lt;/p&gt;
&lt;p&gt;
But it worked! Mortens orchestration is now calling the internal orchestration of
the other assembly, simply because it was compiled against a public orchestration
and the signature of the deployed big assembly matches the signature of his newly
compiled big assembly.
&lt;/p&gt;
&lt;p&gt;
Very weird, indeed. And it probably isn't meant to do that...
&lt;/p&gt;
&lt;p&gt;
I have a sample solution for BizTalk 2004 you can look at right here: &lt;a href="http://blog.eliasen.dk/content/binary/InternalOrchestration.zip"&gt;InternalOrchestration.zip
(132 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
And two&amp;nbsp;sample projects for BizTalk 2006 right here: &lt;a href="http://blog.eliasen.dk/content/binary/Calling Internal Orchestration.zip"&gt;Calling
Internal Orchestration.zip (146,46 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
In both cases, the code reflects the internal orchestration AFTER it has been set
to public. What you want to do is to
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Set the type to "internal" on the called internal orchestration.&lt;/li&gt;
&lt;li&gt;
Build and deploy the assembly with the internal orchestration.&lt;/li&gt;
&lt;li&gt;
Test it to see that it works.&lt;/li&gt;
&lt;li&gt;
Try to build the other assembly. It will fail because of the internal orchestration.&lt;/li&gt;
&lt;li&gt;
Set the type to "public" on the called orchestration.&lt;/li&gt;
&lt;li&gt;
Build and deploy the second assembly WITHOUT redeploying the first assembly.&lt;/li&gt;
&lt;li&gt;
Test it to make sure it works.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
So, basically, now you have a way of calling an internal orchestration, as long as
you have the source code for it and the key to sign it.
&lt;/p&gt;
&lt;p&gt;
Hope this is useful for someone.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;/p&gt;
&lt;p&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=6d6a1434-15b2-4502-b2a4-347b56b9d58d" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,6d6a1434-15b2-4502-b2a4-347b56b9d58d.aspx</comments>
      <category>BizTalk 2004</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=3e79edda-d890-4521-9b46-8d6f70c94502</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,3e79edda-d890-4521-9b46-8d6f70c94502.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,3e79edda-d890-4521-9b46-8d6f70c94502.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=3e79edda-d890-4521-9b46-8d6f70c94502</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
A guy (I think it is a guy, anyways :-) ) on the microsoft.public.biztalk.orchestration
newsgroup has a problem with this issue. And since I had the issue myself a long
time ago, and always wanted to write a quick blog entry about it, this seemed like
a perfect time for it :-)
</p>
        <p>
A quick note: This issue appears on both BizTalk 2004 and BizTalk 2006.
</p>
        <p>
So basically, the problem is: When compiling a BizTalk project, you get the "'projectname.orchestrationname':
cannot resolve imported 'service'" error. This occurs when you are compiling a project
that has an orchestration inside it, that calls another orchestration in another project
that again calls an orchestration in a third project. Confused? I bet! I will give
you details, screenshots and explanations in just a few lines.
</p>
        <p>
The quick answer is: The project you are trying to compile must reference the third
project.
</p>
        <p>
BUT, to the long answer:
</p>
        <p>
I have created a solution with three projects:
</p>
        <ul>
          <li>
ProjectA with ABCSchema.xsd and OrchestrationA.odx 
<ul><li>
Orchestration A does this 
<ul><li>
Receive a message of type ABCSchema.xsd 
</li><li>
Initialize a string variable to receive the value from a distinguished field in ABCSchema 
</li><li>
Write the value to the eventlog 
</li><li>
Call OrchestrationB</li></ul></li></ul></li>
          <li>
ProjectB with OrchestrationB.odx 
<ul><li>
Orchestration B does this: 
<ul><li>
Receive the string parameter from OrchestrationA 
</li><li>
Write the value to the eventlog 
</li><li>
Call OrchestrationC</li></ul></li></ul></li>
          <li>
ProjectC with OrchestrationC.odx 
<ul><li>
Orchestration C does this: 
<ul><li>
Receive the string parameter from OrchestrationB 
</li><li>
Write the value to the eventlog</li></ul></li></ul></li>
        </ul>
        <p>
Screenshots:
</p>
        <p>
The (very small) schema:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/ABCSchema.jpg" border="0" />
        </p>
        <p>
OrchestrationA:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/OrchestrationA.JPG" border="0" />
        </p>
        <p>
OrchestrationB:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/OrchestrationB.JPG" border="0" />
        </p>
        <p>
OrchestrationC:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/OrchestrationC.jpg" border="0" />
        </p>
        <p>
No hokus pokus at all!
</p>
        <p>
In order to call OrchestrationC from OrchestrationB, I added a reference to ProjectC
from ProjectB. Both ProjectB and ProjectC compile just fine.
</p>
        <p>
In order to call OrchestrationB from OrchestrationA, I add a reference to ProjectB
from ProjectA, but ProjectA wont compile. I get this error:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/ABC Error.jpg" border="0" />
        </p>
        <p>
The famous "cannot resolve imported 'service'" error.
</p>
        <p>
BUT, referencing ProjectC from ProjectA solves this issue, and I can compile just
fine.
</p>
        <p>
Actually, the error description indicates it. When compiling ProjectA, it can't import
the "ProjectC.OrchestrationC" service. But often, you are maybe compiling the entire
solution, and you just see that the file in quesion is projectb.dll. But the error
just states that ProjectA cannot import ProjectC.OrchestrationC, which it needs to
according to projectb.dll.
</p>
        <p>
Should anyone think that it is really silly that ProjectA needs to reference
a dll that another dll references and that this breaks all nice architectures, I would
agree. If someone gives me a set of 20 dll's that make up a nice solution he/she has
made, and I need to call an orchestration in one of them, then I also need to reference
all the dll's that this one dll references, assuming there are internal "Call Orchestration"s
between these dll's. I will need to know how these dll's reference eachother in order
to reference one of them. Really silly, indeed.
</p>
        <p>
I don't know why they have made it like this, but they have.
</p>
        <p>
I hope this post helps others.
</p>
        <p>
Should you have comments, please don't hesitate... My three projects can be found
here: <a href="http://blog.eliasen.dk/content/binary/A_calls_B_calls_C.zip">A_calls_B_calls_C.zip
(137,08 KB)</a></p>
        <p>
-- 
</p>
        <p>
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=3e79edda-d890-4521-9b46-8d6f70c94502" />
      </body>
      <title>cannot resolve imported 'service'</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,3e79edda-d890-4521-9b46-8d6f70c94502.aspx</guid>
      <link>http://blog.eliasen.dk/2006/09/16/cannotResolveImportedService.aspx</link>
      <pubDate>Sat, 16 Sep 2006 12:00:22 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
A guy (I think it is a guy, anyways :-) )&amp;nbsp;on the microsoft.public.biztalk.orchestration
newsgroup has&amp;nbsp;a problem with this issue. And since I had the issue myself a long
time ago, and always wanted to write a quick blog entry about it, this seemed like
a perfect time for it :-)
&lt;/p&gt;
&lt;p&gt;
A quick note: This issue appears on both BizTalk 2004 and BizTalk 2006.
&lt;/p&gt;
&lt;p&gt;
So basically, the problem is: When compiling a BizTalk project, you get the "'projectname.orchestrationname':
cannot resolve imported 'service'" error. This occurs when you are compiling a project
that has an orchestration inside it, that calls another orchestration in another project
that again calls an orchestration in a third project. Confused? I bet! I will give
you details, screenshots and explanations in just a few lines.
&lt;/p&gt;
&lt;p&gt;
The quick answer is: The project you are trying to compile must reference the third
project.
&lt;/p&gt;
&lt;p&gt;
BUT, to the long answer:
&lt;/p&gt;
&lt;p&gt;
I have created a solution with three projects:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
ProjectA with ABCSchema.xsd and OrchestrationA.odx 
&lt;ul&gt;
&lt;li&gt;
Orchestration A does this 
&lt;ul&gt;
&lt;li&gt;
Receive a message of type ABCSchema.xsd 
&lt;li&gt;
Initialize a string variable to receive the value from a distinguished field in ABCSchema 
&lt;li&gt;
Write the value to the eventlog 
&lt;li&gt;
Call OrchestrationB&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
ProjectB with OrchestrationB.odx 
&lt;ul&gt;
&lt;li&gt;
Orchestration B does this: 
&lt;ul&gt;
&lt;li&gt;
Receive the string parameter from OrchestrationA 
&lt;li&gt;
Write the value to the eventlog 
&lt;li&gt;
Call OrchestrationC&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
ProjectC with OrchestrationC.odx 
&lt;ul&gt;
&lt;li&gt;
Orchestration C does this: 
&lt;ul&gt;
&lt;li&gt;
Receive the string parameter from OrchestrationB 
&lt;li&gt;
Write the value to the eventlog&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Screenshots:
&lt;/p&gt;
&lt;p&gt;
The (very small) schema:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/ABCSchema.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
OrchestrationA:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/OrchestrationA.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
OrchestrationB:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/OrchestrationB.JPG" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
OrchestrationC:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/OrchestrationC.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
No hokus pokus at all!
&lt;/p&gt;
&lt;p&gt;
In order to call OrchestrationC from OrchestrationB, I added a reference to ProjectC
from ProjectB. Both ProjectB and ProjectC compile just fine.
&lt;/p&gt;
&lt;p&gt;
In order to call OrchestrationB from OrchestrationA, I add a reference to ProjectB
from ProjectA, but ProjectA wont compile. I get this error:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/ABC Error.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
The famous "cannot resolve imported 'service'" error.
&lt;/p&gt;
&lt;p&gt;
BUT, referencing ProjectC from ProjectA solves this issue, and I can compile just
fine.
&lt;/p&gt;
&lt;p&gt;
Actually, the error description indicates it. When compiling ProjectA, it can't import
the "ProjectC.OrchestrationC" service. But often, you are maybe compiling the entire
solution, and you just see that the file in quesion is projectb.dll. But the error
just states that ProjectA cannot import ProjectC.OrchestrationC, which it needs to
according to projectb.dll.
&lt;/p&gt;
&lt;p&gt;
Should anyone think that it is&amp;nbsp;really silly that ProjectA needs to reference
a dll that another dll references and that this breaks all nice architectures, I would
agree. If someone gives me a set of 20 dll's that make up a nice solution he/she has
made, and I need to call an orchestration in one of them, then I also need to reference
all the dll's that this one dll references, assuming there are internal "Call Orchestration"s
between these dll's. I will need to know how these dll's reference eachother in order
to reference one of them. Really silly, indeed.
&lt;/p&gt;
&lt;p&gt;
I don't know why they have made it like this, but they have.
&lt;/p&gt;
&lt;p&gt;
I hope this post helps others.
&lt;/p&gt;
&lt;p&gt;
Should you have comments, please don't hesitate... My three projects can be found
here: &lt;a href="http://blog.eliasen.dk/content/binary/A_calls_B_calls_C.zip"&gt;A_calls_B_calls_C.zip
(137,08 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;/p&gt;
&lt;p&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=3e79edda-d890-4521-9b46-8d6f70c94502" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,3e79edda-d890-4521-9b46-8d6f70c94502.aspx</comments>
      <category>BizTalk 2004</category>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=e6a6448a-b15e-4697-8d33-5b28f1d0a47e</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,e6a6448a-b15e-4697-8d33-5b28f1d0a47e.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,e6a6448a-b15e-4697-8d33-5b28f1d0a47e.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=e6a6448a-b15e-4697-8d33-5b28f1d0a47e</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>Multiple root entries in schema look ugly in schema editor</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,e6a6448a-b15e-4697-8d33-5b28f1d0a47e.aspx</guid>
      <link>http://blog.eliasen.dk/2006/09/07/MultipleRootEntriesInSchemaLookUglyInSchemaEditor.aspx</link>
      <pubDate>Thu, 07 Sep 2006 21:17:51 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
Today, I had the pleasure of helping a fellow BizTalk guy on the microsoft.public.biztalk.general
newsgroup. He has a schema which showed up with lots of root elements in the schema
editor. He wanted to fix that, but how?
&lt;/p&gt;
&lt;p&gt;
The "problem" is well known if you for instance use schemas created by InfoPath 2003.
They will look something like this:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/InfopathSchemaInEditor.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
There are lots of elements that appear to be the root node. Now, I know that "myFields"
is the actual root node that I want to use, but it sure isn't easy to see. What I
want shown is this:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/CorrectInfoPathSchemaInEditor.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
And if I create an instance of this schema, I will get this:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;ns0:CustomerName xmlns:ns0="&lt;a href='http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45"&gt;CustomerName_0&lt;/ns0:CustomerName'&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45"&amp;gt;CustomerName_0&amp;lt;/ns0:CustomerName&lt;/a&gt;&amp;gt;
&lt;/p&gt;
&lt;p&gt;
But that isn't what I wanted. I wanted this:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;ns0:myFields ns1:anyAttr="anyAttrContents" xmlns:ns1="&lt;a href="http://www.w3.org/XML/1998/namespace"&gt;http://www.w3.org/XML/1998/namespace&lt;/a&gt;"
xmlns:ns0="&lt;a href="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45"&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45&lt;/a&gt;"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;ns0:CustomerName&amp;gt;CustomerName_0&amp;lt;/ns0:CustomerName&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;ns0:OrderLines&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:OrderLine ns0:ID="ID"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:Description&amp;gt;Description_0&amp;lt;/ns0:Description&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:Quantity&amp;gt;100&amp;lt;/ns0:Quantity&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:ItemID&amp;gt;100&amp;lt;/ns0:ItemID&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ns0:OrderLine&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:OrderLine ns0:ID="ID"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:Description&amp;gt;Description_0&amp;lt;/ns0:Description&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:Quantity&amp;gt;100&amp;lt;/ns0:Quantity&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:ItemID&amp;gt;100&amp;lt;/ns0:ItemID&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ns0:OrderLine&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:OrderLine ns0:ID="ID"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:Description&amp;gt;Description_0&amp;lt;/ns0:Description&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:Quantity&amp;gt;100&amp;lt;/ns0:Quantity&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:ItemID&amp;gt;100&amp;lt;/ns0:ItemID&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ns0:OrderLine&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/ns0:OrderLines&amp;gt;&lt;br&gt;
&amp;lt;/ns0:myFields&amp;gt;
&lt;/p&gt;
&lt;p&gt;
So, how do I achive this?
&lt;/p&gt;
&lt;p&gt;
Well, the answer is quite simple, really... although it does involve manually editing
the schema file (the .xsd file).
&lt;/p&gt;
&lt;p&gt;
What you want to do is add a BizTalk specific annotation to the schema to let BizTalk
Schema Editor know which node is to be treated as the root node.
&lt;/p&gt;
&lt;p&gt;
So my schema looked like this:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;xsd:schema xmlns:my="&lt;a href="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45"&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45&lt;/a&gt;"
xmlns:b="&lt;a href="http://schemas.microsoft.com/BizTalk/2003"&gt;http://schemas.microsoft.com/BizTalk/2003&lt;/a&gt;"
targetNamespace="&lt;a href="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45"&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45&lt;/a&gt;"
xmlns:xsd="&lt;a href="http://www.w3.org/2001/XMLSchema"&gt;http://www.w3.org/2001/XMLSchema&lt;/a&gt;"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xsd:attribute name="ID" type="my:requiredString" /&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xsd:element name="myFields"&amp;gt;&lt;br&gt;
... and a whole bunch more
&lt;/p&gt;
&lt;p&gt;
and I edited it and now it looks like this:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;xsd:schema xmlns:my="&lt;a href="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45"&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45&lt;/a&gt;"
xmlns:b="&lt;a href="http://schemas.microsoft.com/BizTalk/2003"&gt;http://schemas.microsoft.com/BizTalk/2003&lt;/a&gt;"
targetNamespace="&lt;a href="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45"&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-07T18:24:45&lt;/a&gt;"
xmlns:xsd="&lt;a href="http://www.w3.org/2001/XMLSchema"&gt;http://www.w3.org/2001/XMLSchema&lt;/a&gt;"&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xsd:annotation&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsd:appinfo&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;b:schemaInfo is_envelope="no" version="1.0" root_reference="myFields"
displayroot_reference="myFields" xmlns:b="&lt;a href="http://schemas.microsoft.com/BizTalk/2003"&gt;http://schemas.microsoft.com/BizTalk/2003&lt;/a&gt;"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/b:schemaInfo&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsd:appinfo&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/xsd:annotation&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xsd:attribute name="ID" type="my:requiredString" /&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;xsd:element name="myFields"&amp;gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
So under annotations under appinfo, I added a BizTalk specific schemaInfo element,
which describes which node to treat as the root node.
&lt;/p&gt;
&lt;p&gt;
Clever and simple. But remember that you need to do this editing every time a new
version of the schema needs to be used.
&lt;/p&gt;
&lt;p&gt;
You can find my schemas here: 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blog.eliasen.dk/content/binary/myschema.zip"&gt;myschema.zip (,78 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
and here:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blog.eliasen.dk/content/binary/correctedmyschema.zip"&gt;correctedmyschema.zip
(,88 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
I hope this helps someone.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;/p&gt;
&lt;p&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=e6a6448a-b15e-4697-8d33-5b28f1d0a47e" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,e6a6448a-b15e-4697-8d33-5b28f1d0a47e.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
    <item>
      <trackback:ping>http://blog.eliasen.dk/Trackback.aspx?guid=7fa9051c-aa08-4c31-a6e4-1556435ff23a</trackback:ping>
      <pingback:server>http://blog.eliasen.dk/pingback.aspx</pingback:server>
      <pingback:target>http://blog.eliasen.dk/PermaLink,guid,7fa9051c-aa08-4c31-a6e4-1556435ff23a.aspx</pingback:target>
      <dc:creator>Jan Eliasen</dc:creator>
      <wfw:comment>http://blog.eliasen.dk/CommentView,guid,7fa9051c-aa08-4c31-a6e4-1556435ff23a.aspx</wfw:comment>
      <wfw:commentRss>http://blog.eliasen.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=7fa9051c-aa08-4c31-a6e4-1556435ff23a</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi
</p>
        <p>
Today I ran into a problem configuring the WSS Adapter for BizTalk 2006. In the configuration
wizard I just couldn't choose a web site for the adapter that would satisfy the configuration
wizard. I got this error:
</p>
        <p>
          <img src="http://blog.eliasen.dk/content/binary/wss-error.jpg" border="0" />
        </p>
        <p>
And I was pretty tired of it :-) Especially because I was sure WSS was installed on
this web site, the web site was extended with WSS and everything should have been
ok.
</p>
        <p>
Anyway, some searching on the net gave me a hint as to what was going on. I found
an article on topxml.com that <a href="http://www.topxml.com/Biztalk-Adapters/re-28688_Problem-when-configuring-WSS-2003-with-SP2-to-run-on-top-of--Net-Framework-1-1-and-then-upgrading-to--Net-Framework-2-0.aspx">helped
me</a>. In short, I had installed Windows Sharepoint Services on a web site I
had created for this purpose, but I had forgotten to make sure the web site was running
ASP.NET 2.0 before installing WSS. This made WSS run on .NET 1.1 and BizTalk 2006
has a requirement that it must run under .NET 2.0. 
</p>
        <p>
So in order to register ASP.NET 2.0 with IIS and upgrade my WSS installation to use
.NET 2.0, I ran the following two commands:
</p>
        <p>
"c:\windows<em>\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe" -i</em></p>
        <p>
          <em>"c:\program files\common files\Microsoft Shared\web server extensions\60\BIN\STSADM.exe"
-o upgrade -url </em>
          <a href="http://localhost:">
            <em>
              <a href="http://localhost:4242">http://localhost:
</a>
            </em>
          </a>4242<em> -forceupgrade</em></p>
        <p>
The :4242 is because my WSS web site is configured to run on this port.
</p>
        <p>
After this, there were no problems, and I could then configure the WSS adapter. I
didn't need to restart the configuration wizard - I just had to select the default
web site and then select my WSS Site again.
</p>
        <p>
Hope this helpes someone. Should you have comments, please go ahead.
</p>
        <p>
-- 
</p>
        <p>
eliasen
</p>
        <img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=7fa9051c-aa08-4c31-a6e4-1556435ff23a" />
      </body>
      <title>BizTalk 2006, error configuring the WSS Adapter</title>
      <guid isPermaLink="false">http://blog.eliasen.dk/PermaLink,guid,7fa9051c-aa08-4c31-a6e4-1556435ff23a.aspx</guid>
      <link>http://blog.eliasen.dk/2006/08/22/BizTalk2006ErrorConfiguringTheWSSAdapter.aspx</link>
      <pubDate>Tue, 22 Aug 2006 14:37:56 GMT</pubDate>
      <description>&lt;p&gt;
Hi
&lt;/p&gt;
&lt;p&gt;
Today I ran into a problem configuring the WSS Adapter for BizTalk 2006. In the configuration
wizard I just couldn't choose a web site for the adapter that would satisfy the configuration
wizard. I got this error:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://blog.eliasen.dk/content/binary/wss-error.jpg" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
And I was pretty tired of it :-) Especially because I was sure WSS was installed on
this web site, the web site was extended with WSS and everything should have been
ok.
&lt;/p&gt;
&lt;p&gt;
Anyway, some searching on the net gave me a hint as to what was going on. I found
an article on topxml.com that &lt;a href="http://www.topxml.com/Biztalk-Adapters/re-28688_Problem-when-configuring-WSS-2003-with-SP2-to-run-on-top-of--Net-Framework-1-1-and-then-upgrading-to--Net-Framework-2-0.aspx"&gt;helped
me&lt;/a&gt;.&amp;nbsp;In short, I had installed Windows Sharepoint Services on a web site I
had created for this purpose, but I had forgotten to make sure the web site was running
ASP.NET 2.0 before installing WSS. This made WSS run on .NET 1.1 and BizTalk 2006
has a requirement that it must run under .NET 2.0. 
&lt;/p&gt;
&lt;p&gt;
So in order to register ASP.NET 2.0 with IIS and upgrade my WSS installation to use
.NET 2.0, I ran the following two commands:
&lt;/p&gt;
&lt;p&gt;
"c:\windows&lt;em&gt;\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe" -i&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;"c:\program files\common files\Microsoft Shared\web server extensions\60\BIN\STSADM.exe"
-o upgrade -url &lt;/em&gt;&lt;a href="http://localhost:"&gt;&lt;em&gt;&lt;a href="http://localhost:4242"&gt;http://localhost:
&lt;/em&gt;&lt;/a&gt;4242&gt;&lt;em&gt; -forceupgrade&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
The :4242 is because my WSS web site is configured to run on this port.
&lt;/p&gt;
&lt;p&gt;
After this, there were no problems, and I could then configure the WSS adapter. I
didn't need to restart the configuration wizard - I just had to select the default
web site and then select my WSS Site again.
&lt;/p&gt;
&lt;p&gt;
Hope this helpes someone. Should you have comments, please go ahead.
&lt;/p&gt;
&lt;p&gt;
-- 
&lt;/p&gt;
&lt;p&gt;
eliasen
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.eliasen.dk/aggbug.ashx?id=7fa9051c-aa08-4c31-a6e4-1556435ff23a" /&gt;</description>
      <comments>http://blog.eliasen.dk/CommentView,guid,7fa9051c-aa08-4c31-a6e4-1556435ff23a.aspx</comments>
      <category>BizTalk 2006</category>
    </item>
  </channel>
</rss>