<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Andrew Hay - SharePoint</title>
    <link>http://www.a7drew.com/blog/</link>
    <description>Thinking way too long about the subtitle</description>
    <language>en-us</language>
    <copyright>Andrew Hay</copyright>
    <lastBuildDate>Sat, 10 Nov 2007 06:03:14 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.12105.0</generator>
    <managingEditor>andrewcameronhay@hotmail.com</managingEditor>
    <webMaster>andrewcameronhay@hotmail.com</webMaster>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=e723c2e5-fc82-48cf-b437-b9f34781df0e</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,e723c2e5-fc82-48cf-b437-b9f34781df0e.aspx</pingback:target>
      <dc:creator>Andrew Hay</dc:creator>
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,e723c2e5-fc82-48cf-b437-b9f34781df0e.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e723c2e5-fc82-48cf-b437-b9f34781df0e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was working with a web service client that talked to SharePoint this week. I wrote
a quick Silverlight app that extracted a list of tasks out of a SharePoint list. I
love how simple this is to tap into:
</p>
        <p>
          <code>
            <a href="http://sharepoint.yourcompany.com/_vti_bin/lists.asmx">http://sharepoint.yourcompany.com/_vti_bin/lists.asmx</a>
          </code>
        </p>
        <p>
The previous URL will show the path to one of the web services provided out-of-the-box
by SharePoint. This particular web service provides several methods for dealing with
SharePoint lists. I just needed to call the GetListItems() method and pass in the
list name and view name as parameters in order to get my data.
</p>
        <p>
This worked fine on my local machine, but when I migrated the solution to a staging
server, the SharePoint web service refused to send me the data. After a bit of finagling,
I realized the web service was happy to talk to my laptop, but it politely declined
the remote web server's request as I lacked the proper credentials. I even was running
the web solution with impersonation enabled because I wanted to pass along my Windows
credentials during the call from the web server to the remote SharePoint server. I
forgot that this is just simply not possible. 
</p>
        <p>
For security reasons, the web server does not hold on to my credentials "just
in case" I might want to use them later. In this scenario, I do need them - but
no dice. This particular list in SharePoint is locked down tight.
</p>
        <p>
I didn't have the proper credentials when my web service client fired off a request
to SharePoint. When I was running on my local machine, using Casinni, my credentials
were readily available. On a remote web server, the credentials vanish. This is called
a "Double Hop" problem - the hops are from the browser, to the web server,
to another remote web server. The second hop tanked. It was a silly mistake on my
part, but hopefully by writing this down now will help me remember sooner next time.
</p>
        <p>
The code below shows how I solve this problem by manufacturing a credential on-the-fly
and then fire off a request to SharePoint. There are multiple ways of solving this
problem; I just happened to chose this one.
</p>
        <div style="padding-right: 0px; padding-left: 0px; background: #eee; padding-bottom: 20px; padding-top: 20px">
          <pre>         MySharePoint.Lists list = new ProjectBoard.MySharePoint.Lists();</pre>
          <pre> </pre>
          <pre>         list.Credentials = new System.Net.NetworkCredential(</pre>
          <pre>            ConfigurationManager.AppSettings["Credential.Username"],</pre>
          <pre>            ConfigurationManager.AppSettings["Credential.Password"],</pre>
          <pre>            ConfigurationManager.AppSettings["Credential.Domain"]);</pre>
          <pre> </pre>
          <pre>         XmlNode listItemsNode = list.GetListItems(</pre>
          <pre>            ConfigurationManager.AppSettings["LoremIpsum.Guid"], </pre>
          <pre>            ConfigurationManager.AppSettings["LoremIpsum.View.Guid"], </pre>
          <pre>            null, null, "100", null, null);</pre>
          <pre> </pre>
          <pre>         XmlNode dataNode = listItemsNode.ChildNodes[1];</pre>
          <pre> </pre>
          <pre>         foreach (XmlNode rowNode in dataNode.ChildNodes)</pre>
          <pre>         {</pre>
          <pre>           // extract values here</pre>
          <pre>         }</pre>
        </div>
        <p>
