<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>Coding</title>
        <link>http://geekswithblogs.net/PsudoKnowledgeBase/category/8992.aspx</link>
        <description>Coding</description>
        <language>en-CA</language>
        <copyright>Geordie</copyright>
        <managingEditor>Martin.palmer@mjpalmer.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>NullReferenceException when calling the Retrieve method of the OrganizationServiceProxy object</title>
            <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>
            <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>Click Once Deployment Process and Issue Resolution</title>
            <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>BizTalk: Receiving Multi Part Messages</title>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/27/biztalk-receiving-multi-part-messages.aspx</link>
            <description>&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;I have been working on a BizTalk project for a while now and after a bumpy start all has been going well. The current message that we are dealing with is the receipt and processing of a Purchase Order. The processing and mapping of the purchase order to the SAP orders schema went well and all I need to do was to receive the document from the customer. After a bit of a delay in getting an accurate sample message, I set to work on creating a process for receiving a PO from a Ponton server. On examining the sample message I found I was going to need to deal with receiving a Multi Part message.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;So I looked at the SDK and searched online but found very little guidance. The samples and discussion where mainly about receiving messages from the POP3 adapter. In our scenario the message will be received by HTTP then dropped to a file. It will then be archived and processed.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;How difficult can it be! 4 days latter I can answer the question. It is not easy if you have not dealt with this type of message before. So here is my guidance on this issue.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;First I have created a sample project (the files 'BizTalk - Receiving.zip' can be downloaded from &lt;a href="http://cid-96aebf00cffa01bd.skydrive.live.com/browse.aspx/.Public/Blog%20Posts"&gt;http://&lt;font face=""&gt;cid-96aebf00cffa01bd.skydrive.live.com/browse.aspx/.Public/Blog%20Posts&lt;/font&gt;) . The code, schemas, sample message, and binding file are all included. This should give you a good starting point to work out what you need to do for your project.&lt;/a&gt;&lt;/div&gt;
&lt;div style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;1.&lt;span style="FONT: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;Sample messages. As mentioned the samples that I found were email messages. I was not sure if these samples were relevant to my project. With respect to the message it appears that BizTalk cares about the MIME 1.0, boundary and description declarations. As it happens the message I was receiving was missing all these parts. Also check out this post from Doug - &lt;a href="http://www.tech-archive.net/Archive/BizTalk/microsoft.public.biztalk.general/2006-07/msg00134.html"&gt;http://www.tech-archive.net/Archive/BizTalk/microsoft.public.biztalk.general/2006-07/msg00134.html&lt;/a&gt;. Unfortunately the final solution was not posted but it helped me get closer to a solution.&lt;/div&gt;
&lt;div style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;2.&lt;span style="FONT: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;You will need to make a Multi Part message in your orchestration. This is well covered in blogs and documentation. It is also straight forward. But here is the kicker. When are receiving multi part messages, the order you create the message parts matters!! &lt;a href="http://www.stottcreations.com/blog/inner-exception-multi-part-message-has-body-part-bodysegments-expected-body-part-mshsegment/"&gt;Eric&lt;/a&gt; did a good job of documenting this ‘undocumented’ feature.  &lt;br /&gt;
To summarize Eric’s post: The order of the message parts in displayed in VS is alphabetical, but creation order matters and may be different from what is displayed in VS. The message parts need to be created in the order they appear after the message has been split into its parts by the pipeline. The only way to determine the order of creation is to view the orchestration file in a text editor. You can find the message part order by examining the failed message in BizTalk Manager. Drill into the error, go the message tab and double click the message. The message parts should be listed on the left hand side.&lt;br /&gt;
If you are getting an &lt;a href="http://www.stottcreations.com/blog/inner-exception-multi-part-message-has-body-part-bodysegments-expected-body-part-mshsegment/"&gt;&lt;span style="COLOR: windowtext; TEXT-DECORATION: none; text-underline: none"&gt;Inner exception: ‘Wrong BodyPartException …’ and ‘Multi-part message has body part ‘XXXXX’, expected body part ‘YYYYYY’&lt;/span&gt;&lt;/a&gt;, and everything appears to be correct, check this as a possible cause. I lost over a day trying to resolve this issue!&lt;br /&gt;
The sample application contains 2 Multi Part messages only the second one works even though they look the same in VS.&lt;/div&gt;
&lt;div style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;3.&lt;span style="FONT: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;You will need a custom pipeline. BizTalk uses the MIME component to process multi part messages. Even if the message is not a MIME message it can be processed by setting the ‘allow non MIME message’ property to true. The body part content type field is optional. Valid values are ‘text/xml ‘, ‘application/xml’… etc. The ‘Body part index’ is a 0 based index that identifies the body part by location in the message.  It took me a while to discover that I also needed to add an XML dissembler in the pipeline as well. All the message part schemas are added to the ‘Document schemas’ collection.&lt;br /&gt;
        &lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt 36pt"&gt; &lt;img alt="" width="500" height="224" src="/images/geekswithblogs_net/PsudoKnowledgeBase/MIME and XML Property.JPG" /&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;Tricks that might help:&lt;/div&gt;
&lt;div style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;·&lt;span style="FONT: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;         &lt;/span&gt;&lt;/span&gt;Initially type the Multi Part message parts as System.Xml.XmlDocument. This will remove at least one area of possible error. This will allow you to identify other problems and resolve them one at a time.&lt;/div&gt;
&lt;div style="TEXT-INDENT: -18pt; MARGIN: 0cm 0cm 10pt 36pt"&gt;&lt;span&gt;·&lt;span style="FONT: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;         &lt;/span&gt;&lt;/span&gt;View the orchestration file in Notepad. Look for the definition of the multi part message. The order the parts are listed in the XML are the order the message parts were created. Remember creation order matters.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;strong&gt;&lt;u&gt;Sample Message&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;MIME-Version: 1.0&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;Content-Type: multipart/related; type="text/xml";&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;                boundary="_968002A2-AAE4-43E0-90D3-83461FE91020_"&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt; --_968002A2-AAE4-43E0-90D3-83461FE91020_&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;MIME-Version: 1.0&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;Content-Transfer-Encoding: binary&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;Content-Description: Header&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt; &amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&amp;lt;soapenv:Header&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&amp;lt;eb:MessageHeader xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd" eb:version="2.0" soapenv:mustUnderstand="1"&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;... Rest of the Header Message....&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&amp;lt;/soapenv:Body&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&amp;lt;/soapenv:Envelope&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;--_968002A2-AAE4-43E0-90D3-83461FE91020_&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;MIME-Version: 1.0&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;Content-Transfer-Encoding: binary&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;Content-Description: POMsg&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt; &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&amp;lt;PurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PurchaseOrderV2R30" PurchaseOrderStatusType="Original" PurchaseOrderType="StandardOrder"&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;... Rest of the Purchase Order Message....&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&amp;lt;/PurchaseOrder&amp;gt;&lt;/div&gt;
&lt;span style="LINE-HEIGHT: 115%; FONT-SIZE: 11pt"&gt;--_968002A2-AAE4-43E0-90D3-83461FE91020_--&lt;/span&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/127428.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/27/biztalk-receiving-multi-part-messages.aspx</guid>
            <pubDate>Fri, 28 Nov 2008 04:10:59 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/127428.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/27/biztalk-receiving-multi-part-messages.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/127428.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Notes on Resolving BizTalk Connectivity Issues with Ponton clients</title>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/14/notes-on-resolving-biztalk-connectivity-issues-with-ponton-clients.aspx</link>
            <description>&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;Notes on Resolving Connectivity Issues&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;During the first stage of the Integration project a number of challenges were encountered. Some of these obstacles could have been avoided but we chose to resolve them so that we would have a solid solution for further development.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;Challenges Encountered&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt"&gt;&lt;span&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Server 500 error when posting messages to customer with a static port configuration and document that worked for other customers.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt"&gt;&lt;span&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Ponton responds with an ‘Internal Storage’ Error.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt 36pt; TEXT-INDENT: -18pt"&gt;&lt;span&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;The dynamic port fails with either a 500 server error or a 204 (StatusDescription=No Content) server error.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;strong&gt;&lt;u&gt;Issue 1&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;After a lot of work and Microsoft’s help we tracked the first error down to the customer’s server being unable to process HTTP 1.1 messages. The customer is currently running iPlanet 6 SP 10 on a Solaris 8 with a Ponton application server running WebLogic 8.1 SP6 also running on Solaris 8. &lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;HTTP 1.1 includes chunking of messages at the HTTP level. In this case the customer’s server could not recombine the chunked message and failed with a 500 error. By default the HTTP chunking is turned on when a new static HTTP port is created in BizTalk. To turn this off click on the Configuration button in the Transport section of the Send Port’s General Property page. Under the Destination URL field there is a check box labeled ‘Enable chunked encoding’. By clearing this check box the HTTP 1.1 chunking feature will be disabled.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;NOTE:  While we were trying to resolve this issue the Microsoft tech ask me to run Microsoft Network Monitor 3.0 (NetMon) to capture the traffic so that we could determine if there was an obvious message problem. Due to the process used by NetMon it could not capture the HTTP traffic. It could however capture the HTTPS traffic. I’ve not sure why this is but it is worth noting.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;strong&gt;&lt;u&gt;Issue 2&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;The second issue was resolved with the assistance of Ponton. Our current customers use older versions of Ponton . Our new customer uses the 2.4 version of this product. It turned out that the use of the ‘Content-Disposition: attachment; filename="=?utf-8?B?QXR0YWNobWVudDF=?="’ property in the document header changed in the newer version. Older versions ignored this property. When we deleted this line from the header the ‘internal storage’ error was no longer raised by the Ponton server.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;strong&gt;&lt;u&gt;Issue 3&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;Finally when we tried to move the solution to a more dynamic design the customers server started to respond with 500 server errors again. Since the integration with our customer is over an SSL connection we contacted Ponton to see if they had a test server that uses HTTP for our analysis. When we connected with this server (Apache running on Linux) we received 204 server errors. If we tested the dynamic port with the same message against a BizTalk server running on a windows 2003 server it processed successfully.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;The Microsoft Tech again tried to use NetMon to monitor the traffic with the same results. As a result several other techniques where used to capture the traffic to understand the differences in the messages.&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;By adding the following XML to the BTSNTSvc.exe.config file and running Sysinternals &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx"&gt;Debug Viewer&lt;/a&gt; we were able to monitor the traffic as it was generated in BizTalk.&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&amp;lt;configuration&amp;gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;    &amp;lt;system.diagnostics&amp;gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;        &amp;lt;trace autoflush="true" /&amp;gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;                &amp;lt;sources&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                &amp;lt;source name="System.Net"&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                        &amp;lt;listeners&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                                &amp;lt;add name="System.Net"/&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                        &amp;lt;/listeners&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                &amp;lt;/source&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                &amp;lt;source name="System.Net.HttpListener"&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                        &amp;lt;listeners&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: 36pt; LINE-HEIGHT: normal"&gt;                &amp;lt;add name="System.Net"/&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                        &amp;lt;/listeners&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                &amp;lt;/source&amp;gt;&lt;/div&gt;
&lt;div style="TEXT-INDENT: 36pt; LINE-HEIGHT: normal"&gt;               &amp;lt;source name="System.Net.Sockets"&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                        &amp;lt;listeners&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: 36pt; LINE-HEIGHT: normal"&gt;                &amp;lt;add name="System.Net"/&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                        &amp;lt;/listeners&amp;gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;                &amp;lt;/source&amp;gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;                               &amp;lt;source name="System.Net.Cache"&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                        &amp;lt;listeners&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: 36pt; LINE-HEIGHT: normal"&gt;                &amp;lt;add name="System.Net"/&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                        &amp;lt;/listeners&amp;gt;&lt;/div&gt;
&lt;div style="TEXT-INDENT: 36pt; LINE-HEIGHT: normal"&gt;                &amp;lt;/source&amp;gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;                &amp;lt;/sources&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;   &amp;lt;sharedListeners&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                &amp;lt;add&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                 name="System.Net"&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                 type="System.Diagnostics.TextWriterTraceListener"&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                  initializeData="System.Net.trace.log"&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                 traceOutputOptions = "DateTime"&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;                /&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;    &amp;lt;/sharedListeners&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;    &amp;lt;switches&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;        &amp;lt;add name="System.Net" value="Verbose" /&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;        &amp;lt;add name="System.Net.Sockets" value="Verbose" /&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;        &amp;lt;add name="System.Net.Cache" value="Verbose" /&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;        &amp;lt;add name="System.Net.HttpListener" value="Verbose" /&amp;gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 0pt 36pt; LINE-HEIGHT: normal"&gt;    &amp;lt;/switches&amp;gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;    &amp;lt;/system.diagnostics&amp;gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&amp;lt;/configuration&amp;gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;The first thing that was determined through this process was the default settings for a HTTP static port are not the same as those of the dynamic port. These settings were modified in an orchestration message assignment shape with the code shown below.&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;font size="2"&gt;
&lt;p&gt;PontonMessage(HTTP.EnableChunkedEncoding) = false;&lt;br /&gt;
PontonMessage(HTTP.ContentType) = "multipart/related; type=\"text/xml\"; start=ebxml-header; boundary=\"_00000000-0000-0000-0000-000000000000_\"";&lt;br /&gt;
PontonMessage(HTTP.UseHandlerProxySettings) = true;&lt;br /&gt;
PontonMessage(HTTP.AuthenticationScheme) = "Anonymous";&lt;/p&gt;
&lt;/font&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;Addressing these differences was the first place that we tried to resolve the issue. Unfortunately this did not resolve the problem.&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt; &lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;The final test we did was to use a network sniffer called 'WireShark' to monitor the traffic. This allowed the text comparison of a static and a dynamic message. From this comparison the only differences were the date stamps, unique ID and the quotes around the content type parameters as shown below.&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt; &lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;Dynamic Message:&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;Content-Type: multipart/related; type=’text/xml’; start=ebxml-header; boundary=’_00000000-0000-0000-0000-000000000000_’&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt; &lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;The non Windows server required the quotes to be double quotes and could not process the message if single quotes were used. As a result the code int the Orchestration expression shape was changed as shown below.&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt; &lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;From:&lt;br /&gt;
PontonMessage(HTTP.ContentType) = “multipart/related; type=’text/xml’; start=ebxml-header; boundary=’_00000000-0000-0000-0000-000000000000_’”;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;To:&lt;br /&gt;
PontonMessage(HTTP.ContentType) = "multipart/related; type=\"text/xml\"; start=ebxml-header; boundary=\"_00000000-0000-0000-0000-000000000000_\"";&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;I hope this helps other people.  This has been an interesting ride for me.  Integration with non Microsoft systems can result in some unexpected problems.&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/127040.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/14/notes-on-resolving-biztalk-connectivity-issues-with-ponton-clients.aspx</guid>
            <pubDate>Fri, 14 Nov 2008 19:00:14 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/127040.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/14/notes-on-resolving-biztalk-connectivity-issues-with-ponton-clients.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/127040.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Getting Document Values from Repeating Nodes in BizTalk</title>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/13/getting-document-values-from-repeating-nodes-in-biztalk.aspx</link>
            <description>&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;To access a variable in a document in BizTalk is quite easy. First you go to the schema of the document and right click on the value you want to promote. Select Promote -&amp;gt; Show Promotions. To promote the variable as a distinguished property simply click the add button. If you messages are in a separate project make sure you build the solution before continuing. Accessing the promoted property in the orchestration is a simple process. Typing the message name, that represents the schema, in an expression shape. Intellisense will then guide you the rest of the way.&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;Now try that if the document variable that you require can have multiple values. As soon as you try to promote the field BizTalk will refuse to continue displaying the following dialog.&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;&lt;img height="103" width="628" alt="" src="/images/geekswithblogs_net/PsudoKnowledgeBase/BTMultiNodeMsg.JPG" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;Currently I’m in the situation where I need that variable to start my mapping process. To get over this problem I have written a helper function is C#. The class is easily accesses from the orchestration. Simply reference the helper class project in the project that contains the orchestration. &lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; System;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; System.Text;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; System.Xml;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; Microsoft.XLANGs.BaseTypes;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; System.Configuration;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; System.IO;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt; &lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; CustomerIntegration2.PAPINET.MessagingSupport&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;    &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: teal"&gt;Helper&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="LINE-HEIGHT: normal"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;… &lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;In an expression shape reference the helper class as shown below&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;CustomerNumber = CustomerIntegration2.PAPINET.MessagingSupport.Helper.GetCustomerID()&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;&lt;font face="Arial"&gt;To allow the method to do its work it needs the message data.  To achieve this I’m using an XPath query to grab the section of the message I need to process.  In this case I’m also passing in mapping data as I need to convert the value to a customer ID.  ‘BuyerDoc’ is a declared variable, of type System.Xml.XmlDocument, in the orchestration.&lt;br /&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%"&gt;&lt;font face="Arial"&gt;BuyerDoc = xpath(PAPINetPO, "/*[local-name()='PurchaseOrder']/*[local-name()='PurchaseOrderHeader']/*[local-name()='BuyerParty']");&lt;br /&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/127011.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Geordie</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/13/getting-document-values-from-repeating-nodes-in-biztalk.aspx</guid>
            <pubDate>Thu, 13 Nov 2008 23:48:16 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/127011.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/13/getting-document-values-from-repeating-nodes-in-biztalk.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/127011.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Documenting C# Code</title>
            <link>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/04/documenting-c-code.aspx</link>
            <description>&lt;p&gt;An interesting application I was shown for documenting C# code is called &lt;a target="_blank" href="http://www.roland-weigelt.de/ghostdoc/"&gt;Ghost Doc&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Roland's summary of the tool:- GhostDoc is a free add-in for Visual Studio that automatically generates XML&lt;br /&gt;
documentation comments for C#. Either by using existing documentation inherited&lt;br /&gt;
from base classes or implemented interfaces, or by deducing comments from&lt;br /&gt;
name and type of e.g. methods, properties or parameters.&lt;br /&gt;
 &lt;/p&gt; &lt;img src="http://geekswithblogs.net/PsudoKnowledgeBase/aggbug/126612.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>PsudoKnowledgeBase</dc:creator>
            <guid>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/04/documenting-c-code.aspx</guid>
            <pubDate>Tue, 04 Nov 2008 15:30:30 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsudoKnowledgeBase/comments/126612.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsudoKnowledgeBase/archive/2008/11/04/documenting-c-code.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsudoKnowledgeBase/comments/commentRss/126612.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
