<?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>Ryan on Rails</title>
	<atom:link href="http://www.ryanonrails.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ryanonrails.com</link>
	<description>Microsoft Dynamics CRM Developer, Ruby on Rails Enthusiast, COBOL Extraordinaire!</description>
	<lastBuildDate>Fri, 18 May 2012 16:25:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>IIS 7.5 and batman.js &#8211; .coffee not found</title>
		<link>http://www.ryanonrails.com/2012/05/18/iis-7-5-and-batman-js-coffee-not-found/</link>
		<comments>http://www.ryanonrails.com/2012/05/18/iis-7-5-and-batman-js-coffee-not-found/#comments</comments>
		<pubDate>Fri, 18 May 2012 16:25:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.ryanonrails.com/?p=985</guid>
		<description><![CDATA[If you&#8217;re trying to get batman.js trying to run within visual studio &#038; IIS 7.5 you&#8217;re going to run into some issues serving up coffeescript files to batman. The error might look something like this: Failed to load resource: the server responded with a status of 404 (Not Found) From what I understand, IIS doesn&#8217;t ]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re trying to get batman.js trying to run within visual studio &#038; IIS 7.5 you&#8217;re going to run into some issues serving up coffeescript files to batman. </p>
<blockquote><p>
The error might look something like this:<br />
<span style="color: red;"><br />
Failed to load resource: the server responded with a status of 404 (Not Found)<br />
</span>
</p></blockquote>
<p>From what I understand, IIS doesn&#8217;t know what type of MIME type coffeescript is, so it doesn&#8217;t serve it out, here&#8217;s what you need in your web.config for it to work properly (put in my whole web.config):</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.web<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compilation</span> <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">targetFramework</span>=<span style="color: #ff0000;">&quot;4.0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.web<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.webServer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;httpErrors</span> <span style="color: #000066;">errorMode</span>=<span style="color: #ff0000;">&quot;Detailed&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;staticContent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mimeMap</span> <span style="color: #000066;">fileExtension</span>=<span style="color: #ff0000;">&quot;.coffee&quot;</span> <span style="color: #000066;">mimeType</span>=<span style="color: #ff0000;">&quot;coffeescript&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/staticContent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.webServer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>I gleaned some information from <a href="http://stackoverflow.com/questions/9760034/what-causes-a-404-4-on-iis-7-5-for-delivering-a-static-file" title="this SO article">this SO article</a>.</p>
<p>Thanks,<br />
Ry</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.ryanonrails.com/2012/05/18/iis-7-5-and-batman-js-coffee-not-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic migration was not applied because it would result in data loss.</title>
		<link>http://www.ryanonrails.com/2012/05/10/automatic-migration-was-not-applied-because-it-would-result-in-data-loss/</link>
		<comments>http://www.ryanonrails.com/2012/05/10/automatic-migration-was-not-applied-because-it-would-result-in-data-loss/#comments</comments>
		<pubDate>Thu, 10 May 2012 16:27:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Microsoft / CRM / SharePoint / SSRS]]></category>

		<guid isPermaLink="false">http://www.ryanonrails.com/?p=972</guid>
		<description><![CDATA[I&#8217;ve just started using EntityFramework.Migrations and came accross this error: No pending explicit migrations. Applying automatic migration: 201205101614472_AutomaticMigration. Automatic migration was not applied because it would result in data loss. It&#8217;s because my migrations would&#8217;ve nuked some of my data. I&#8217;m okay with that though, you just need to throw on the -Force tag to ]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just started using EntityFramework.Migrations and came accross this error:</p>
<blockquote><p>No pending explicit migrations.<br />
Applying automatic migration: 201205101614472_AutomaticMigration.<br />
<span style="color: red;"><br />
Automatic migration was not applied because it would result in data loss.</p></blockquote>
<p></span><br />
It&#8217;s because my migrations would&#8217;ve nuked some of my data. I&#8217;m okay with that though, you just need to throw on the -Force tag to get it to complete the migration:</p>
<blockquote><p>
Update-Database -Verbose -Force
</p></blockquote>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.ryanonrails.com/2012/05/10/automatic-migration-was-not-applied-because-it-would-result-in-data-loss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby + Rails Stops Responding on Windows</title>
		<link>http://www.ryanonrails.com/2012/04/23/ruby-rails-stops-respondin/</link>
		<comments>http://www.ryanonrails.com/2012/04/23/ruby-rails-stops-respondin/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 23:56:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.ryanonrails.com/?p=949</guid>
		<description><![CDATA[A friend ran into a bug that I had already conquered. I figure that if we both have the issue, other people might also. Randomly, Rails (Ruby) will just crash. Most of the time it happened while the assets are being served. After some research I was able to figure out that there was a ]]></description>
			<content:encoded><![CDATA[<p>A friend ran into a bug that I had already conquered. I figure that if we both have the issue, other people might also.</p>
<p>Randomly, Rails (Ruby) will just crash. Most of the time it happened while the assets are being served. After some research I was able to figure out that there was a ton of lines being written to the log file. It turns out that there&#8217;s some weird bug, either with WEBrick or Ruby itself that ends up crashing the server when writing information to the log file.</p>
<p>You can disable logging, but that&#8217;s a pretty big hindrance. My solution was to install thin server (which is very similar to WEBrick but lightweight.</p>
<p>Here&#8217;s what you&#8217;re going to have to do:</p>
<p>Update your gemfile:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">group <span style="color:#ff3333; font-weight:bold;">:development</span>, <span style="color:#ff3333; font-weight:bold;">:test</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  gem <span style="color:#996600;">'eventmachine'</span>, <span style="color:#996600;">'1.0.0.beta.4.1'</span>, <span style="color:#ff3333; font-weight:bold;">:platforms</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:mswin</span>, <span style="color:#ff3333; font-weight:bold;">:mingw</span><span style="color:#006600; font-weight:bold;">&#93;</span>
  gem <span style="color:#996600;">'thin'</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>There&#8217;s tons of issues with event machine installing on windows, so make sure you&#8217;re using that exact version above. Run <strong>bundle install</strong>. And instead of running &#8220;rails s&#8221;, run &#8220;<strong>thin start</strong>&#8221; to get your server running.</p>
<p>The worst part about this bug is that it can easily take you down a rabbit hole. Your error might be on a jquery line, or a css line (whatever asset is being served up). Some of the key things that I do know:</p>
<p>This happens with Ruby 1.9.2<br />
This happens with Rails > 3.0 (which makes me think it&#8217;s more a Ruby issue)</p>
<p>Windows will produce these errors (hard crash of Ruby):<br />
Ruby Interpreter (CUI) 1.9.2p290 [i386-mingw32] has stopped working<br />
Ruby Interpreter (CUI) 1.9.2p320 [i386-mingw32] has stopped working</p>
<p><strong>***Update</strong> I&#8217;m running Ruby 1.9.3p125 and haven&#8217;t hit this issue yet using WEBrick. This might be an alternative solution instead of using thin server.</p>
<p><strong>***Update</strong> If you&#8217;re working with people using Linux/Mac, something like this might be more suitable. It will ignore these if you&#8217;re not on Windows:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># le windows</span>
platforms <span style="color:#ff3333; font-weight:bold;">:mswin</span>, <span style="color:#ff3333; font-weight:bold;">:mingw</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  gem <span style="color:#996600;">'eventmachine'</span>, <span style="color:#996600;">'1.0.0.beta.4.1'</span>
  gem <span style="color:#996600;">'thin'</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Thanks,<br />
Ry</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.ryanonrails.com/2012/04/23/ruby-rails-stops-respondin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eco (Embedded Coffee Script) Error &#8211; Unexpected dedent</title>
		<link>http://www.ryanonrails.com/2012/01/29/eco-embedded-coffee-script-error-unexpected-dedent/</link>
		<comments>http://www.ryanonrails.com/2012/01/29/eco-embedded-coffee-script-error-unexpected-dedent/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 20:39:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.ryanonrails.com/?p=943</guid>
		<description><![CDATA[Ran into this error when testing out eco (Embedded Coffee Script) templates. Parse error on line #: unexpected dedent (in c:/project/app/assets/javascripts/backbone/templates/dartboard.jst.eco) Broken code: &#60;% if 7 &#62; 3 %&#62; teststring &#60;% end %&#62; Fixed Code: &#60;% if 7 &#62; 3: %&#62; teststring &#60;% end %&#62; Notice the colon, this is telling coffeescript that the next ]]></description>
			<content:encoded><![CDATA[<p>Ran into this error when testing out eco (Embedded Coffee Script) templates.</p>
<p>Parse error on line #: unexpected dedent<br />
  (in c:/project/app/assets/javascripts/backbone/templates/dartboard.jst.eco)</p>
<p>Broken code:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006666;">7</span> <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">3</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
  teststring
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></div></div>

<p>Fixed Code:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006666;">7</span> <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006666;">3</span>: <span style="color:#006600; font-weight:bold;">%&gt;</span>
  teststring
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></div></div>

<p>Notice the colon, this is telling coffeescript that the next line is indented. It&#8217;s document here: <a href="https://github.com/sstephenson/eco" title="https://github.com/sstephenson/eco">https://github.com/sstephenson/eco</a> it had just slipped my mind.</p>
<p>Ry</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.ryanonrails.com/2012/01/29/eco-embedded-coffee-script-error-unexpected-dedent/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Birth Control Reminder Text (SMS) Free &#8211; Alertzy.com &#8211; Canada &amp; USA</title>
		<link>http://www.ryanonrails.com/2011/11/12/birth-control-reminder-text-sms-free-alertzy-com-canada-usa/</link>
		<comments>http://www.ryanonrails.com/2011/11/12/birth-control-reminder-text-sms-free-alertzy-com-canada-usa/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 17:45:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Alertzy]]></category>

		<guid isPermaLink="false">http://www.ryanonrails.com/?p=936</guid>
		<description><![CDATA[Hey Everyone, I just finished adding a birth control reminder to www.Alertzy.com! It was an interesting addition since I don&#8217;t have any &#8220;business knowledge&#8221; on how the whole birth control system works. Here&#8217;s how it&#8217;s broken down: There&#8217;s 2 types of birth control, 21 day and 28 day. The 28 day puts a &#8220;spacer&#8221; for ]]></description>
			<content:encoded><![CDATA[<p>Hey Everyone,</p>
<p>I just finished adding a birth control reminder to <a href="http://www.Alertzy.com">www.Alertzy.com</a>! It was an interesting addition since I don&#8217;t have any &#8220;business knowledge&#8221; on how the whole birth control system works.</p>
<p>Here&#8217;s how it&#8217;s broken down:<br />
There&#8217;s 2 types of birth control, 21 day and 28 day. The 28 day puts a &#8220;spacer&#8221; for 7 days (a sugar pill) after the first 21 days. I really wanted to be able to allow both (rather then sending a message every single day). So I set it up that the 21 day reminder to put a 7 day gap (with no text(SMS)) at the end.</p>
<p>Why did I choose birth control for Alertzy? Alertzy&#8217;s &#8220;motto&#8221; is reminders for data that CHANGES. Anything that could be easily punched into a calendar, you won&#8217;t see on Alertzy. There&#8217;s 2 levels of complexity when taking birth control, reminders, and which cycle day you&#8217;re on.</p>
<p>The 28 day reminder part is simple (and could be easily punch into a calendar), however Alertzy also includes the pill #. This seems to be a large difference when compared to other competitors. With Alertzy you don&#8217;t need to turn a dial on a birth control system, and you always know which pill you&#8217;re on for that day. </p>
<p>The 21 day reminder has a large advantage over the competitors also. Not only would it be a huge pain to punch into a phone, it also gives you 7 day grace period at the end of your 21 days. After the 7 days you&#8217;ll start back at cycle #1 and not have to worry about tracking which day to take it.</p>
<p>Hopefully that explains why we chose to have a birth control reminder. Remember that Alertzy&#8217;s birth control reminder is a free service, phone independent, and available in Canada and the United States!</p>
<p>Thanks,<br />
Ryan</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.ryanonrails.com/2011/11/12/birth-control-reminder-text-sms-free-alertzy-com-canada-usa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Upgrade 3200 Error when upgrading to iOS5</title>
		<link>http://www.ryanonrails.com/2011/10/13/iphone-upgrade-3200-error-when-upgrading-to-ios5/</link>
		<comments>http://www.ryanonrails.com/2011/10/13/iphone-upgrade-3200-error-when-upgrading-to-ios5/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 20:43:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://www.ryanonrails.com/?p=932</guid>
		<description><![CDATA[If you get this error just make sure to keep trying to update. It WILL eventually go through. It took me 4 times of trying to update for it to go through]]></description>
			<content:encoded><![CDATA[<p>If you get this error just make sure to keep trying to update. It WILL eventually go through. It took me 4 times of trying to update for it to go through.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.ryanonrails.com/2011/10/13/iphone-upgrade-3200-error-when-upgrading-to-ios5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Sharepoint 2010 SOAP/Web Client &#8211; C#</title>
		<link>http://www.ryanonrails.com/2011/10/11/using-sharepoint-2010-soapweb-client-c/</link>
		<comments>http://www.ryanonrails.com/2011/10/11/using-sharepoint-2010-soapweb-client-c/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 18:26:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Microsoft / CRM / SharePoint / SSRS]]></category>

		<guid isPermaLink="false">http://www.ryanonrails.com/?p=880</guid>
		<description><![CDATA[I&#8217;ve been meaning to post this for a while since I had some annoying issues with CAML and Sharepoint 2010. Here&#8217;s the structure I&#8217;m using: I&#8217;ve had to do quite a few things with the Sharepoint 2010 web services and web client object. I figured I should post some solutions as quite a few of ]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to post this for a while since I had some annoying issues with CAML and Sharepoint 2010. Here&#8217;s the structure I&#8217;m using:</p>
<p><a href="http://www.ryanonrails.com/wp-content/uploads/2011/09/sp2010_structure.bmp"><img src="http://www.ryanonrails.com/wp-content/uploads/2011/09/sp2010_structure.bmp" alt="" title="sp2010_structure" class="aligncenter size-full wp-image-882" /></a></p>
<p>I&#8217;ve had to do quite a few things with the Sharepoint 2010 web services and web client object. I figured I should post some solutions as quite a few of these are undocumented. My goal was not to have to import the SP Library and just use the web services along with the basic GET PUT methods of the WebClient.</p>
<p>Create a Folder with SharePoint 2010 via SOAP Web Services – UpdateListItems<br />
<a href="http://www.ryanonrails.com/2011/10/11/create-a-folder-with-sharepoint-2010-via-soap-web-services-updatelistitems/" title="http://www.ryanonrails.com/2011/10/11/create-a-folder-with-sharepoint-2010-via-soap-web-services-updatelistitems/">http://www.ryanonrails.com/2011/10/11/create-a-folder-with-sharepoint-2010-via-soap-web-services-updatelistitems/</a></p>
<p>Upload a document to Sharepoint 2010 via WebClient<br />
<a href="http://www.ryanonrails.com/2011/09/17/upload-a-document-to-sharepoint-2010-via-webclient/" title="http://www.ryanonrails.com/2011/09/17/upload-a-document-to-sharepoint-2010-via-webclient/">http://www.ryanonrails.com/2011/09/17/upload-a-document-to-sharepoint-2010-via-webclient/</a></p>
<p>Retrieve document ID from SharePoint 2010 via SOAP Web Services – GetListItems<br />
<a href="http://www.ryanonrails.com/2011/08/30/retrieve-document-id-from-sharepoint-2010-via-soap-web-services-getlistitems/" title="http://www.ryanonrails.com/2011/08/30/retrieve-document-id-from-sharepoint-2010-via-soap-web-services-getlistitems/">http://www.ryanonrails.com/2011/08/30/retrieve-document-id-from-sharepoint-2010-via-soap-web-services-getlistitems/</a></p>
<p>Update Custom Columns from SharePoint 2010 via SOAP Web Services – UpdateListItems<br />
<a href="http://www.ryanonrails.com/2011/08/30/update-custom-columns-from-sharepoint-2010-via-soap-web-services-updatelistitems/" title="http://www.ryanonrails.com/2011/08/30/update-custom-columns-from-sharepoint-2010-via-soap-web-services-updatelistitems/">http://www.ryanonrails.com/2011/08/30/update-custom-columns-from-sharepoint-2010-via-soap-web-services-updatelistitems/</a></p>
<p>Check in a file into SharePoint 2010 via SOAP Web Services – CheckInFile<br />
<a href="http://www.ryanonrails.com/2011/08/30/check-in-a-file-into-sharepoint-2010-via-soap-web-services-%E2%80%93-checkinfile/" title="http://www.ryanonrails.com/2011/08/30/check-in-a-file-into-sharepoint-2010-via-soap-web-services-%E2%80%93-checkinfile/">http://www.ryanonrails.com/2011/08/30/check-in-a-file-into-sharepoint-2010-via-soap-web-services-%E2%80%93-checkinfile/</a></p>
<p>Delete document from SharePoint 2010 via SOAP Web Services – UpdateListItems<br />
<a href="http://www.ryanonrails.com/2011/08/30/delete-document-from-sharepoint-2010-via-soap-web-services-updatelistitems/" title="http://www.ryanonrails.com/2011/08/30/delete-document-from-sharepoint-2010-via-soap-web-services-updatelistitems/">http://www.ryanonrails.com/2011/08/30/delete-document-from-sharepoint-2010-via-soap-web-services-updatelistitems/</a></p>
<p>Download a document from Sharepoint 2010 via WebClient<br />
<a href="http://www.ryanonrails.com/2011/10/11/download-a-document-from-sharepoint-2010-via-webclient/" title="http://www.ryanonrails.com/2011/10/11/download-a-document-from-sharepoint-2010-via-webclient/">http://www.ryanonrails.com/2011/10/11/download-a-document-from-sharepoint-2010-via-webclient/</a></p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.ryanonrails.com/2011/10/11/using-sharepoint-2010-soapweb-client-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download a document from Sharepoint 2010 via WebClient</title>
		<link>http://www.ryanonrails.com/2011/10/11/download-a-document-from-sharepoint-2010-via-webclient/</link>
		<comments>http://www.ryanonrails.com/2011/10/11/download-a-document-from-sharepoint-2010-via-webclient/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 18:20:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Microsoft / CRM / SharePoint / SSRS]]></category>

		<guid isPermaLink="false">http://www.ryanonrails.com/?p=892</guid>
		<description><![CDATA[Here&#8217;s how I use the WebClient object to download a pdf from Sharepoint 2010: string uri = &#34;wwww.google.ca&#34;; string filepath = &#34;waffles.pdf&#34;; &#160; WebClient wc = new WebClient&#40;&#41;; wc.Credentials = loginCredentials; byte&#91;&#93; generatedPdf = wc.DownloadData&#40;uri + &#34;/&#34; + filePath&#]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how I use the WebClient object to download a pdf from Sharepoint 2010:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #6666cc; font-weight: bold;">string</span> uri <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;wwww.google.ca&quot;</span><span style="color: #008000;">;</span>
<span style="color: #6666cc; font-weight: bold;">string</span> filepath <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;waffles.pdf&quot;</span><span style="color: #008000;">;</span>
&nbsp;
WebClient wc <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WebClient<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
wc<span style="color: #008000;">.</span><span style="color: #0000FF;">Credentials</span> <span style="color: #008000;">=</span> loginCredentials<span style="color: #008000;">;</span>
<span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> generatedPdf <span style="color: #008000;">=</span> wc<span style="color: #008000;">.</span><span style="color: #0000FF;">DownloadData</span><span style="color: #008000;">&#40;</span>uri <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;/&quot;</span> <span style="color: #008000;">+</span> filePath<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.ryanonrails.com/2011/10/11/download-a-document-from-sharepoint-2010-via-webclient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a Folder with SharePoint 2010 via SOAP Web Services &#8211; UpdateListItems</title>
		<link>http://www.ryanonrails.com/2011/10/11/create-a-folder-with-sharepoint-2010-via-soap-web-services-updatelistitems/</link>
		<comments>http://www.ryanonrails.com/2011/10/11/create-a-folder-with-sharepoint-2010-via-soap-web-services-updatelistitems/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 18:09:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Microsoft / CRM / SharePoint / SSRS]]></category>

		<guid isPermaLink="false">http://www.ryanonrails.com/?p=856</guid>
		<description><![CDATA[Here&#8217;s a call to SharePoint 2010 for creating a folder. Note the RootFolder. // Build the CAML Query System.Text.StringBuilder oSb = new System.Text.StringBuilder&#40;&#41;; oSb.Append&#40;&#34; &#60;Batch OnError=\&#34;Continue\&#34; RootFolder=\&#34;\&#34; &#62;&#34;&#41;; oSb.Append&#40;&#34; &#60;Method ID=\&#34;1\&#34; Cmd=\&#34;New\&#34;&#62;&#34;&#41;; oSb.Append&#40;&#34; &#60;Field Name=\&#34;ID\&#34;&#62;New&#60;/Field&#62; &#34;&#41;; oSb.Append&#40;&#34; &#60;Field Name=\&#34;FSObjType\&#34;&#62;1&#60;/Field&#62; &#34;&#41;; // 1 = folder, 0 = document oSb.Append&#40;&#34; &#60;Field Name=\&#34;BaseName\&#34;&#62;&#34; + folderName + &#34;&#60;/Field&#62; &#34;&#41;; ]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a call to SharePoint 2010 for creating a folder. Note the RootFolder.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// Build the CAML Query</span>
<span style="color: #000000;">System.<span style="color: #0000FF;">Text</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">StringBuilder</span> oSb <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> <span style="color: #000000;">System.<span style="color: #0000FF;">Text</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">StringBuilder</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
oSb<span style="color: #008000;">.</span><span style="color: #0000FF;">Append</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;     &lt;Batch OnError=<span style="color: #008080; font-weight: bold;">\&quot;</span>Continue<span style="color: #008080; font-weight: bold;">\&quot;</span> RootFolder=<span style="color: #008080; font-weight: bold;">\&quot;</span><span style="color: #008080; font-weight: bold;">\&quot;</span> &gt;&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
oSb<span style="color: #008000;">.</span><span style="color: #0000FF;">Append</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;         &lt;Method ID=<span style="color: #008080; font-weight: bold;">\&quot;</span>1<span style="color: #008080; font-weight: bold;">\&quot;</span> Cmd=<span style="color: #008080; font-weight: bold;">\&quot;</span>New<span style="color: #008080; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
oSb<span style="color: #008000;">.</span><span style="color: #0000FF;">Append</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;             &lt;Field Name=<span style="color: #008080; font-weight: bold;">\&quot;</span>ID<span style="color: #008080; font-weight: bold;">\&quot;</span>&gt;New&lt;/Field&gt; &quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
oSb<span style="color: #008000;">.</span><span style="color: #0000FF;">Append</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;             &lt;Field Name=<span style="color: #008080; font-weight: bold;">\&quot;</span>FSObjType<span style="color: #008080; font-weight: bold;">\&quot;</span>&gt;1&lt;/Field&gt; &quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// 1 = folder, 0 = document</span>
oSb<span style="color: #008000;">.</span><span style="color: #0000FF;">Append</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;             &lt;Field Name=<span style="color: #008080; font-weight: bold;">\&quot;</span>BaseName<span style="color: #008080; font-weight: bold;">\&quot;</span>&gt;&quot;</span> <span style="color: #008000;">+</span> folderName <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;&lt;/Field&gt; &quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
oSb<span style="color: #008000;">.</span><span style="color: #0000FF;">Append</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;        &lt;/Method&gt;&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
oSb<span style="color: #008000;">.</span><span style="color: #0000FF;">Append</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;    &lt;/Batch&gt;&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #6666cc; font-weight: bold;">string</span> sResult <span style="color: #008000;">=</span> oSb<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
XmlDocument CAMLqueryXML <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> XmlDocument<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
CAMLqueryXML<span style="color: #008000;">.</span><span style="color: #0000FF;">LoadXml</span><span style="color: #008000;">&#40;</span>sResult<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// Execute UpdateListItems</span>
<span style="color: #000000;">System.<span style="color: #0000FF;">Xml</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">XmlNode</span> result <span style="color: #008000;">=</span> lists<span style="color: #008000;">.</span><span style="color: #0000FF;">UpdateListItems</span><span style="color: #008000;">&#40;</span>SPLibraryName, CAMLqueryXML<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.ryanonrails.com/2011/10/11/create-a-folder-with-sharepoint-2010-via-soap-web-services-updatelistitems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload a document to Sharepoint 2010 via WebClient</title>
		<link>http://www.ryanonrails.com/2011/09/17/upload-a-document-to-sharepoint-2010-via-webclient/</link>
		<comments>http://www.ryanonrails.com/2011/09/17/upload-a-document-to-sharepoint-2010-via-webclient/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 20:42:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Microsoft / CRM / SharePoint / SSRS]]></category>

		<guid isPermaLink="false">http://www.ryanonrails.com/?p=885</guid>
		<description><![CDATA[Here&#8217;s some code on how to upload a document into Sharepoint 2010. This works accross domains: WebClient wc = new WebClient&#40;&#41;; wc.Credentials = loginCredentials; wc.UploadData&#40;destinationUrl, &#34;PUT&#34;, fileData&#41;; A big FYI. The Copy.asmx web service will NOT work across domains. Using the above method will work for all occasions (of course the only issue is that ]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s some code on how to upload a document into Sharepoint 2010. This works accross domains:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">WebClient wc <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WebClient<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
wc<span style="color: #008000;">.</span><span style="color: #0000FF;">Credentials</span> <span style="color: #008000;">=</span> loginCredentials<span style="color: #008000;">;</span>
wc<span style="color: #008000;">.</span><span style="color: #0000FF;">UploadData</span><span style="color: #008000;">&#40;</span>destinationUrl, <span style="color: #666666;">&quot;PUT&quot;</span>, fileData<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>A big FYI. The Copy.asmx web service will <strong>NOT</strong> work across domains. Using the above method will work for all occasions (of course the only issue is that you need to update the columns in a separate call.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.ryanonrails.com/2011/09/17/upload-a-document-to-sharepoint-2010-via-webclient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