Now that I've got this little prototype functional, I can encrypt the credentials
in the web.config file by using <a href="http://msdn2.microsoft.com/en-us/library/ms998280.aspx" target="_blank">DPAPI</a>,
an encryption tool that makes it easy to protect sensitive information. Since I'm
creating new credentials here, I can avoid the Double Hop problem and get on with
my prototype.
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=e723c2e5-fc82-48cf-b437-b9f34781df0e" />
      </body>
      <title>Double Hop Disaster</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,e723c2e5-fc82-48cf-b437-b9f34781df0e.aspx</guid>
      <link>http://www.a7drew.com/blog/2007/11/10/DoubleHopDisaster.aspx</link>
      <pubDate>Sat, 10 Nov 2007 06:03:14 GMT</pubDate>
      <description>&lt;p&gt;
I was working with a web service client that talked to SharePoint this week. I wrote
a quick Silverlight app that extracted a list of tasks out of a SharePoint list. I
love how simple this is to tap into:
&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href="http://sharepoint.yourcompany.com/_vti_bin/lists.asmx"&gt;http://sharepoint.yourcompany.com/_vti_bin/lists.asmx&lt;/a&gt;&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
The previous URL will show the path to one of the web services provided out-of-the-box
by SharePoint. This particular web service provides several methods for dealing with
SharePoint lists. I just needed to call the GetListItems() method and pass in the
list name and view name as parameters in order to get my data.
&lt;/p&gt;
&lt;p&gt;
This worked fine on my local machine, but when I migrated the solution to a staging
server, the SharePoint web service refused to send me the data. After a bit of finagling,
I realized the web service was happy to talk to my laptop, but it politely declined
the remote web server's request as I lacked the proper credentials. I even was running
the web solution with impersonation enabled because I wanted to pass along my Windows
credentials during the call from the web server to the remote SharePoint server. I
forgot that this is just simply not possible. 
&lt;/p&gt;
&lt;p&gt;
For security reasons, the web server does not hold on to my credentials &amp;quot;just
in case&amp;quot; I might want to use them later. In this scenario, I do need them - but
no dice. This particular list in SharePoint is locked down tight.
&lt;/p&gt;
&lt;p&gt;
I didn't have the proper credentials when my web service client fired off a request
to SharePoint. When I was running on my local machine, using Casinni, my credentials
were readily available. On a remote web server, the credentials vanish. This is called
a &amp;quot;Double Hop&amp;quot; problem - the hops are from the browser, to the web server,
to another remote web server. The second hop tanked. It was a silly mistake on my
part, but hopefully by writing this down now will help me remember sooner next time.
&lt;/p&gt;
&lt;p&gt;
The code below shows how I solve this problem by manufacturing a credential on-the-fly
and then fire off a request to SharePoint. There are multiple ways of solving this
problem; I just happened to chose this one.
&lt;/p&gt;
&lt;div style="padding-right: 0px; padding-left: 0px; background: #eee; padding-bottom: 20px; padding-top: 20px"&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; MySharePoint.Lists list = new ProjectBoard.MySharePoint.Lists();&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; list.Credentials = new System.Net.NetworkCredential(&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ConfigurationManager.AppSettings[&amp;quot;Credential.Username&amp;quot;],&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ConfigurationManager.AppSettings[&amp;quot;Credential.Password&amp;quot;],&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ConfigurationManager.AppSettings[&amp;quot;Credential.Domain&amp;quot;]);&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; XmlNode listItemsNode = list.GetListItems(&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ConfigurationManager.AppSettings[&amp;quot;LoremIpsum.Guid&amp;quot;], &lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ConfigurationManager.AppSettings[&amp;quot;LoremIpsum.View.Guid&amp;quot;], &lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; null, null, &amp;quot;100&amp;quot;, null, null);&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; XmlNode dataNode = listItemsNode.ChildNodes[1];&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; foreach (XmlNode rowNode in dataNode.ChildNodes)&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; {&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; // extract values here&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Now that I've got this little prototype functional, I can encrypt the credentials
in the web.config file by using &lt;a href="http://msdn2.microsoft.com/en-us/library/ms998280.aspx" target="_blank"&gt;DPAPI&lt;/a&gt;,
an encryption tool that makes it easy to protect sensitive information. Since I'm
creating new credentials here, I can avoid the Double Hop problem and get on with
my prototype.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=e723c2e5-fc82-48cf-b437-b9f34781df0e" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,e723c2e5-fc82-48cf-b437-b9f34781df0e.aspx</comments>
      <category>asp.net</category>
      <category>SharePoint</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=af811a4b-43d3-4bba-b30c-709651c4b473</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,af811a4b-43d3-4bba-b30c-709651c4b473.aspx</pingback:target>
      <dc:creator>Andrew Hay</dc:creator>
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,af811a4b-43d3-4bba-b30c-709651c4b473.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=af811a4b-43d3-4bba-b30c-709651c4b473</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.hedkandi.com" target="_new" atomicselection="true">
            <img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; MARGIN: 0px 10px 10px 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="279" alt="www.hedkandi.com" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/SharePoint2007ContentManagement_14150/hedkandi%5B5%5D.png" width="122" align="left" border="0" />
          </a> Holy
Crap! Here's a site built by MOSS 2007 using their web content management capabilities.
Its called <a href="http://www.hedkandi.com">www.hedkandi.com</a> and at first blush,
its makes use of a very elaborate design to brand the site. I did fire up
the validation service on the homepage only to find an excess of 100 compliance errors;
yet it did look fine in my IE7 browser, so *shrug*.
</p>
        <p>
The site feels almost "too pop" and a little risque for an <a href="http://blogs.msdn.com/ecm/archive/2006/09/30/777819.aspx">MSDN
site</a>; but if you've got a product to sell, I guess you go ahead and sell it, eh?
</p>
        <p>
The flash page transition effect is pretty sweet. The ant-drug ad banner at the top
makes me wonder what kind of site I've stumbled across, given the seemingly stark
contrast with the body content.
</p>
        <p>
At the end of my 3 minute analysis, I don't think the site has decided what it is.
It wants to be sexy &amp; super hip; on the edge of pop. The iPod ads and anti-drug
ads leave a subtle taste of an after school special. *Bleigh* That's so 16 months
ago. The fact that's its built with MOSS 2007 is the coolest thing I can see at this
point.
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=af811a4b-43d3-4bba-b30c-709651c4b473" />
      </body>
      <title>SharePoint 2007 Content Management</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,af811a4b-43d3-4bba-b30c-709651c4b473.aspx</guid>
      <link>http://www.a7drew.com/blog/2006/10/03/SharePoint2007ContentManagement.aspx</link>
      <pubDate>Tue, 03 Oct 2006 05:52:50 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://www.hedkandi.com" target=_new atomicselection="true"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; MARGIN: 0px 10px 10px 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=279 alt=www.hedkandi.com src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/SharePoint2007ContentManagement_14150/hedkandi%5B5%5D.png" width=122 align=left border=0&gt;&lt;/a&gt; Holy
Crap! Here's a site built by MOSS 2007 using their web content management capabilities.
Its called &lt;a href="http://www.hedkandi.com"&gt;www.hedkandi.com&lt;/a&gt; and at first blush,
its makes&amp;nbsp;use of a very&amp;nbsp;elaborate design to brand the site. I did fire up
the validation service on the homepage only to find an excess of 100 compliance errors;
yet&amp;nbsp;it did look fine in my IE7 browser, so *shrug*.
&lt;/p&gt;
&lt;p&gt;
The site feels almost "too pop" and a little risque for an &lt;a href="http://blogs.msdn.com/ecm/archive/2006/09/30/777819.aspx"&gt;MSDN
site&lt;/a&gt;; but if you've got a product to sell, I guess you go ahead and sell it, eh?
&lt;/p&gt;
&lt;p&gt;
The flash page transition effect is pretty sweet. The ant-drug ad banner at the top
makes me wonder what kind of site I've stumbled across, given the seemingly stark
contrast with the body content.
&lt;/p&gt;
&lt;p&gt;
At the end of my 3 minute analysis, I don't think the site has decided what it is.
It wants to be sexy &amp;amp; super hip;&amp;nbsp;on the edge of pop. The iPod ads and anti-drug
ads leave a subtle taste of an after school special. *Bleigh* That's so 16 months
ago. The fact that's its built with MOSS 2007 is the coolest thing I can see at this
point.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=af811a4b-43d3-4bba-b30c-709651c4b473" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,af811a4b-43d3-4bba-b30c-709651c4b473.aspx</comments>
      <category>popart</category>
      <category>SharePoint</category>
    </item>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=00bba46e-e3c8-4600-8274-7956b07cdd09</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,00bba46e-e3c8-4600-8274-7956b07cdd09.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,00bba46e-e3c8-4600-8274-7956b07cdd09.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=00bba46e-e3c8-4600-8274-7956b07cdd09</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just realized today that I learned that trick about <a href="http://andrew.staging.popart.com/2006/07/02/ThankYouKonrad.aspx">overriding
span tags that wrap a custom server control</a> about eight months ago, and probably
another time before that. Is it age, stupidity, or just having to learn an entirely
new technology every couple of years doing this to me?
</p>
        <p>
Back then, I was writing a custom web part for a client's <a href="http://www.microsoft.com/windowsserver2003/technologies/sharepoint/default.mspx">SharePoint</a> installation.
As you may or may not know, writing controls for versions earlier than <a href="http://www.microsoft.com/office/preview/servers/sharepointserver/highlights.mspx">SharePoint
2007</a> can be quite a bear, and these were no exception. That control was emitting
tags that I didn't bake in, and I learned the technique back then too.
</p>
        <p>
Any who, it was sure fun to re-live (and re-learn) that experience all over again. Yay.
</p>
        <p>
Hey, careful with those sparklers. Happy Fourth!
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=00bba46e-e3c8-4600-8274-7956b07cdd09" />
      </body>
      <title>Hey deja vu...did you see that cat?</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,00bba46e-e3c8-4600-8274-7956b07cdd09.aspx</guid>
      <link>http://www.a7drew.com/blog/2006/07/04/HeyDejaVudidYouSeeThatCat.aspx</link>
      <pubDate>Tue, 04 Jul 2006 03:21:10 GMT</pubDate>
      <description>&lt;p&gt;
I just realized today that I learned that trick about &lt;a href="http://andrew.staging.popart.com/2006/07/02/ThankYouKonrad.aspx"&gt;overriding
span tags that wrap a custom server control&lt;/a&gt; about eight months ago, and probably
another time before that. Is it age, stupidity, or just having to learn an entirely
new technology every couple of years doing this to me?
&lt;/p&gt;
&lt;p&gt;
Back then, I was writing a custom web part for a client's &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/sharepoint/default.mspx"&gt;SharePoint&lt;/a&gt;&amp;nbsp;installation.
As you may or may not&amp;nbsp;know,&amp;nbsp;writing controls for versions earlier than &lt;a href="http://www.microsoft.com/office/preview/servers/sharepointserver/highlights.mspx"&gt;SharePoint
2007&lt;/a&gt; can be quite a bear, and these were no exception. That control was emitting
tags that I didn't bake in, and I learned the technique back then too.
&lt;/p&gt;
&lt;p&gt;
Any who, it was sure fun to re-live&amp;nbsp;(and re-learn) that experience all over again.&amp;nbsp;Yay.
&lt;/p&gt;
&lt;p&gt;
Hey, careful with those sparklers. Happy Fourth!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=00bba46e-e3c8-4600-8274-7956b07cdd09" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,00bba46e-e3c8-4600-8274-7956b07cdd09.aspx</comments>
      <category>learning</category>
      <category>SharePoint</category>
    </item>
  </channel>
</rss>