<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Entropy Specialists Blog</title>
	<atom:link href="http://www.entropyspecialists.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.entropyspecialists.com/blog</link>
	<description>Mobile Development and Beyond</description>
	<lastBuildDate>Wed, 17 Apr 2013 16:10:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Automated Unit Testing CRM Plug-ins Part I : Plug-in Profiler</title>
		<link>http://www.entropyspecialists.com/blog/?p=163</link>
		<comments>http://www.entropyspecialists.com/blog/?p=163#comments</comments>
		<pubDate>Wed, 17 Apr 2013 16:10:39 +0000</pubDate>
		<dc:creator>BusinessEntropy</dc:creator>
				<category><![CDATA[Dynamics CRM]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Unit Test]]></category>

		<guid isPermaLink="false">http://www.entropyspecialists.com/blog/?p=163</guid>
		<description><![CDATA[Linked from my post on our corporate blog at Green Beacon Connect &#8211; 1st step to automate your Plug-in testing with Microsoft Dynamics CRM. I&#8217;m no TDD / Unit Testing guru, but I feel like it&#8217;s a decent approach. Part &#8230; <a href="http://www.entropyspecialists.com/blog/?p=163">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Linked from my post on our corporate blog at <a title="Green Beacon Connect" href="http://connect.greenbeacon.com/2013/04/technical-post-automated-testing-for-microsoft-dynamics-crm-2011-part-i-plug-in-profiler/" target="_blank">Green Beacon Connect</a> &#8211; 1st step to automate your Plug-in testing with Microsoft Dynamics CRM. I&#8217;m no TDD / Unit Testing guru, but I feel like it&#8217;s a decent approach. Part II forthcoming with actual utility&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entropyspecialists.com/blog/?feed=rss2&#038;p=163</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 8 &#8211; Cannot Link to Facebook</title>
		<link>http://www.entropyspecialists.com/blog/?p=158</link>
		<comments>http://www.entropyspecialists.com/blog/?p=158#comments</comments>
		<pubDate>Mon, 18 Mar 2013 03:28:47 +0000</pubDate>
		<dc:creator>BusinessEntropy</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Win8]]></category>

		<guid isPermaLink="false">http://www.entropyspecialists.com/blog/?p=158</guid>
		<description><![CDATA[So there is this whole &#8216;charms&#8217; interface in Windows 8 (hover your pointer in the upper left corner) with a nice &#8216;Share&#8217; button. However, since Facebook doesn&#8217;t have an official Windows 8 app, it doesn&#8217;t show up as an option &#8230; <a href="http://www.entropyspecialists.com/blog/?p=158">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>So there is this whole &#8216;charms&#8217; interface in Windows 8 (hover your pointer in the upper left corner) with a nice &#8216;Share&#8217; button. However, since Facebook doesn&#8217;t have an official Windows 8 app, it doesn&#8217;t show up as an option when you click the &#8216;Share&#8217; button.</p>
<p>However, you DO get a &#8216;Share&#8217; option called &#8216;People&#8217; &#8211; if you click that, then &#8216;Connect to Facebook&#8217; is an option.</p>
<p>EVERY time I tried to &#8216;Connect to Facebook&#8217; from the People app, I got the message &#8220;We can not connect to the service you need right now. Please check your network settings or try again later.&#8221; You may get similar or other errors when trying to connect Twitter or Google accounts in the same fashion.</p>
<p>The fix (at least for me) was to go to <a href="https://profile.live.com/services" title="https://profile.live.com/services" target="_blank">https://profile.live.com/services</a> and authorize the Facebook/Twitter/Google connections from there first. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.entropyspecialists.com/blog/?feed=rss2&#038;p=158</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resort + tech + LARP = awesome</title>
		<link>http://www.entropyspecialists.com/blog/?p=154</link>
		<comments>http://www.entropyspecialists.com/blog/?p=154#comments</comments>
		<pubDate>Sun, 02 Sep 2012 12:49:09 +0000</pubDate>
		<dc:creator>BusinessEntropy</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://www.entropyspecialists.com/blog/?p=154</guid>
		<description><![CDATA[So I&#8217;m writing this on my phone from our room at Great Wolf Lodge, where do I begin? First of all, let me be clear, it&#8217;s pricey. However, it&#8217;s also brilliant. The indoor water park is awesome, if a bit &#8230; <a href="http://www.entropyspecialists.com/blog/?p=154">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>So I&#8217;m writing this on my phone from our room at Great Wolf Lodge, where do I begin? First of all, let me be clear, it&#8217;s pricey. However, it&#8217;s also brilliant. The indoor water park is awesome, if a bit high on chlorine content (what do you expect though). The room key is an RFID bracelet that lets you access all resort facilities and shops&#8230;nothing to carry. And the masterpiece (which I am right now trying to decide how to take everywhere) is MagiQuest, a pseudo-LARP ( live action role play) using a magic wand and technology. Quests are issued and tracked, and you wander the hotel in search of clues and treasure. Sort of like local, tech based geocaching. I saw entire families (including ours) climbing 7 flights of stairs (in the &#8216;secret staircase&#8217;) -repeatedly- to capture all the wand points at each floor. Exercise, quests, treasure, experience points&#8230;.Blizzard/WoW needs to learn how to do this. I must figure out how to do this at my home, neighborhood, local mall/grocery store/etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entropyspecialists.com/blog/?feed=rss2&#038;p=154</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s not me, it&#8217;s you</title>
		<link>http://www.entropyspecialists.com/blog/?p=146</link>
		<comments>http://www.entropyspecialists.com/blog/?p=146#comments</comments>
		<pubDate>Sat, 01 Sep 2012 00:36:00 +0000</pubDate>
		<dc:creator>BusinessEntropy</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[Info.plist]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[validate]]></category>

		<guid isPermaLink="false">http://www.entropyspecialists.com/blog/?p=146</guid>
		<description><![CDATA[I just finished my annual pilgrimage of the mind&#8230;the one where I contemplate NOT renewing my iOS developer license because once again, I procrastinated a year away of nothing but a few minor updates&#8230;and, as usual I rationalize myself into &#8230; <a href="http://www.entropyspecialists.com/blog/?p=146">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I just finished my annual pilgrimage of the mind&#8230;the one where I contemplate NOT renewing my iOS developer license because once again, I procrastinated a year away of nothing but a few minor updates&#8230;and, as usual I rationalize myself into another year. Usually this coincides roughly with a new major version of iOS about to be released, and realizing that I need to re-up my MonoTouch license as well, so I can recompile my laggard apps so they don&#8217;t crash when everyone downloads iOS #NEW. So last night, I fire everything up, it&#8217;s all going smoothly, until I hit Application Loader. </p>
<p>&#8220;Unable to process application Info.plist validation at this time due to a general error &#8221;</p>
<p>Well after redoing my Info.plist twice from scratch, one line at a time, and watching it break eventually after adding all required parts, I finally found some current threads by other people exhibiting the exact same issue, as well as periodic similar issues over the last few years. So I slept on it, and tonight, the package submitted successfully right away. All is right with the world.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entropyspecialists.com/blog/?feed=rss2&#038;p=146</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 8 &#8211; Copy file from Assets to Local Folder</title>
		<link>http://www.entropyspecialists.com/blog/?p=144</link>
		<comments>http://www.entropyspecialists.com/blog/?p=144#comments</comments>
		<pubDate>Wed, 09 May 2012 03:26:22 +0000</pubDate>
		<dc:creator>BusinessEntropy</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[file copy]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://www.entropyspecialists.com/blog/?p=144</guid>
		<description><![CDATA[When porting mobile apps to Windows 8, I immediately came across the same issue as each of the previous platforms, namely, how to copy my &#8216;starting&#8217; data files into local storage where they can be modified. In this case, I &#8230; <a href="http://www.entropyspecialists.com/blog/?p=144">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.entropyspecialists.com/blog/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>When porting mobile apps to Windows 8, I immediately came across the same issue as each of the previous platforms, namely, how to copy my &#8216;starting&#8217; data files into local storage where they can be modified.</p>
<p>In this case, I have a file in my Assets folder called &#8216;Prayers.xml&#8217;. At application startup I want to verify if the file already exists in the local store &#8211; if not, copy it from the Assets folder in the installation directory.</p>
<p>This is how you end up handling it in Windows 8.</p>
<p><pre class="brush: csharp">        async void CopyPrayerFile()
        {
            //get the storage for your app 
            Windows.Storage.StorageFolder store = Windows.Storage.ApplicationData.Current.LocalFolder;
            StorageFile prayerFile = null;
            try
            {
                prayerFile = await store.GetFileAsync(&quot;Prayers.xml&quot;);
            }
            catch (System.IO.FileNotFoundException)
            {}

            if (prayerFile == null)
            {
                //get the file from Assets

                StorageFolder install = Windows.ApplicationModel.Package.Current.InstalledLocation;
                StorageFile installFile = await install.GetFileAsync(&quot;Assets\Prayers.xml&quot;);

                installFile.CopyAsync(store);   
            }
        }</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.entropyspecialists.com/blog/?feed=rss2&#038;p=144</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Xamarin Rules</title>
		<link>http://www.entropyspecialists.com/blog/?p=142</link>
		<comments>http://www.entropyspecialists.com/blog/?p=142#comments</comments>
		<pubDate>Sat, 14 Apr 2012 20:36:12 +0000</pubDate>
		<dc:creator>BusinessEntropy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.entropyspecialists.com/blog/?p=142</guid>
		<description><![CDATA[So it&#8217;s been a while now since I first purchased MonoTouch, waaaay back in the Novell days. I wanted to do some iOS development, but my daily driver is C#, and it seemed like a great onramp to iOS development. Now, &#8230; <a href="http://www.entropyspecialists.com/blog/?p=142">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.entropyspecialists.com/blog/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>So it&#8217;s been a while now since I first purchased MonoTouch, waaaay back in the Novell days. I wanted to do some iOS development, but my daily driver is C#, and it seemed like a great onramp to iOS development.</p>
<p>Now, with Xamarin fully owning the MonoTouch bits, it&#8217;s 100 times better and more polished, so much so that I&#8217;ll probably never bother touching XCode in any significant fashion. I know it&#8217;s lazy, but I&#8217;m lazy. Well, lazy in an &#8216;efficient&#8217; way, not lazy in a &#8216;slacker&#8217; way. Why bother with yet another language and IDE if I can accomplish the same thing using tools similar to what I already use full-time?</p>
<p>I got an email FROM Xamarin the other day saying something like &#8220;Hey Apple changed some of the calls that used to be unrestricted to now be privileged calls, so if you are using X in your app, (in my case Console.Write for debugging messages) your app will crash with iOS 5.1.&#8221; &#8230; followed by &#8220;if you download the latest MonoTouch and recompile this will be fixed&#8221;.</p>
<p>So something that would have probably required me to change some code had I been doing the same thing in XCode  was reduced to downloading a MonoTouch update, recompiling, and submitting the updated App to the App Store. I&#8217;ll take that any day.</p>
<p>I &lt;3 Xamarin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entropyspecialists.com/blog/?feed=rss2&#038;p=142</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The new Android Market Developer agreement&#8230;</title>
		<link>http://www.entropyspecialists.com/blog/?p=131</link>
		<comments>http://www.entropyspecialists.com/blog/?p=131#comments</comments>
		<pubDate>Sun, 11 Dec 2011 23:37:43 +0000</pubDate>
		<dc:creator>BusinessEntropy</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Developer Agreement]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.entropyspecialists.com/blog/?p=131</guid>
		<description><![CDATA[So I logged in to my Android Market publisher account, because it&#8217;s been a while, and I&#8217;m thinking of updating some apps, and trying again to see if I can reproduce some of the fairly major (I admit it) bugs &#8230; <a href="http://www.entropyspecialists.com/blog/?p=131">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.entropyspecialists.com/blog/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>So I logged in to my Android Market publisher account, because it&#8217;s been a while, and I&#8217;m thinking of updating some apps, and trying again to see if I can reproduce some of the fairly major (I admit it) bugs that keep getting reported that I just can&#8217;t track down&#8230;and lo and behold, there&#8217;s a new developer agreement. Normally, like most of the world&#8217;s population, I just scroll down and click &#8216;accept&#8217; these agreements. For some reason this time, I decided to read it first.</p>
<p>Following are a list of concerns that struck me on reviewing this thing&#8230;</p>
<p>***SPOILER &#8211; I still accepted it &#8211; what choice do I really have?****</p>
<p>***DISCLAIMER &#8211; I am a pure hobbyist. Yes my personal apps are not polished, and I have nowhere near the appropriate level of QA resources to ship bug-free. The products work on my hardware, and any bugs I have been able to reproduce DO get fixed in my limited time.</p>
<p><strong>3.2 Developer is responsible for determining if a Product is taxable and the applicable tax rate for the Payment Processor to collect for each taxing jurisdiction where Products are sold. Developer is responsible for remitting taxes to the appropriate taxing authority.</strong></p>
<ul>
<li>Did I, as a hobbyist selling apps through a <strong>required</strong> Google-authorized payment processor, just have said payment processor abdicate all responsibility of tax collection and remittance? Isn&#8217;t that much more suited to what a payment processor DOES? And now any taxes (even if there aren&#8217;t any NOW) that come up in the future, all come directly out of MY share.</li>
</ul>
<p><strong>3.5 Except in cases when multiple disputes are initiated by a user with abnormal dispute history, billing disputes received by Payment Processor for Products sold for less than $10 may be automatically charged back to the Developer, in addition to any handling fees charged by the Payment Processor. Chargeback requests for Products $10 or more will be handled in accordance with the Payment Processor&#8217;s standard policy. </strong></p>
<ul>
<li>In my opinion, chargebacks are the WORST part of this whole business for a hobbyist developer. This policy has bounced back and forth a few times at Google, but now it seems that they are landing directly in the camp of &#8220;<strong>Developer pays all chargeback fees&#8221;</strong>. In case you&#8217;re not familiar, a chargeback is when someone uses a credit card to buy a $.99 app, then decides to dispute the charges on the credit card. So I don&#8217;t get paid my $.99, and guess what, I also get dinged a $10 &#8216;chargeback fee&#8217; by Google Checkout &#8211; and I just personally lost $10 on a $.99 sale.</li>
</ul>
<ul>
<li>This ALONE is very close to enough for me to immediately take any non-free apps off the android market, just because some competing schmuck could decide to have all his buddies buy my app, give it a crappy rating, and then do chargebacks and cost me money directly. Unlikely? Sure. But absolutely possible.</li>
</ul>
<ul>
<li>How about this scenario? I can only test on the ONE Android device I own. According to the bug reports, there are people that the app crashes for, but I CANNOT PERSONALLY reproduce the issue, and I have no idea what hardware they are running. I have limited time and resources for this hobby, and if it crashes when you install it, PLEASE just get the 15-minute refund. But, suppose instead the user gets frustrated (totally understandable), and instead of just trying to get a refund, disputes the credit card charge. BAM.</li>
</ul>
<ul>
<li>The $10 price point is just Google thumbing their nose at Android developers. How many Android apps have you bought that have a price &gt; $10? The OLD policy was that if the CHARGEBACK total amount was &lt; $10, Google would NOT pass it back to the developer. Now, it says the developer gets it AUTOMATICALLY, unless the SALE price is &gt; $10.</li>
</ul>
<ul>
<li>I&#8217;m sure somebody is probably thinking &#8216;GREAT, this will get all those useless apps off the Marketplace&#8217; but to me it&#8217;s pretty shoddy behavior. If you want to curate the marketplace, then do it.</li>
</ul>
<p><strong>4.9 Your Products may be subject to user ratings to which you may not agree. You may <a href="http://market.android.com/support/">contact</a> Google if you have any questions or concerns regarding such ratings.</strong></p>
<ul>
<li>Translation: If someone decides to post a completely idiotic review (happens ALL the time) there is NOTHING you can do about it. If it’s egregious enough, and you happen to make us a lot of money, we might pursue it, but if you are making that much money, your legit-to-idiot rating ratio is probably not that bad so you’re not as concerned as an indie who is throwing out some proof-of-concept utility apps and getting trashed by folks who want an entire mini-Microsoft Office suite for free.</li>
</ul>
<ul>
<li>No clear, defined policy for trash reviews is a big failure here IMHO.</li>
</ul>
<p>At this point I kind of just sighed and scrolled down the rest of the text.</p>
<p>“Accept”. Click.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entropyspecialists.com/blog/?feed=rss2&#038;p=131</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back in the [iOS] saddle again.</title>
		<link>http://www.entropyspecialists.com/blog/?p=127</link>
		<comments>http://www.entropyspecialists.com/blog/?p=127#comments</comments>
		<pubDate>Thu, 20 Oct 2011 03:39:33 +0000</pubDate>
		<dc:creator>BusinessEntropy</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[MonoTouch]]></category>

		<guid isPermaLink="false">http://www.entropyspecialists.com/blog/?p=127</guid>
		<description><![CDATA[I thought I would take this opportunity to inform the world that, yes, I have relicensed MonoTouch [now by XAMARIN!] after a brief foray into Objective-C. MonoTouch is far too nice a crutch to give up now, especially given that &#8230; <a href="http://www.entropyspecialists.com/blog/?p=127">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.entropyspecialists.com/blog/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>I thought I would take this opportunity to inform the world that, yes, I have relicensed MonoTouch [now by <a title="XAMARIN!" href="http://xamarin.com/" target="_blank">XAMARIN</a>!] after a brief foray into Objective-C. MonoTouch is far too nice a crutch to give up now, especially given that I am developing on Android and Windows Phone as well, and just don&#8217;t have the time or patience to step back into the land of pointers and such.</p>
<p>In related news, I also updated my Mac Mini to Lion. And it immediately blew up my finely-tuned Vine Server VNC setup (the mac mini is hidden away on a shelf somewhere, and I access it only via VNC). But, soon after, I figured out &#8216;Screen Sharing&#8217; at least and am up and running again. [No, I am /not/ a 'Mac' person].</p>
<p>MonoDevelop and MonoTouch have come a long way just in the last several months &#8211; I&#8217;m feeling motivated to put out some fresh iOS 5 updates!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entropyspecialists.com/blog/?feed=rss2&#038;p=127</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate generic BizTalk messages from Dynamics CRM 2011</title>
		<link>http://www.entropyspecialists.com/blog/?p=120</link>
		<comments>http://www.entropyspecialists.com/blog/?p=120#comments</comments>
		<pubDate>Thu, 20 Oct 2011 03:19:57 +0000</pubDate>
		<dc:creator>BusinessEntropy</dc:creator>
				<category><![CDATA[Dynamics CRM]]></category>
		<category><![CDATA[BizTalk]]></category>

		<guid isPermaLink="false">http://www.entropyspecialists.com/blog/?p=120</guid>
		<description><![CDATA[For the Word version, with some extra pictures and nicer formatting, see here Generating BizTalk Messages from Dynamics CRM Otherwise, here&#8217;s the quick copy/paste version. Enjoy. BizTalk – Generating Outbound Messages from Dynamics CRM [Author’s Note]: Please don’t judge me &#8230; <a href="http://www.entropyspecialists.com/blog/?p=120">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.entropyspecialists.com/blog/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p><em>For the Word version, with some extra pictures and nicer formatting, see here</em></p>
<p><a href="http://www.entropyspecialists.com/blog/wp-content/uploads/2011/10/BizTalk.docx">Generating BizTalk Messages from Dynamics CRM</a></p>
<p><em>Otherwise, here&#8217;s the quick copy/paste version. Enjoy.</em></p>
<p><strong><span style="text-decoration: underline;">BizTalk – Generating Outbound Messages from Dynamics CRM</span></strong></p>
<p><em>[Author’s Note]: Please don’t judge me solely on the quality of this particular post. I’m trying to help someone out by posting this, and as a result I am rushing it far too quickly.</em></p>
<p>There are several ways you could approach this process, and depending on the requirements, your mileage may vary. In this particular post I’d like to outline one method I have found effective, which is to leverage CRM plugins to do the heavy lifting, and utilize BizTalk purely as a message routing mechanism via receive &amp; send ports. If I were a ‘full-time’ BizTalk expert, it’s entirely likely I would be more comfortable letting more of the logic reside inside BizTalk (complex mappings, orchestrations, etc.) but I have found personally it is far easier FOR ME to keep the BizTalk side very simple and straightforward using simplified custom schemas and routing mechanisms in BizTalk, and leverage .NET to populate the BizTalk-compliant schema objects inside of CRM.</p>
<p><em>This example is based on a 4.0 implementation so any code snippets you see may not be up-to-date for CRM 2011, but the concepts are exactly the same.</em></p>
<ol>
<li>Utilize your existing (or new) custom BizTalk schemas</li>
</ol>
<p>In your BizTalk project, you will have various schemas (.xsd) that you want to populate from CRM. For this example consider two schemas in our BizTalk project/application that we want to populate and send to BizTalk from CRM plugins – Account and Contact. These custom schemas containing the general fields we are interested in, with whatever data types we choose (irrelevant of CRM, we will have to translate/map them as necessary later in the plugin), are built/defined within a BizTalk project and are deployed to our chosen BizTalk application (beyond the scope of this example)</p>
<p>&nbsp;</p>
<ol>
<li>Define the plugin component</li>
</ol>
<p>The next thing we will do is create a ‘BizTalk Plugin’ that will do all the heavy lifting of populating and sending our BizTalk messages, and use our source control provider of choice to ‘share’ the schemas that we want to expose in the plugin from the BizTalk project. This will give us the hook to be able to refresh our plugin if the BizTalk Schema changes.</p>
<p>So, under our BizTalk Plugin source code, we might have a folder structure something like below:</p>
<p>&nbsp;</p>
<p><strong>SchemaBuilders</strong>: This is the set of classes containing logic that handles the population of the schema classes from CRM data. Each BizTalk schema you generate a class file for will have a corresponding ‘SchemaBuilder’ responsible for populating that schema with CRM data properly when passed the entity context. The schema builders leverage the generated schema classes by mapping and assigning properties from the entity context and returning a ‘populated’ schema class to be sent to BizTalk.</p>
<p>Here is a snippet of the kind of code that would be inside the schema builder’s primary method ‘BuildSchemaObject’:</p>
<p>//name fields</p>
<p>&nbsp;</p>
<p>//Salutation</p>
<p>contactSchema.Contact_Detail.Name_Complete.Name_Salutation = contact[‘salutation’];</p>
<p>&nbsp;</p>
<p>//first name</p>
<p>contactSchema.Contact_Detail.Name_Complete.First_Name = contact[‘firstname’];</p>
<p>&nbsp;</p>
<p>//last name</p>
<p>contactSchema.Contact_Detail.Name_Complete.Last_Name = contact[‘lastname’];</p>
<p>&nbsp;</p>
<p>Note that the left hand side corresponds to properties in the schema class, and the right hand side represents data in the triggering entity. We are just mapping one to the other.</p>
<p><strong>Schemas: </strong>This folder contains the generated .cs files for each linked .xsd ‘source’ schema from the BizTalk project. In this case you see the BizTalk schemas under ‘SourceFiles/CRM Outbound’ and the generated .cs files CRM_Account.cs and CRM_Contact.cs in the root of ‘Schemas’.</p>
<p><strong>GenerateClasses.bat</strong>:<strong> </strong>This file is a simple batch script that uses xsd.exe to regenerate the .cs files if the schema files change. When the underlying BizTalk project schemas are modified, you need to ‘get latest’ from those shared source schema files in the plugin, then use the batch script to regenerate the .cs files, and make any required logic changes to the logic and schemabuilder files. Each line of the batch script will look something like:</p>
<p>xsd.exe -c -n:CRM.Plugins.Schemas.CRM_Account -l:c# &#8220;CRM Outbound\CRM_Account.xsd&#8221; /outputdir:../</p>
<p>&nbsp;</p>
<p>where CRM.Plugins.Schemas.CRM_Account is the desired namespace of the generated class, c# is the desired language of the class file, ‘CRM Outbound\CRM_Account.xsd’ is the relative path of the schema file, and the parent folder of the batch file location (../) is the desired output location for CRM_Account.cs</p>
<p>&nbsp;</p>
<p><strong>Plugin.cs: </strong>The main body of the plugin now simply implements branching logic to determine what the triggering entity is, and based on the triggering entity, invoke the appropriate schema builder and send the result to biztalk. [In this example, ‘send to Biztalk’ means pushing an XML message into an MSMQ queue that BizTalk has been configured to monitor]</p>
<p>//Based on the entity that is triggering the plugin, we will need to generate different</p>
<p>//BizTalk messages. This switch statement allows us to branch to the appropriate Builder</p>
<p>//based on the triggering entity.</p>
<p>switch (this.EntityName)</p>
<p>    {</p>
<p>        case &#8220;contact&#8221;:</p>
<p>        //Step 1: Contact message</p>
<p>        //create the Schema Object and populate it</p>
<p>        Schemas.CRM_Contact.Contact_Information contactObject = Builder_CRM_Contact.BuildSchemaObject(this,context);</p>
<p>&nbsp;</p>
<p>        sendToBizTalk(BuildSchemaXml(contactObject));</p>
<p>                  …</p>
<p><strong>Helpful Tricks:</strong></p>
<p><em>I borrowed most of these from a series of blogs and trial and error – apologies to anyone I am referencing without attribution, any links I used are long lost to me</em></p>
<ul>
<li>BuildSchemaXml method – BizTalk is extra-picky about namespaces in your xml. As it should be. In order to serialize our populated schema classes properly to put the message in MSMQ, we found the following approach very VERY helpful when turning the schema class into an XML string to be pushed to MSMQ.</li>
</ul>
<p>/// &lt;summary&gt;</p>
<p>/// Handles the serialization of our schema classes to the underlying xml text for transmission to BizTalk</p>
<p>/// We use this to modify a couple of the default behaviors of the schemas with respect to serialization</p>
<p>/// &lt;/summary&gt;</p>
<p>/// &lt;param name=&#8221;schemaObject&#8221;&gt;The populated schema class we wish to serialize&lt;/param&gt;</p>
<p>/// &lt;returns&gt;&lt;/returns&gt;</p>
<p>public string BuildSchemaXml(Object schemaObject)</p>
<p>{</p>
<p>    StringWriter output = new StringWriter(new StringBuilder());</p>
<p>&nbsp;</p>
<p>    //Create our own namespaces for the output</p>
<p>    XmlSerializerNamespaces ns = new XmlSerializerNamespaces();</p>
<p>    //Add an empty namespace and empty value</p>
<p>    ns.Add(&#8220;&#8221;, &#8220;&#8221;);</p>
<p>    //Serialize the object with our own namespaces (notice the overload)</p>
<p>    XmlSerializer serializer = new XmlSerializer(schemaObject.GetType());</p>
<p>&nbsp;</p>
<p>    //we use this to extract some of the header data we don&#8217;t want to be serialized.</p>
<p>    XmlWriter writer = new XmlTextWriterFormattedNoDeclaration(output);</p>
<p>&nbsp;</p>
<p>    serializer.Serialize(writer, schemaObject, ns);</p>
<p>&nbsp;</p>
<p>    return output.ToString();</p>
<p>}</p>
<p>&nbsp;</p>
<ul>
<li>XmlTextWriterFormattedNoDeclaration class: This goes along with the BuildSchemaXml serialization method to suppress all the ‘stuff’ that typically gets written into the serialized xml and helps the schemas be recognizable to BizTalk.</li>
</ul>
<p>    /// &lt;summary&gt;</p>
<p>    /// This is a special custom override class to assist with the formatting of the serialized xml going to BizTalk</p>
<p>    /// Specifically, to eliminate header/namespace overhead in the message body.</p>
<p>    /// &lt;/summary&gt;</p>
<p>    public class XmlTextWriterFormattedNoDeclaration : System.Xml.XmlTextWriter</p>
<p>    {</p>
<p>        /// &lt;summary&gt;</p>
<p>        /// Constructor</p>
<p>        /// &lt;/summary&gt;</p>
<p>        /// &lt;param name=&#8221;w&#8221;&gt;&lt;/param&gt;</p>
<p>        public XmlTextWriterFormattedNoDeclaration(System.IO.TextWriter w)</p>
<p>            : base(w)</p>
<p>        {</p>
<p>            Formatting = System.Xml.Formatting.Indented;</p>
<p>        }</p>
<p>&nbsp;</p>
<p>        /// &lt;summary&gt;</p>
<p>        /// Do Nothing (instead of the default behavior)</p>
<p>        /// &lt;/summary&gt;</p>
<p>        public override void WriteStartDocument() { } // suppress</p>
<p>    }</p>
<p>&nbsp;</p>
<ul>
<li>SendToBizTalk method (MSMQ-based) – this is what pushes the serialized xml generated from our populated schema class into a message and drops it into a monitored MSMQ queue, where BizTalk can now pick it up, see it as a recognized schema, and process it accordingly within BizTalk. Don’t be frightened if you manually look at the message from within the MSMQ queue and the content appears to be a foreign language, that is a side effect of BodyType = 8, but that’s what we had to do in order to make things align.</li>
</ul>
<p>void sendToBizTalk(string serializedXml)</p>
<p>{</p>
<p>   try</p>
<p>   {</p>
<p>       //declare a new message queue object pointing to our configured queue</p>
<p>       MessageQueue crmBTMQ = new MessageQueue(QueuePath);</p>
<p>&nbsp;</p>
<p>       //since we are writing our own message content, we need to use a message</p>
<p>       Message crmXmlMessage = new Message();</p>
<p>&nbsp;</p>
<p>       //to avoid re-formatting our nice xml message, we write directly to the bodystream of the message</p>
<p>       crmXmlMessage.BodyStream = new MemoryStream(Encoding.UTF8.GetBytes(serializedXml));</p>
<p>&nbsp;</p>
<p>       //and tell the message it&#8217;s content is a string</p>
<p>       crmXmlMessage.BodyType = 8;</p>
<p>&nbsp;</p>
<p>       //now send the message to the configured queue where biztalk will soon go and grab it.</p>
<p>       crmBTMQ.Send(crmXmlMessage);</p>
<p>&nbsp;</p>
<p>                …</p>
<p>I know this may seem woefully inadequate, but hopefully it will help point someone in the right direction and avoid some of the issues that we had to work through the first time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entropyspecialists.com/blog/?feed=rss2&#038;p=120</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The longest days&#8230;</title>
		<link>http://www.entropyspecialists.com/blog/?p=116</link>
		<comments>http://www.entropyspecialists.com/blog/?p=116#comments</comments>
		<pubDate>Fri, 02 Sep 2011 02:53:55 +0000</pubDate>
		<dc:creator>BusinessEntropy</dc:creator>
				<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Marketplace]]></category>
		<category><![CDATA[Metadata]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.entropyspecialists.com/blog/?p=116</guid>
		<description><![CDATA[Are spent waiting for mobile application marketplaces to process&#8230; Full disclosure, I submitted an app to the WP7 marketplace that had a fairly glaring bug, that I myself never came across. This is all my own fault at the core. &#8230; <a href="http://www.entropyspecialists.com/blog/?p=116">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.entropyspecialists.com/blog/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>Are spent waiting for mobile application marketplaces to process&#8230;</p>
<p>Full disclosure, I submitted an app to the WP7 marketplace that had a fairly glaring bug, that I myself never came across. This is all my own fault at the core.</p>
<p>So I noticed today that I have negative ratings piling up due to said bug, and can&#8217;t do anything about it because there is a whole submission process that takes a few days to clear. I decide to try to change the metadata to at least tell potential new users that it&#8217;s being worked on and how to workaround the issue&#8230;but there is a &#8216;mini-approval&#8217; process for even the metadata change. DOH.</p>
<p>So now I have FIXED said bug, but I can&#8217;t submit the actual update to the application (which will take a few days to process) until my METADATA update gets approved!</p>
<p>Honestly, it&#8217;s not that big a deal, but I wish there could be more real-time editing of metadata (app description, etc) &#8211; but I can also accept that someone has to review it&#8230;maybe they could implement some kind of random peer review for pure metadata changes.</p>
<p>Score one for Android, where I can modify both metadata AND deploy new versions of the application INSTANTLY. I have become a spoiled mobile developer due to their instant gratification.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entropyspecialists.com/blog/?feed=rss2&#038;p=116</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
