<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" 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:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Pseudo Knowledge Base</title>
        <link>http://geekswithblogs.net/PsudoKnowledgeBase/Default.aspx</link>
        <description> Useful stuff I've collected...  Enjoy.</description>
        <language>en-CA</language>
        <copyright>Geordie</copyright>
        <managingEditor>Martin.palmer@mjpalmer.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Pseudo Knowledge Base</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Installing UDDI 3 Server on a BizTalk Dev Box</title>
            <category>BizTalk</category>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/12/30/installing-uddi-3-server-on-a-biztalk-dev-box.aspx</link>
            <description>&lt;p&gt;I have just installed the UDDI 3 server on my BizTalk development environment.  All looked good until I tried to open the publish page on the web interface.  The page 'http://localhost/uddi/edit/frames.aspx' returned a page cannot be displayed error.  The same error occured when I tried to open the Subscribe and Coordinate pages.&lt;/p&gt;&lt;p&gt;After playing around with the configuration for a while I tracked the problem down to the page using https.  By connecting to the UDDI Service Console, right clicking on the UDDI in the left panel I was able to open the UDDI properties dialogue box.  The require SSL for publication requests can be disabled on the Security tab.&lt;/p&gt;&lt;p&gt;P.S.  Loading the UDDI Server with the Microsoft ESB Providers, tModels etc can be done using the "Microsoft.Practices.ESB.UDDIPublisher.exe" tool located at "C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit 2.1\BinC:\Program Files (x86)\Microsoft BizTalk ESB Toolkit 2.1\Bin".  In my case I used windows authentication to load the data into the UDDI service.&lt;/p&gt;&lt;p&gt;Geordie&lt;/p&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/148170.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/12/30/installing-uddi-3-server-on-a-biztalk-dev-box.aspx</guid>
            <pubDate>Fri, 30 Dec 2011 06:47:18 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/148170.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/12/30/installing-uddi-3-server-on-a-biztalk-dev-box.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/148170.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Creating a Send Port that can Generate Multiple Flat File Formats</title>
            <category>BizTalk</category>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/10/26/creating-a-send-port-that-can-generate-multiple-flat-file.aspx</link>
            <description>&lt;div style="margin: 0cm 0cm 10pt"&gt;I recently had a need to create a send port that could output a flat file but I could not determine which flat file schema to use at design time. Or at least I didn’t want to.  I wanted to process multiple flat file formats with the same orchestration process and output with the same send port. I have my orchestration dynamically mapping the document to the appropriate flat file document schema. The generated orchestration message type is set to System.XmlDocument so the orchestration can handle the varying message schema types, but how to output them with a single port. &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;The problem is with the pipeline. The port uses a custom pipeline that uses a flat file assembler to generate the flat file. In the configuration of the assembler the flat file document schema to be generated is specified. So how to dynamically set the pipeline… I have yet to find an answer to this problem (I’ll let you know when I do!).&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;There is an easier solution to this problem. It is very simple once you know how the assembler and for that matter the receive pipeline disassemblers work. When we specify the schema in the components we are basically telling the pipeline which schema to use to process the message. So what happens if we do not specify a schema?&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;This is the interesting part, especially for the assembler component. BizTalk already knows which schema to use. Using the schema type (the combination of TargetNameSpace#RootNodeName) form the message, BizTalk can ask the configuration database which schema to use. Therefore by not specifying a schema in the flat file assembler you create a pipeline that can assemble any flat file BizTalk has a schema for. Although this works well for the XML disassembler as well it is not so easy for flat files. Like most the other pipeline components the disassembler can contain multiple disassemblers but unlike the rest the message flows through differently. As the message hits the first disassembler it tries to process the message, if it fails, it will try the next disassembler. When is succeeds in identifying the message and applying the schema it ignores the rest of the disassembler components and carries on down the pipeline. All other multiple pipeline components are processed sequentially. This information is displayed in the pipeline designer, but I never realised the significance.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;Note the benefit of specifying the schema is for performance. There is more overhead if the pipeline has to search for the schema to use.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;Hope this helps&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;Geordie&lt;/div&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/147457.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/10/26/creating-a-send-port-that-can-generate-multiple-flat-file.aspx</guid>
            <pubDate>Wed, 26 Oct 2011 05:46:19 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/147457.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/10/26/creating-a-send-port-that-can-generate-multiple-flat-file.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/147457.aspx</wfw:commentRss>
        </item>
        <item>
            <title>NullReferenceException when calling the Retrieve method of the OrganizationServiceProxy object</title>
            <category>Coding</category>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/09/01/nullreferenceexception-when-calling-the-retrieve-method-of-the-organizationserviceproxy-object.aspx</link>
            <description>&lt;div style="margin: 0cm 0cm 10pt"&gt;I have recently started to update a very successful SAP CRM integration I originally built 5 or 6 years ago. We have recently started the implementation of CRM 2011 so the business has decided to take the opportunity to change the data that they want to synchronize between the 2 systems. Luckily the integration is both modular and to a large degree dynamic. The core logic should remain relatively untouched and only the SAP and CRM connection dlls should need any real work.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;The changes to the SAP connector were simple and took a matter of a couple of hours. Partially because I still have the virtual development machine I used to create the SAP proxy code.&lt;/div&gt;
&lt;div style="line-height: normal"&gt;The Crm connector has been a differnent story. There have been a number of changes to the CRM services since CRM 3. So like all developers I start exploring and testing the old and new ways to communicate with CRM. To that end I created a test project and started by creating a reference to the new CRM service (&lt;span style="color: #a31515; font-size: 9.5pt"&gt;http://ServerName/OrgName/XRMServices/2011/Organization.svc&lt;/span&gt;) .  The first method call to retrieve an account worked without any issues.&lt;/div&gt;
&lt;div style="line-height: normal"&gt; &lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;private&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt; CrmService.&lt;span style="color: #2b91af"&gt;OrganizationServiceClient&lt;/span&gt; service = &lt;span style="color: blue"&gt;new&lt;/span&gt; CrmService.&lt;span style="color: #2b91af"&gt;OrganizationServiceClient&lt;/span&gt;();&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; GetAccount_Click(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;
{&lt;br /&gt;
   &lt;span style="color: #2b91af"&gt;QueryExpression&lt;/span&gt; query = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;QueryExpression&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"account"&lt;/span&gt;);&lt;br /&gt;
   &lt;span style="color: #2b91af"&gt;ConditionExpression&lt;/span&gt; condition1 = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ConditionExpression&lt;/span&gt;();&lt;br /&gt;
&lt;br /&gt;
   condition1.AttributeName = &lt;span style="color: #a31515"&gt;"accountnumber"&lt;/span&gt;;&lt;br /&gt;
   condition1.Operator = &lt;span style="color: #2b91af"&gt;ConditionOperator&lt;/span&gt;.Equal;&lt;br /&gt;
   condition1.Values.Add(&lt;span style="color: #a31515"&gt;"5500"&lt;/span&gt;);&lt;br /&gt;
&lt;br /&gt;
   &lt;span style="color: green"&gt;// Build the filter based on the conditions.&lt;/span&gt;&lt;br /&gt;
   &lt;span style="color: #2b91af"&gt;FilterExpression&lt;/span&gt; filter = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;FilterExpression&lt;/span&gt;();&lt;br /&gt;
   filter.FilterOperator = &lt;span style="color: #2b91af"&gt;LogicalOperator&lt;/span&gt;.And;&lt;br /&gt;
   filter.Conditions.Add(condition1);&lt;br /&gt;
&lt;br /&gt;
   &lt;span style="color: green"&gt;// Set the Criteria field.&lt;/span&gt;&lt;br /&gt;
   query.Criteria.AddFilter(filter);&lt;br /&gt;
&lt;br /&gt;
   query.ColumnSet.AllColumns = &lt;span style="color: blue"&gt;true&lt;/span&gt;; &lt;br /&gt;
   &lt;span style="color: #2b91af"&gt;ColumnSet&lt;/span&gt; columns = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ColumnSet&lt;/span&gt;();&lt;br /&gt;
   columns.AllColumns = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;br /&gt;
   &lt;span style="color: #2b91af"&gt;Entity&lt;/span&gt; accnt = service.RetrieveMultiple(query)[0];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;I then explored the options around early binding and wrote the following method based on a MSDN article (http://msdn.microsoft.com/en-us/library/gg334754.aspx).&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt; &lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;private&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; btnEarlyBinding_Click(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;
{&lt;br /&gt;
   &lt;span style="color: #2b91af"&gt;OrganizationServiceProxy&lt;/span&gt; serviceProxy;&lt;br /&gt;
  &lt;span style="color: #2b91af"&gt;IOrganizationService&lt;/span&gt; orgService;&lt;br /&gt;
&lt;br /&gt;
   &lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt; orgUri = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt;(&lt;span style="color: #a31515"&gt;@"http://ServerName/OrgName/XRMServices/2011/Organization.svc"&lt;/span&gt;);&lt;br /&gt;
&lt;br /&gt;
   &lt;span style="color: #2b91af"&gt;ClientCredentials&lt;/span&gt; credentials = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ClientCredentials&lt;/span&gt;();&lt;br /&gt;
   credentials.Windows.ClientCredential = &lt;span style="color: blue"&gt;new&lt;/span&gt; System.Net.&lt;span style="color: #2b91af"&gt;NetworkCredential&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"CrmAdministrator"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"XXXXX"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"domain"&lt;/span&gt;);&lt;br /&gt;
&lt;br /&gt;
   serviceProxy = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;OrganizationServiceProxy&lt;/span&gt;(orgUri, &lt;span style="color: blue"&gt;null&lt;/span&gt;, credentials, &lt;span style="color: blue"&gt;null&lt;/span&gt;);&lt;br /&gt;
&lt;br /&gt;
   &lt;span style="color: green"&gt;// This statement is required to enable early-bound type support.&lt;/span&gt;&lt;br /&gt;
   serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ProxyTypesBehavior&lt;/span&gt;());&lt;br /&gt;
   orgService = (&lt;span style="color: #2b91af"&gt;IOrganizationService&lt;/span&gt;)serviceProxy;&lt;br /&gt;
&lt;br /&gt;
   &lt;span style="color: #2b91af"&gt;Guid&lt;/span&gt; guid = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Guid&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"f02b9ae2-1aab-db11-964f-000cf15bffae"&lt;/span&gt;); &lt;span style="color: green"&gt;&lt;br /&gt;
&lt;/span&gt;   &lt;span style="color: #2b91af"&gt;ColumnSet&lt;/span&gt; columns = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ColumnSet&lt;/span&gt;();&lt;br /&gt;
   columns.AllColumns = true;&lt;br /&gt;
   &lt;span style="color: blue"&gt;object&lt;/span&gt; acc = (&lt;span style="color: #2b91af"&gt;Account&lt;/span&gt;)orgService.Retrieve(&lt;span style="color: #a31515"&gt;"account"&lt;/span&gt;, guid, columns);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;When this code ran it caused a Null Reference Exception when calling the Retrieve method of the OrganizationServiceProxy object.&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;img width="720" height="503" alt="" src="/images/geekswithblogs_net/PsudoKnowledgeBase/CrmNullRefEx.jpg" /&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;I was not able to determine the cause of this problem and there are other options so I continued to test code against the CRM service reference. Unfortunately I hit another issue. My code as mentioned is dynamic and uses reflection to identify the attribute types and update attribute values. Unfortunately with the new CRM service only populated CRM attributes are returned and reflection gives you a null reference error. I was then directed to look at the Metadata service. To my disappointment that resulted in an I&lt;span style="line-height: 115%; color: black; font-size: 9.5pt"&gt;nvalid Operation Exception - 'Collection was modified; enumeration operation may not execute.' on calling the Execute method on the &lt;/span&gt;OrganizationServiceProxy object. See &lt;a href="http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/10273be7-22ec-4724-874f-a8f6bd133455"&gt;http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/10273be7-22ec-4724-874f-a8f6bd133455&lt;/a&gt; for more info on this issue.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;At this point I started to doubt the stability of the environment and started to look for way to isolate the problem. I started to look at the SDK and opened one of the packaged solutions. To my surprise it worked fine. I copied the code that was failing to the SDK project and it also worked. So the code is fine so what is the problem??&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;I need to know the cause so started comparing all the different characteristics of the 2 projects. As soon as I removed the service reference to the CRM services the early binding code started to work.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;img width="292" height="285" alt="" src="/images/geekswithblogs_net/PsudoKnowledgeBase/CrmServiceReference.jpg" /&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;When I added it back in I started to get exceptions again.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;Hope this helps someone.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;Geordie&lt;/div&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/146735.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/09/01/nullreferenceexception-when-calling-the-retrieve-method-of-the-organizationserviceproxy-object.aspx</guid>
            <pubDate>Thu, 01 Sep 2011 13:32:10 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/146735.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/09/01/nullreferenceexception-when-calling-the-retrieve-method-of-the-organizationserviceproxy-object.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/146735.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Conversion of BizTalk Projects to Use the New WCF-SAP Adaptor</title>
            <category>BizTalk</category>
            <category>Coding</category>
            <category>BizTalk_Mapping</category>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/02/06/conversion-of-biztalk-projects-to-use-the-new-wcf-sap-adaptor.aspx</link>
            <description>&lt;div style="margin: 0cm 0cm 10pt"&gt;We are in the process of upgrading our BizTalk Environment from BizTalk 2006 R2 to BizTalk 2010. The SAP adaptor in BizTalk 2010 is an all new and more powerful WCF-SAP adaptor. When my colleagues tested out the new adaptor they discovered that the format of the data extracted from SAP was not identical to the old adaptor. This is not a big deal if the structure of the messages from SAP is simple. In this case we were receiving the delivery and invoice iDocs. Both these structures are complex especially the delivery document. Over the past few years I have tweaked the delivery mapping to remove bugs from original mapping. The idea of redoing these maps did not appeal and due to the current work load was not even an option. I opted for a rather crude alternative of pulling in the iDoc in the new typed format and then adding a static map at the start of the orchestration to convert the data to the old schema. &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;b&gt;Note&lt;/b&gt; WCF-SAP data formats (on the binding tab of the configuration dialog box is the ‘RecieiveIdocFormat’ field):&lt;/div&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;u&gt;Typed:&lt;/u&gt;  Returns a XML document with the hierarchy represented in XML and all fields being represented by XML tags.&lt;/li&gt;
    &lt;li&gt;&lt;u&gt;RFC:&lt;/u&gt; Returns an XML document with the hierarchy represented in XML but the iDoc lines in flat file format.&lt;/li&gt;
    &lt;li&gt;&lt;u&gt;String:&lt;/u&gt; This returns the iDoc in a format that is closest to the original flat file format but is still wrapped with some top level XML tags. The files also contained some strange characters at the end of each line.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;I started with the invoice document and it was quite straight forward to add the mapping but this is where my problems started. The orchestrations for these documents are dynamic and so require the identity of the partner to be able to correctly configure the orchestration. The partner identity is in the EDI_DC40 segment of the iDoc. In the old project the RECPRN node of the segment was promoted. The code to set a variable to the partner ID was now failing. After lot of head scratching I discovered the problem was due to the addition of Namespaces to the fields in the EDI_DC40 segment. To overcome this I needed to use an xPath query with a Namespace Manager. This had to be done in custom code.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;I now tried to repeat the process with the delivery document. Unfortunately when we tried to get sample typed data from SAP an exception was thrown.&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;i&gt;&lt;span style="font-size: 9pt"&gt;The adapter "WCF-SAP" raised an error message. Details "Microsoft.ServiceModel.Channels.Common.XmlReaderGenerationException: The segment or group definition E2EDKA1001 was not found in the IDoc metadata. The UniqueId of the IDoc type is: IDOCTYP/3/DESADV01/ZASNEXT1/640. For Receive operations, the SAP adapter does not support unreleased segments.&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;Our guess is that when the WCF-SAP adaptor tries to down load the data it retrieves a data schema from SAP. For some reason the schema does not match the data. This may be due to the version of SAP we are running or due to a customization. Either way resolving this problem did not look easy.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;When doing some research on this problem I found an article showing me how to get the data from SAP using the WCF-SAP adaptor without any XML tags.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;a href="http://blogs.msdn.com/b/adapters/archive/2007/10/05/receiving-idocs-getting-the-raw-idoc-data.aspx"&gt;http://blogs.msdn.com/b/adapters/archive/2007/10/05/receiving-idocs-getting-the-raw-idoc-data.aspx&lt;/a&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;b&gt;Reproduction of Mustansir blog:&lt;/b&gt;&lt;/div&gt;
&lt;div style="line-height: 10.5pt; background: white"&gt;&lt;tt&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 9pt"&gt;Since the WCF based SAP Adapter is ... well, WCF based, all data flowing in and out of the adapter is encapsulated within a SOAP message. Which means there are those pesky xml tags all over the place. If you want to receive an Idoc from SAP, you can receive it in "Typed" format (in which case each column in each segment of the idoc appears within its own xml tag), or you can receive it in "String" format (in which case there are just 2 xml tags at the top, the raw xml data in string/flat file format, and the 2 closing xml tags).&lt;/span&gt;&lt;/i&gt;&lt;/tt&gt;&lt;/div&gt;
&lt;div style="line-height: 10.5pt; background: white"&gt;&lt;tt&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 9pt"&gt;In "String" format, an incoming idoc (for ORDERS05, containing 5 data records) would look like:&lt;/span&gt;&lt;/i&gt;&lt;/tt&gt;&lt;/div&gt;
&lt;div style="line-height: 10.5pt; background: white"&gt;&lt;tt&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 10pt"&gt;&amp;lt;ReceiveIdoc xmlns='http://Microsoft.LobServices.Sap/2007/03/Idoc/'&amp;gt;&amp;lt;idocData&amp;gt;EDI_DC40 8000000000001064985620&lt;br /&gt;
E2EDK01005 800000000000106498500000100000001&lt;br /&gt;
E2EDK14 8000000000001064985000002000000020111000&lt;br /&gt;
E2EDK14 8000000000001064985000003000000020081000&lt;br /&gt;
E2EDK14 80000000000010649850000040000000200710&lt;br /&gt;
E2EDK14 80000000000010649850000050000000200600&amp;lt;/idocData&amp;gt;&amp;lt;/ReceiveIdoc&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/tt&gt;&lt;/div&gt;
&lt;div style="background: white"&gt;&lt;tt&gt;&lt;i&gt;&lt;span style="color: #333333"&gt;(I have trimmed part of the control record so that it fits cleanly here on one line).&lt;/span&gt;&lt;/i&gt;&lt;/tt&gt;&lt;/div&gt;
&lt;div style="line-height: 10.5pt; background: white"&gt;&lt;tt&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 9pt"&gt;Now, you're only interested in the IDOC data, and don't care much for the XML tags. It isn't that difficult to write your own pipeline component, or even some logic in the orchestration to remove the tags, right? Well, you don't need to write any extra code at all - the WCF Adapter can help you here!&lt;/span&gt;&lt;/i&gt;&lt;/tt&gt;&lt;/div&gt;
&lt;div style="line-height: 10.5pt; background: white"&gt;&lt;tt&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 9pt"&gt;During the configuration of your one-way Receive Location using WCF-Custom, navigate to the Messages tab. Under the section "Inbound BizTalk Messge Body", select the "Path" radio button, and:&lt;/span&gt;&lt;/i&gt;&lt;/tt&gt;&lt;/div&gt;
&lt;div style="line-height: 10.5pt; background: white"&gt;&lt;tt&gt;&lt;strong&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 9pt"&gt;(a)&lt;/span&gt;&lt;/i&gt;&lt;/strong&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 9pt"&gt; Enter the body path expression as:&lt;br /&gt;
/*[local-name()='ReceiveIdoc']/*[local-name()='idocData']&lt;/span&gt;&lt;/i&gt;&lt;/tt&gt;&lt;/div&gt;
&lt;div style="line-height: 10.5pt; background: white"&gt;&lt;tt&gt;&lt;strong&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 9pt"&gt;(b)&lt;/span&gt;&lt;/i&gt;&lt;/strong&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 9pt"&gt; Choose "String" for the Node Encoding.&lt;/span&gt;&lt;/i&gt;&lt;/tt&gt;&lt;/div&gt;
&lt;div style="line-height: 10.5pt; background: white"&gt;&lt;tt&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 9pt"&gt;What we've done is, used an XPATH to pull out the value of the "idocData" node from the XML. Your Receive Location will now emit text containing only the idoc data. &lt;/span&gt;&lt;/i&gt;&lt;/tt&gt;&lt;/div&gt;
&lt;div style="line-height: 10.5pt; background: white"&gt;&lt;tt&gt;&lt;i&gt;&lt;span style="color: #333333; font-size: 9pt"&gt;You can at this point, for example, put the Flat File Pipeline component to convert the flat text into a different xml format based on some other schema you already have, and receive your version of the xml formatted message in your orchestration.&lt;/span&gt;&lt;/i&gt;&lt;/tt&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;This was potentially a much easier solution than adding the static maps to the orchestrations and overcame the issue with ‘Typed’ delivery documents. Not quite so fast…&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;Note: When I followed Mustansir’s blog the characters at the end of each line disappeared.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;After configuring the adaptor and passing the iDoc data into the original flat file receive pipelines I was receiving exceptions.&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;i&gt;&lt;span style="font-size: 9pt"&gt;There was a failure executing the receive pipeline: "PAPINETPipelines.DeliveryFlatFileReceive, CustomerIntegration2.PAPINET.Pipelines, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4ca3635fbf092bbb" Source: "Pipeline " Receive Port: "recSAP_Delivery" URI: "D:\CustomerIntegration2\SAP\Delivery\*.xml" Reason: An error occurred when parsing the incoming document: "Unexpected data found while looking for:&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;i&gt;&lt;span style="font-size: 9pt"&gt;'Z2EDPZ7'&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;i&gt;&lt;span style="line-height: 115%; font-size: 9pt"&gt;The current definition being parsed is E2EDP07GRP. The stream offset where the error occured is 8859. The line number where the error occured is 23. The column where the error occured is 0.".&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;Although the new flat file looked the same as the old one there was a differences. In the original file all lines in the document were exactly 1064 character long. In the new file all lines were truncated to the last alphanumeric character.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;The final piece of the puzzle was to add a custom pipeline component to pad all the lines to 1064 characters. This component was added to the decode node of the custom delivery and invoice flat file disassembler pipelines.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;Execute method of the custom pipeline component:&lt;/div&gt;
&lt;div&gt;&lt;span style="line-height: 115%; color: blue; font-size: 9.5pt"&gt;public&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; &lt;span style="color: #2b91af"&gt;IBaseMessage&lt;/span&gt; Execute(&lt;span style="color: #2b91af"&gt;IPipelineContext&lt;/span&gt; pc, &lt;span style="color: #2b91af"&gt;IBaseMessage&lt;/span&gt; inmsg)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="line-height: 115%; color: green; font-size: 9.5pt"&gt;//Convert Stream to a string&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="line-height: 115%; color: #2b91af; font-size: 9.5pt"&gt;Stream&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; s = &lt;span style="color: blue"&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="line-height: 115%; color: #2b91af; font-size: 9.5pt"&gt;IBaseMessagePart&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; bodyPart = inmsg.BodyPart;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="line-height: 115%; color: green; font-size: 9.5pt"&gt;// NOTE inmsg.BodyPart.Data is implemented only as a setter in the http adapter API and a&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="line-height: 115%; color: green; font-size: 9.5pt"&gt;//getter and setter for the file adapter. Use GetOriginalDataStream to get data instead.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 9.5pt"&gt;if&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; (bodyPart != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;s = bodyPart.GetOriginalDataStream();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 9.5pt"&gt;string&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; newMsg = &lt;span style="color: blue"&gt;string&lt;/span&gt;.Empty;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 9.5pt"&gt;string&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; strLine;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 9.5pt"&gt;try&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="line-height: 115%; color: #2b91af; font-size: 9.5pt"&gt;StreamReader&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; sr = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;StreamReader&lt;/span&gt;(s);&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;strLine = sr.ReadLine();&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 72pt"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 9.5pt"&gt;while&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; (strLine != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 72pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 72pt"&gt;&lt;span style="line-height: 115%; color: green; font-size: 9.5pt"&gt;//Execute padding code&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 108pt"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 9.5pt"&gt;if&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; (strLine != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 144pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;strLine = strLine.PadRight(1064, &lt;span style="color: #a31515"&gt;' '&lt;/span&gt;) + &lt;span style="color: #a31515"&gt;"\r\n"&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 108pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;newMsg += strLine;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 108pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;strLine = sr.ReadLine();&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 72pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 72pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;sr.Close();&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 9.5pt"&gt;catch&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; (&lt;span style="color: #2b91af"&gt;IOException&lt;/span&gt; ex)&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 9.5pt"&gt;throw&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Error occured trying to pad the message to 1064 charactors"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="line-height: 115%; color: green; font-size: 9.5pt"&gt;//Convert back to stream and set to Data property&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;inmsg.BodyPart.Data = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;MemoryStream&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Encoding&lt;/span&gt;.UTF8.GetBytes(newMsg)); ;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="line-height: 115%; color: green; font-size: 9.5pt"&gt;//reset the position of the stream to zero&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;inmsg.BodyPart.Data.Position = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 9.5pt"&gt;return&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt; inmsg;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="line-height: 115%; font-size: 9.5pt"&gt;}&lt;/span&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/143835.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/02/06/conversion-of-biztalk-projects-to-use-the-new-wcf-sap-adaptor.aspx</guid>
            <pubDate>Sun, 06 Feb 2011 18:45:03 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/143835.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2011/02/06/conversion-of-biztalk-projects-to-use-the-new-wcf-sap-adaptor.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/143835.aspx</wfw:commentRss>
        </item>
        <item>
            <title>BizTalk 2010, BAM, SharePoint and the Default Application Pool Flag</title>
            <category>BizTalk</category>
            <category>SharePoint</category>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/08/17/biztalk-2010-bam-sharepoint-and-the-default-application-pool-flag.aspx</link>
            <description>&lt;p&gt;I have recently started to look at EDI communications through BizTalk. Part of the EDI features in BizTalk is the use of BAM to track messaging.  Amongst the applications we currently have built in BizTalk we do some SharePoint communication.  This is also a possible component to our EDI solution.  We also have plans to move to BizTalk 2010 in the near future, so today I started to build my new BizTalk Dev machine.&lt;/p&gt;
&lt;p&gt;I got a bit of a surprise when 2 parts of the required set had me setting a flag “Enable 32-bit applications” to opposite values.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;First configuration&lt;/u&gt;&lt;/strong&gt;:  I was working the setup document available from Microsoft ‘Installing BizTalk Server 2010 on Windows Server 2008 R2 and 2008.docx’. &lt;/p&gt;
&lt;p&gt;On pg 13…&lt;br /&gt;
&lt;strong&gt;Enable Internet Information Services&lt;/strong&gt;&lt;br /&gt;
Microsoft Internet Information Services (IIS) provides a Web application infrastructure for many BizTalk Server features. BizTalk Server requires IIS for the following features:&lt;br /&gt;
• HTTP adapter&lt;br /&gt;
• SOAP adapter&lt;br /&gt;
• Windows SharePoint Services adapter&lt;br /&gt;
• Secure Sockets Layer (SSL) encryption&lt;br /&gt;
• BAM Portal&lt;br /&gt;
To enable Internet Information Services 7.5&lt;br /&gt;
1. Click Start, point to Administrative Tools and then click Server Manager.&lt;br /&gt;
2. ….&lt;em&gt;Step by step instruction here&lt;/em&gt;&lt;br /&gt;
&lt;strong&gt;Note&lt;/strong&gt; &lt;br /&gt;
BAM Portal runs only runs on a 32-bit mode. If you are installing IIS on a 64-bit machine then you must ensure that ASP.NET 2.0 is enabled on 32-bit mode. To do this, follow these steps: &lt;br /&gt;
1. On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager. &lt;br /&gt;
2. In the Connections pane, expand the server name, and then click Application Pools.&lt;br /&gt;
3. In the Actions pane, click Set Application Pool Defaults...&lt;br /&gt;
4. On the Application Pool Defaults dialog box, in Enable 32-bit applications, select True.&lt;br /&gt;
 &lt;br /&gt;
I set the Enable 32-bit applications flag as specified and continued with the install.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Second configuration&lt;/strong&gt;&lt;/u&gt;:  As mentioned we use SharePoint and to use the SharePoint adaptor we need to install the SharePoint Foundation 2010 or WSS3(SP2) components.  After installation and configuration the SharePoint Sites where inaccessible and returned a HTTP error 503 ‘Site unavailable’ message.  The application pools for the SharePoint components were stopped each time I tried to access the SharePoint sites.  After a bit of searching I found that to get the site to work I needed to set the ‘Enable 32-bit applications, to False’.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Resolution&lt;/strong&gt;&lt;/u&gt;: I was able to resolve the issue by setting the default application Pool’s Enable 32-bit applications to true as described in the text.  I then went to each SharePoint application pool and right clicked.  In the context menu there is an ‘Advanced Settings…’ option.  Selecting this allowed me to set the ‘Enable 32-bit Applications’ flag for that specific pool.  I was then able to access the SharePoint site even though the Default Application Pool's flag was set to 'true'.&lt;/p&gt;
&lt;p&gt;Hope this helps, Geordie...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;  When I tried to configure the BizTalk server using the basic configuration tool it failed badly.  Once I gave the BizTalk service account create permissions on the database I was able to automaticaly configure BizTalk up to the BAM components.  after that I had to manually configure each piece, setting the 'default application pool' appropriatly for the componet I was configuring.  Also when configuring the SharePoint adaptor you need to select the correct website (ie the 'SharePoint-80' site from the dropdown list, the default web site will not work).&lt;/p&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/141356.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/08/17/biztalk-2010-bam-sharepoint-and-the-default-application-pool-flag.aspx</guid>
            <pubDate>Tue, 17 Aug 2010 20:06:27 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/141356.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/08/17/biztalk-2010-bam-sharepoint-and-the-default-application-pool-flag.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/141356.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Adding Custom Pipeline code to the Pipeline Component Toolbox</title>
            <category>BizTalk</category>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/03/25/adding-custom-pipeline-code-to-the-pipeline-component-toolbox.aspx</link>
            <description>&lt;p&gt;&lt;span style="font-family: Arial"&gt;&lt;span style="font-size: x-small"&gt;Add ...&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\GacUtil.exe" /nologo /i "$(TargetPath)" /f&lt;br /&gt;
 xcopy "$(TargetPath)" "C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components" /d /y&lt;br /&gt;
&lt;/em&gt;&lt;br /&gt;
to the 'Post Build event command line' for the pipeline support component project in visual studio. This will automatically put the support dll in the GAC and BizTalk’s Pipeline component directory on building the solution/project.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Arial"&gt;&lt;span style="font-size: x-small"&gt;Build the project.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Arial"&gt;&lt;span style="font-size: x-small"&gt;&lt;span style="line-height: 115%"&gt;Right Click on title bar and select Choose items. Click on the BizTalk Pipeline Components tab and select the new component from the list. If it is not available in the list Browse to the BizTalk pipeline component folder (C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components) and select the dll.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/138915.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/03/25/adding-custom-pipeline-code-to-the-pipeline-component-toolbox.aspx</guid>
            <pubDate>Thu, 25 Mar 2010 18:55:58 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/138915.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/03/25/adding-custom-pipeline-code-to-the-pipeline-component-toolbox.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/138915.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Click Once Deployment Process and Issue Resolution</title>
            <category>Coding</category>
            <category>Deployment</category>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/03/18/click-once-deployment-process-and-issue-resolution.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br /&gt;
We are adopting Click Once as a deployment standard for Thick .Net application clients.  The latest version of this tool has matured it to a point where it can be used in an enterprise environment.  This guide will identify how to use Click Once deployment and promote code trough the dev, test and production environments.&lt;br /&gt;
&lt;strong&gt;Why Use Click Once over SCCM&lt;/strong&gt;&lt;br /&gt;
If we already use SCCM why add Click Once to the deployment options.  The advantages of Click Once are their ability to update the code in a single location and have the update flow automatically down to the user community.  There have been challenges in the past with getting configuration updates to download but these can now be achieved.  With SCCM you can do the same thing but it then needs to be packages and pushed out to users.  Each time a new user is added to an application, time needs to be spent by an administrator, to push out any required application packages.  With Click Once the user would go to a web link and the application and pre requisites will automatically get installed.&lt;br /&gt;
&lt;strong&gt;New Deployment Steps Overview&lt;/strong&gt;&lt;br /&gt;
The deployment in an enterprise environment includes several steps as the solution moves through the development life cycle before being released into production.  To make mitigate risk during the release phase, it is important to ensure the solution is not deployed directly into production from the development tools.  Although this is the easiest path, it can introduce untested code into production and result in unexpected results.&lt;br /&gt;
1. Deploy the client application to a development web server using Visual Studio 2008 Click Once deployment tools.  Once potential production versions of the solution are being generated, ensure the production install URL is specified when deploying code from Visual Studio.  (For details see ‘Deploying Click Once Code from Visual Studio’)&lt;/p&gt;
&lt;p&gt;2. xCopy the code to the test server.  Run the MageUI tool to update the URLs, signing and version numbers to match the test server. (For details see ‘Moving Click Once Code to a new Server without using Visual Studio’)&lt;/p&gt;
&lt;p&gt;3. xCopy the code to the production server.  Run the MageUI tool to update the URLs, signing and version numbers to match the production server. The certificate used to sign the code should be provided by a certificate authority that will be trusted by the client machines.  Finally make sure the setup.exe contains the production install URL.  If not redeploy the solution from Visual Studio to the dev environment specifying the production install URL.  Then xcopy the install.exe file from dev to production.  (For details see ‘Moving Click Once Code to a new Server without using Visual Studio’)&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Detailed Deployment Steps&lt;/strong&gt;&lt;br /&gt;
&lt;/u&gt;&lt;strong&gt;Deploying Click Once Code From Visual Studio&lt;/strong&gt;&lt;br /&gt;
Open Visual Studio and create a new WinForms or WPF project.&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="427" height="312" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage1.jpg" /&gt;&lt;br /&gt;
In the solution explorer right click on the project and select ‘Publish’ in the context menu.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="417" height="328" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage2.jpg" /&gt;&lt;br /&gt;
 &lt;br /&gt;
The ‘Publish Wizard’ will start.  Enter the development deployment path.  This could be a local directory or web site.  When first publishing the solution set this to a development web site and Visual basic will create a site with an install.htm page.  Click Next.  Select weather the application will be available both online and offline. Then click Finish. &lt;br /&gt;
Once the initial deployment is completed, republish the solution this time mapping to the directory that holds the code that was just published.  This time the Publish Wizard contains and additional option.&lt;/p&gt;
&lt;p style="text-align: left"&gt;&lt;img alt="" width="424" height="333" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage3.jpg" /&gt;&lt;br /&gt;
 &lt;br /&gt;
The setup.exe file that is created has the install URL hardcoded in it.  It is this screen that allows you to specify the URL to use.  At some point a setup.exe file must be generated for production.  Enter the production URL and deploy the solution to the dev folder.  This file can then be saved for latter use in deployment to production.  During development this URL should be pointing to development site to avoid accidently installing the production application.&lt;br /&gt;
Visual studio will publish the application to the desired location in the process it will create an anonymous ‘pfx’ certificate to sign the deployment configuration files.  A production certificate should be acquired in preparation for deployment to production.&lt;br /&gt;
 &lt;/p&gt;
&lt;p style="text-align: center"&gt;&lt;img alt="" width="459" height="84" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage4.jpg" /&gt;&lt;br /&gt;
Directory structure created by Visual Studio&lt;br /&gt;
 &lt;br /&gt;
 &lt;img alt="" width="500" height="84" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage5.jpg" /&gt;&lt;br /&gt;
Application files created by Visual Studio&lt;br /&gt;
 &lt;/p&gt;
&lt;p style="text-align: center"&gt;&lt;img alt="" width="474" height="319" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage6.jpg" /&gt;&lt;br /&gt;
Development web site (install.htm) created by Visual Studio&lt;/p&gt;
&lt;p style="text-align: left"&gt;&lt;br /&gt;
&lt;strong&gt;Migrating Click Once Code to a new Server without using Visual Studio&lt;br /&gt;
&lt;/strong&gt;To migrate the Click Once application code to a new server, a tool called MageUI is needed to modify the .application and .manifest files.  The MageUI tool is usually located – ‘C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin’ folder or can be downloaded from the web.&lt;br /&gt;
When deploying to a new environment copy all files in the project folder to the new server.  In this case the ‘ClickOnceSample’ folder and contents.  The old application versions can be deleted, in this case ‘ClickOnceSample_1_0_0_0’ and ‘ClickOnceSample_1_0_0_1’.  &lt;br /&gt;
Open IIS Manager and create a virtual directory that points to the project folder.  Also make the publish.htm the default web page.&lt;br /&gt;
 &lt;img alt="" width="526" height="362" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage7.jpg" /&gt;&lt;br /&gt;
Run the ManeUI tool and then open the .application file in the root project folder (in this case in the ‘ClickOnceSample’ folder).&lt;br /&gt;
Click on the Deployment Options in the left hand list and update the URL to the new server URL and save the changes.&lt;br /&gt;
 &lt;img alt="" width="585" height="367" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage8.jpg" /&gt;&lt;br /&gt;
When MageUI tries to save the file it will prompt for the file to be signed.&lt;br /&gt;
 &lt;img alt="" width="387" height="351" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage9.jpg" /&gt;&lt;br /&gt;
This step cannot be bypassed if you want the Click Once deployment to work from a web site.  The easiest solution to this for test is to use the auto generated certificate that Visual Studio created for the project.  This certificate can be found with the project source code.   To save time go to File&amp;gt;Preferences and configure the ‘Use default signing certificate’ fields.&lt;br /&gt;
 &lt;img alt="" width="346" height="168" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage10.jpg" /&gt;&lt;br /&gt;
Future deployments will only require application files to be transferred to the new server.  The only difference is then updating the .application file the ‘Version’ must be updated to match the new version and the ‘Application Reference’ has to be update to point to the new .manifest file.&lt;br /&gt;
 &lt;img alt="" width="499" height="314" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage11.jpg" /&gt;&lt;br /&gt;
&lt;img alt="" width="521" height="317" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage12.jpg" /&gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;strong&gt;Updating the Configuration File of a Click Once Deployment Package without using Visual Studio&lt;/strong&gt;&lt;br /&gt;
When an update to the configuration file is required, modifying the ClickOnceSample.exe.config.deploy file will not result in current users getting the new configurations.  We do not want to go back to Visual Studio and generate a new version as this might introduce unexpected code changes.  A new version of the application can be created by copying the folder (in this case ClickOnceSample_1_0_0_2) and pasting it into the application Files directory.  Rename the directory ‘ClickOnceSample_1_0_0_3’.  In the new folder open the configuration file in notepad and make the configuration changes.&lt;br /&gt;
Run MageUI and open the manifest file in the newly copied directory (ClickOnceSample_1_0_0_3).&lt;br /&gt;
 &lt;img alt="" width="561" height="341" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage13.jpg" /&gt;&lt;br /&gt;
Edit the manifest version to reflect the newly copied files (in this case 1.0.0.3).  Then save the file.  Open the .application file in the root folder.  Again update the version to 1.0.0.3.  Since the file has not changed the Deployment Options/Start Location URL should still be correct.  The application Reference needs to be updated to point to the new versions .manifest file.  Save the file.&lt;br /&gt;
Next time a user runs the application the new version of the configuration file will be down loaded.  It is worth noting that there are 2 different types of configuration parameter; application and user.  With Click Once deployment the difference is significant.  When an application is downloaded the configuration file is also brought down to the client machine.  The developer may have written code to update the user parameters in the application.  As a result each time a new version of the application is down loaded the user parameters are at risk of being overwritten.  With Click Once deployment the system knows if the user parameters are still the default values.  If they are they will be overwritten with the new default values in the configuration file.  If they have been updated by the user, they will not be overwritten.&lt;/p&gt;
&lt;p style="text-align: center"&gt;&lt;img alt="" width="707" height="146" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage14.jpg" /&gt;&lt;br /&gt;
Settings configuration view in Visual Studio&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;strong&gt;Production Deployment&lt;br /&gt;
&lt;/strong&gt;When deploying the code to production it is prudent to disable the development and test deployment sites.  This will allow errors such as incorrect URL to be quickly identified in the initial testing after deployment.  If the sites are active there is no way to know if the application was downloaded from the production deployment and not redirected to test or dev.&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Troubleshooting&lt;/strong&gt;&lt;br /&gt;
Clicking the install button on the install.htm page fails.&lt;br /&gt;
Error: URLDownloadToCacheFile failed with HRESULT '-2146697210' Error: An error occurred trying to download &amp;lt;file&amp;gt;&lt;br /&gt;
 &lt;img alt="" width="666" height="613" src="/images/geekswithblogs_net/PsudoKnowledgeBase/ClickOnceImage15.jpg" /&gt;&lt;br /&gt;
This is due to the setup.exe file pointing to the wrong location.&lt;br /&gt;
‘&lt;em&gt;The setup.exe file that is created has the install URL hardcoded in it.  It is this screen that allows you to specify the URL to use.  At some point a setup.exe file must be generated for production.  Enter the production URL and deploy the solution to the dev folder.  This file can then be saved for latter use in deployment to production.  During development this URL should be pointing to development site to avoid accidently installing the production application&lt;/em&gt;.’&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/138599.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/03/18/click-once-deployment-process-and-issue-resolution.aspx</guid>
            <pubDate>Thu, 18 Mar 2010 18:47:11 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/138599.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/03/18/click-once-deployment-process-and-issue-resolution.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/138599.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Using OWSSVR.dll to filter SharePoint data on the server side </title>
            <category>SharePoint</category>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/02/01/using-owssvr.dll-to-filter-sharepoint-data-on-the-server-side.aspx</link>
            <description>&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;span style="color: windowtext; text-decoration: none; text-underline: none"&gt;The use of the OWSSVR.dll to filter data on the server side is a great idea as SharePoint can be slow and it tends to become the corporate dumping ground for all documents.  Why delete it when we can retain it for auditing...&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;span style="color: windowtext; text-decoration: none; text-underline: none"&gt;So to be able to filter the data to the current entries before transmitting the data over the wire is great.  It look like the perfect solution for my problem and it took a number of confussed hours before I found the posting by GaryJ @ Novotronix.  I have copied it below.&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;b&gt;&lt;i&gt;&lt;a href="http://blog.novotronix.com/post/2009/05/15/owssvrdll-Beware-of-multiple-slection-lookups.aspx"&gt;&lt;span style="color: windowtext; text-decoration: none; text-underline: none"&gt;owssvr.dll - Beware of multiple selection lookups&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;owssvr.dll can be used in InfoPath projects to provide filtered or cascading drop down lists. Use an XML datasource - the syntax is &lt;a href="http://yourserver/yourweb/_vti_bin/owssvr.dll?Cmd=Display&amp;amp;List=%7bguid%7d&amp;amp;XMLDATA=TRUE"&gt;&lt;span style="color: #6b1d10; text-decoration: none; text-underline: none"&gt;http://yourserver/yourweb/_vti_bin/owssvr.dll?Cmd=Display&amp;amp;List={guid}&amp;amp;XMLDATA=TRUE&lt;/span&gt;&lt;/a&gt;.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;However, beware if your list contains a lookupfield that allows multiple selections. If you have this, then the above syntax will return an invalid XML, or a blank data set.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;List contains lookup field(s) with single selection - syntax works.&lt;br /&gt;
List contains lookup field(s) with multiple selection - syntax fails.&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt; &lt;b&gt;&lt;u&gt;Links:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;b&gt;&lt;u&gt;&lt;a href="http://blog.novotronix.com/post/2009/05/15/owssvrdll-Beware-of-multiple-slection-lookups.aspx"&gt;http://blog.novotronix.com/post/2009/05/15/owssvrdll-Beware-of-multiple-slection-lookups.aspx&lt;/a&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;a href="http://blogs.msdn.com/infopath/archive/2007/01/15/populating-form-data-from-sharepoint-list-views.aspx"&gt;&lt;font color="#800080"&gt;http://blogs.msdn.com/infopath/archive/2007/01/15/populating-form-data-from-sharepoint-list-views.aspx&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;a href="http://www.bizsupportonline.net/browserforms/filter-cascade-drop-down-infopath-sharepoint-browser-form-owssvr-dll.htm"&gt;&lt;font color="#800080"&gt;http://www.bizsupportonline.net/browserforms/filter-cascade-drop-down-infopath-sharepoint-browser-form-owssvr-dll.htm&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 10pt"&gt;&lt;a href="http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=24"&gt;&lt;font color="#800080"&gt;http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=24&lt;/font&gt;&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/137746.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/02/01/using-owssvr.dll-to-filter-sharepoint-data-on-the-server-side.aspx</guid>
            <pubDate>Tue, 02 Feb 2010 02:21:19 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/137746.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2010/02/01/using-owssvr.dll-to-filter-sharepoint-data-on-the-server-side.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/137746.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Tips on Connecting to the New Team Foundation Server and moving a project</title>
            <category>Documentation</category>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2009/10/27/tips-on-connecting-to-the-new-source-control-and-moving.aspx</link>
            <description>&lt;p&gt;&lt;font face=""&gt;It can be a challenge to move a project from one TFS source control to another.  This is because TFS has the concept of workspaces.  These workspaces are generally behind the scenes so you do not know they are being created.  If you try and move a project that is currently associated with a workspace it will complain when you try and connect the same project with a new source control.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;The first step is to remove the workspace binding.  To find the workspaces go to: File&amp;gt;Source Control&amp;gt;Workspaces.&lt;br /&gt;
 &lt;br /&gt;
This will bring up the ‘Manage Workspaces’ window. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;By selecting edit or double clicking on a name, the ‘Edit Workspace’ window will opened. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;Select the workspace for the project you want to move to the new sever and delete it. VS should &lt;br /&gt;
allow you to move the project without any additional problems.  To connect to the new server &lt;br /&gt;
go to: Tools&amp;gt;Connect to Team Foundation Server…&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;Click on the server button then on the Add/Remove Team Foundation Server window select Add.&lt;br /&gt;
Enter CorpTFS01 and OK, then Close.  Select the new Server in the drop down list of the ‘Connect&lt;br /&gt;
To a Team Foundation Server’ dialogue box.  The available Team Projects for the selected sever &lt;br /&gt;
will be displayed.  Select all or the specific projects that you are interested in and click OK.&lt;/font&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/135755.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2009/10/27/tips-on-connecting-to-the-new-source-control-and-moving.aspx</guid>
            <pubDate>Tue, 27 Oct 2009 21:33:13 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/135755.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2009/10/27/tips-on-connecting-to-the-new-source-control-and-moving.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/135755.aspx</wfw:commentRss>
        </item>
        <item>
            <title>BizTalk DB Log File Explosion Due to Corrupt Index</title>
            <category>BizTalk</category>
            <category>Infrastructure</category>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2009/06/17/biztalk-db-log-file-explosion-due-to-corrupt-index.aspx</link>
            <description>&lt;p&gt;&lt;font face=""&gt;I have just encounted an unusual database problem.  My dev BizTalk server suddenly ran out of space.  Initially I thought it was the transaction logs.  No luck there they were well within normal limits.  I did check the size ot the &lt;br /&gt;
'Microsoft SQL Server' directory.  It was over 8GB.  The volume was traced to the LOG directory.  SQL was pumping out 4 MB of error log every 10 seconds. After fighting with the server to free up some disk space, I checked out the error files.  The parts appear to be:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;  ***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLDump7243.txt              &lt;br /&gt;
  * *******************************************************************************                                &lt;br /&gt;
  *                                                                                                                &lt;br /&gt;
  * BEGIN STACK DUMP:                                                                                              &lt;br /&gt;
  *   06/17/09 15:52:15 spid 54                                                                                    &lt;br /&gt;
  *                                                                                                                &lt;br /&gt;
  * CPerIndexMetaQS::ErrorAbort - Index corruption                                                                 &lt;br /&gt;
  *                                                                                                                &lt;br /&gt;
  * Input Buffer 510 bytes -                                                                                       &lt;br /&gt;
  *             EXECUTE msdb.dbo.sp_sqlagent_log_jobhistory @job_id = 0xBE810                                      &lt;br /&gt;
  *  129F3D1574AA4EB72EE897A6CCC, @step_id = 0, @sql_message_id = 0, @sql_sev                                      &lt;br /&gt;
  *  erity = 0, @run_status = 1, @run_date = 20090617, @run_time = 155201, @r                                      &lt;br /&gt;
  *  un_duration = 3, @operator_id_emailed = 0, @operator_id_netsent = 0, @op                                      &lt;br /&gt;
  *  erator_id_paged = 0, @retries_attempted = 0, @session_id = 65, @message                                       &lt;br /&gt;
  *  = N'The job succeeded.  The Job was invoked by Schedule 4 (Schedule).  T                                      &lt;br /&gt;
  *  he last step to run was step 1 (Purge).'                                                                      &lt;/font&gt;&lt;/p&gt;
&lt;font face=""&gt;
&lt;p&gt;&lt;br /&gt;
And&lt;/p&gt;
&lt;p&gt;  2009-06-17 15:52:14.55 spid56      Error: 8646, Severity: 21, State: 1. &lt;br /&gt;
  2009-06-17 15:52:14.55 spid56      Unable to find index entry in index ID 1, of table &lt;br /&gt;
  117575457, in database 'msdb'. The indicated index is corrupt or there is a &lt;br /&gt;
  problem with the current update plan. Run DBCC CHECKDB or DBCC CHECKTABLE. If &lt;br /&gt;
  the problem persists, contact product support. &lt;br /&gt;
  2009-06-17 15:52:15.24 spid54 Using 'dbghelp.dll' version '4.0.5' &lt;br /&gt;
  2009-06-17 15:52:15.24 spid54      **Dump thread - spid = 54, PSS = 0x0DDD32D0, EC = 0x0DDD32D8 &lt;br /&gt;
  2009-06-17 15:52:15.24 spid54      ***Stack Dump being sent to C:\Program Files\Microsoft SQL &lt;br /&gt;
  Server\MSSQL.1\MSSQL\LOG\SQLDump7243.txt &lt;br /&gt;
  2009-06-17 15:52:15.24 spid54      * ******************************************************************************* &lt;br /&gt;
  2009-06-17 15:52:15.24 spid54      * &lt;br /&gt;
  2009-06-17 15:52:15.24 spid54      * BEGIN STACK DUMP: &lt;br /&gt;
  2009-06-17 15:52:15.24 spid54      *   06/17/09 15:52:15 spid 54 &lt;br /&gt;
  2009-06-17 15:52:15.24 spid54      * 2009-06-17 15:52:15.24 spid54      * CPerIndexMetaQS::ErrorAbort - Index corruption&lt;/p&gt;
&lt;p&gt;Searching for 'CPerIndexMetaQS::ErrorAbort - Index corruption' online led me to a post that suggested running the following SQL script from SQL Server Manager on the local machine.&lt;/p&gt;
&lt;p&gt;  DECLARE  tempcursor&lt;br /&gt;
  CURSOR&lt;br /&gt;
  READ_ONLY&lt;br /&gt;
  FOR &lt;br /&gt;
        select spid From master..sysprocesses&lt;br /&gt;
        where dbid = (select database_id from sys.databases where name = 'msdb')&lt;br /&gt;
  &lt;br /&gt;
  DECLARE @name int&lt;br /&gt;
  OPEN tempcursor&lt;br /&gt;
  &lt;br /&gt;
  FETCH NEXT FROM tempcursor INTO @name&lt;br /&gt;
  WHILE (@@fetch_status &amp;lt;&amp;gt; -1)&lt;br /&gt;
  BEGIN&lt;br /&gt;
        exec('kill ' + @name)&lt;br /&gt;
  &lt;br /&gt;
        FETCH NEXT FROM tempcursor INTO @name&lt;br /&gt;
  END&lt;br /&gt;
  &lt;br /&gt;
  Use msdb&lt;br /&gt;
  Go&lt;br /&gt;
  sp_dboption 'msdb', 'single_user', 'true'&lt;br /&gt;
  GO&lt;br /&gt;
  DBCC CHECKDB('msdb', REPAIR_REBUILD) &lt;br /&gt;
  go&lt;br /&gt;
  sp_dboption 'msdb', 'single_user', 'false'&lt;br /&gt;
  &lt;br /&gt;
  CLOSE tempcursor&lt;br /&gt;
  DEALLOCATE tempcursor&lt;/p&gt;
&lt;p&gt;The script found and repaired the corrupt index, as shown below.&lt;/p&gt;
&lt;p&gt;  DBCC results for 'sysdownloadlist'.&lt;br /&gt;
  There are 0 rows in 0 pages for object "sysdownloadlist".&lt;br /&gt;
&lt;font color="#ff0000"&gt;  DBCC results for 'sysjobhistory'.&lt;br /&gt;
  Repair:  Successfully deleted row in index "dbo.sysjobhistory, nc1" in database "msdb".&lt;br /&gt;
  Msg 8952, Level 16, State 1, Line 1&lt;br /&gt;
  Table error: table 'sysjobhistory' (ID 117575457). Index row in index 'nc1' (ID 2) does not match any data row. Possible extra or invalid keys for:&lt;br /&gt;
          The error has been repaired.&lt;br /&gt;
  Msg 8956, Level 16, State 1, Line 1&lt;br /&gt;
  Index row (1:1141:114) with values (job_id = '89F8A96E-AF2B-4BE9-B5E4-FEF3B8C94EC5' and instance_id = 466459) pointing to the data row identified by (instance_id = 466459).&lt;br /&gt;
&lt;/font&gt;  There are 6640 rows in 459 pages for object "sysjobhistory".&lt;br /&gt;
  CHECKDB found 0 allocation errors and 1 consistency errors in table 'sysjobhistory' (object ID 117575457).&lt;br /&gt;
  CHECKDB fixed 0 allocation errors and 1 consistency errors in table 'sysjobhistory' (object ID 117575457).&lt;/p&gt;
&lt;p&gt;The log file generation has stopped and the server appears to be back to normal.&lt;/p&gt;
&lt;/font&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/132890.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2009/06/17/biztalk-db-log-file-explosion-due-to-corrupt-index.aspx</guid>
            <pubDate>Wed, 17 Jun 2009 23:24:19 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/132890.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2009/06/17/biztalk-db-log-file-explosion-due-to-corrupt-index.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/132890.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
