<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Mohammed Jeelani's Blog : SharePoint</title><link>http://blogs.msdn.com/mjeelani/archive/tags/SharePoint/default.aspx</link><description>Tags: SharePoint</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Top 3 Reasons for the "The server instance specified was not found. Please specify the server's address and port." Error</title><link>http://blogs.msdn.com/mjeelani/archive/2005/03/05/385816.aspx</link><pubDate>Sun, 06 Mar 2005 02:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:385816</guid><dc:creator>mjeelani</dc:creator><slash:comments>20</slash:comments><comments>http://blogs.msdn.com/mjeelani/comments/385816.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mjeelani/commentrss.aspx?PostID=385816</wfw:commentRss><description>&lt;p&gt;&lt;font face="Verdana" size="2"&gt;The easiest way to install web parts is probably to use this utility from Microsoft called &lt;strong&gt;&lt;a href="http://download.microsoft.com/download/7/0/c/70ccc7c9-bad4-4d6e-afc7-68a8048367f5/InstallAssemblies.zip"&gt;Install Assemblies&lt;/a&gt;&lt;/strong&gt; - very simple and intuitive interface, takes care of creating the Safe Control entries and even creating DWPs for your web part assemblies. &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;Install Assemblies internally uses STSADM.EXE - more than often you will face the infamous "The server instance specified was not found. Please specify the server's address and port." error. There can be many reasons why you will face this problem, here are top three reasons I've seen in the field either while installing web parts or while using Object Model code -&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt;1) WSS SP1 not installed on all components&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt;Diagnosis:&lt;/strong&gt; Go to SharePoint Central Administration -&amp;gt; Click Windows SharePoint Services -&amp;gt; Click Extend or Upgrade a Virtual Server (Second Link) -&amp;gt; In the virtual servers listed, do you see "Upgrade" next to your SharePoint virtual server.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt;Resolution:&lt;/strong&gt; Upgrade all your components to SP1 using the STSADM.EXE util -&amp;gt; follow steps listed in this KB article&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://support.microsoft.com/?kbid=871149"&gt;&lt;font face="Verdana" size="2"&gt;http://support.microsoft.com/?kbid=871149&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt;2) You receive the above error when using SharePoint Object Model code and using the Hostname/Fully Qualified Domain Name (FQDN).&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt;Resolution:&lt;/strong&gt; Follow this support article &lt;/font&gt;&lt;a href="http://support.microsoft.com/?kbid=832816"&gt;&lt;font face="Verdana" size="2"&gt;http://support.microsoft.com/?kbid=832816&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt;3) You are using SSL, your code works fine while using &lt;/strong&gt;&lt;/font&gt;&lt;a href="http://sitename"&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt;http://sitename&lt;/strong&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt; but not &lt;/strong&gt;&lt;/font&gt;&lt;a href="https://sitename"&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt;https://sitename&lt;/strong&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt;Resolution:&lt;/strong&gt; Use the IP address with https:// instead of the sitename (eg SPSite testSite = new SPSite("&lt;/font&gt;&lt;a href="https://65.12.12.12"&gt;&lt;font face="Verdana" size="2"&gt;https://65.12.12.12&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;"); &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;strong&gt;- Mohammed Jeelani&lt;/strong&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=385816" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mjeelani/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Using XPath with XML returned by SharePoint Web services</title><link>http://blogs.msdn.com/mjeelani/archive/2005/02/26/380965.aspx</link><pubDate>Sun, 27 Feb 2005 06:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:380965</guid><dc:creator>mjeelani</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/mjeelani/comments/380965.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mjeelani/commentrss.aspx?PostID=380965</wfw:commentRss><description>&lt;p&gt;&lt;font size="2"&gt;I've seen quite often people writing code that parses thru XML returned by SPS Web services as strings instead of using XPath - cause the XmlDocument throws this error all the time if you dont use an &lt;strong&gt;XmlNameSpaceManager&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;"Namespace Manager or XsltContext needed. This query has a&amp;nbsp; prefix, variable, or user-defined function."&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;Heres a snippet that tells you how to use the &lt;strong&gt;XmlNameSpaceManager&lt;/strong&gt; to use XPath with the XmlDocument.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;Dim Document As New XmlDocument&lt;br /&gt;Dim xml As String&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;xml = "&amp;lt;listitems xmlns:s=""uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"" xmlns:dt=""uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"" xmlns:rs=""urn:schemas-microsoft-com:rowset"" xmlns:z=""#RowsetSchema"" TimeStamp=""2004-12-20T20:57:26Z"" xmlns=""&lt;/font&gt;&lt;a href=""&gt;&lt;?xml:namespace prefix = rs /&gt;&lt;rs:data'&gt;&lt;font face="Verdana" size="2"&gt;http://schemas.microsoft.com/sharepoint/soap/""&amp;gt;&amp;lt;rs:data&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt; ItemCount=""0""&amp;gt;&amp;lt;/rs:data&amp;gt;&amp;lt;rs:data ItemCount=""0""&amp;gt;&amp;lt;/rs:data&amp;gt;&amp;lt;/listitems&amp;gt;"&lt;br /&gt;Document.LoadXml(xml)&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;'Since the XML returned by SPS contains namespace prefixes - we need to create a XmlNamespaceManager&lt;br /&gt;Dim SharePointNamespacePrefix As String = "sp"&lt;br /&gt;Dim SharePointNamespaceURI As String = "&lt;/font&gt;&lt;a href="http://schemas.microsoft.com/sharepoint/soap/"&gt;&lt;font face="Verdana" size="2"&gt;http://schemas.microsoft.com/sharepoint/soap/&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;"&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;Dim ListItemsNamespacePrefix As String = "z"&lt;br /&gt;Dim ListItemsNamespaceURI As String = "#RowsetSchema"&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;Dim PictureLibrariesNamespacePrefix As String = "s"&lt;br /&gt;Dim PictureLibrariesNamespaceURI As String = "uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;Dim WebPartsNamespacePrefix As String = "dt"&lt;br /&gt;Dim WebPartsNamespaceURI As String = "uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;Dim DirectoryNamespacePrefix As String = "rs"&lt;br /&gt;Dim DirectoryNamespaceURI As String = "urn:schemas-microsoft-com:rowset"&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;'now associate with the xmlns namespaces (part of all XML nodes returned &lt;br /&gt;'from SharePoint) a namespace prefix which we can then use in the queries &lt;br /&gt;Dim NamespaceMngr As XmlNamespaceManager&lt;br /&gt;NamespaceMngr = New XmlNamespaceManager(Document.NameTable)&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;NamespaceMngr.AddNamespace(SharePointNamespacePrefix, SharePointNamespaceURI)&lt;br /&gt;NamespaceMngr.AddNamespace(ListItemsNamespacePrefix, ListItemsNamespaceURI)&lt;br /&gt;NamespaceMngr.AddNamespace(PictureLibrariesNamespacePrefix, PictureLibrariesNamespaceURI)&lt;br /&gt;NamespaceMngr.AddNamespace(WebPartsNamespacePrefix, WebPartsNamespaceURI)&lt;br /&gt;NamespaceMngr.AddNamespace(DirectoryNamespacePrefix, DirectoryNamespaceURI)&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;'run the XPath query and return the result nodes &lt;br /&gt;Dim xNodeList As XmlNodeList&lt;br /&gt;xNodeList = Document.SelectNodes("//z:row[@ows_Title]", NamespaceMngr)&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Mohammed Jeelani&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/rs:data'&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=380965" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mjeelani/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Impersonation / Authentication issues when using Integrated Windows Authentication and SharePoint</title><link>http://blogs.msdn.com/mjeelani/archive/2004/12/07/275921.aspx</link><pubDate>Tue, 07 Dec 2004 10:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:275921</guid><dc:creator>mjeelani</dc:creator><slash:comments>29</slash:comments><comments>http://blogs.msdn.com/mjeelani/comments/275921.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mjeelani/commentrss.aspx?PostID=275921</wfw:commentRss><description>&lt;p&gt;With Integrated Authentication its fairly often that people find themselves in a situation where the currently logged in users credentials are not passed from the client to a SQL server / File share / some other server that they are trying to access from SPS. I bumped into it myself and was tearing my hair apart till my colleague Walter Warren told me what the "Double-Hop Issue" was.&lt;/p&gt; &lt;p&gt;Though I’ve titled this blog under SharePoint this actually applies to ASP.NET as well. The problem I faced was that i was creating an ASP.NET web page that consumes the SharePoint Search web service. The ASP.NET app was hosted on a different IIS machine than SPS. The ASP.NET application had Integrated Windows Authentication turned on. All was fine when I was testing the ASP.NET page right from the server where IIS was running, however, when I tried running the same page from another workstation - I kept getting 401 - Unauthorized access errors.&lt;/p&gt; &lt;p&gt;This problem is due to Integrated Windows Authentication that’s turned on in IIS for the ASP.NET application virtual directory. The issue is known as the "Double Hop" issue - when we use Integrated Security, the user credentials are passed from the client system (in this case the different station) to the server that’s running IIS (in this case the ASP.NET application). When the IIS running the ASP.NET app makes a request to the SharePoint server (a second hop) it cannot pass the user credentials passed from the client system. This is a little known documented limitation in IIS, you can refer to a KB on &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;264921"&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;264921&lt;/a&gt; (check the limitations section under Windows NT Challenge/Response - Integrated Windows Authentication was formerly named NTLM, or Windows NT Challenge/Response authentication).&lt;/p&gt; &lt;p&gt;There are 3 ways to workaround this problem &lt;/p&gt; &lt;p&gt;1) Turn of Windows Integrated Authentication and turn on Basic Authentication&lt;br /&gt;2) Hardcode the credentials passed to SharePoint in the ASP.NET application code&lt;br /&gt;3) Turn on Kerbrose Authentication&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Option 1) Turn of Windows Integrated Authentication and turn on Basic Authentication&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;You can turn off Integrated Authentication and turn on Basic Authentication on the virtual directory running the ASP.NET application. With this you should be prompted for your user name and password every time you try to access the ASP.NET application and unlike Integrated Windows Authentication - your credentials are passed even in the second hop. &lt;/p&gt; &lt;p&gt;Note that the drawbacks of this option are &lt;br /&gt;&amp;nbsp;i) in Basic Authentication the user credentials are passed as clear text &lt;br /&gt;&amp;nbsp;ii) users will get a pop-up asking for user credentials every time they try to access your page.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Option 2)&amp;nbsp;Pass&amp;nbsp;user credentials using code&lt;/strong&gt; &lt;/p&gt; &lt;p&gt;My code used the default credentials from the credential cache - however you can hardcode the credentials that are passed to SharePoint. In the SPS web service case i had to create a NetworkCredential object with the user credentials hardcoded and set the object to the Credentials property of the QueryService proxy object.&lt;/p&gt; &lt;p&gt;Changed the line from &lt;/p&gt; &lt;p&gt;&amp;nbsp;qs.Credentials = System.Net.CredentialCache.DefaultCredentials;&lt;/p&gt; &lt;p&gt;To &lt;br /&gt;&amp;nbsp;qs.Credentials = new System.Net.NetworkCredential("&amp;lt;User Name", "&amp;lt;Password&amp;gt;", "&amp;lt;Domain Name&amp;gt;");&amp;nbsp; &lt;/p&gt; &lt;p&gt;In the case of a Fileshare, etc - you will need to use an unmanaged API to impersonate the user on the SPS machine, here is an MSDN article to do that &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemSecurityPrincipalWindowsIdentityClassImpersonateTopic.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemSecurityPrincipalWindowsIdentityClassImpersonateTopic.asp&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can alternatively instead of hardcoding the credentials in code - you can put them in the Web.Config file and retrieve at run time. If you do this - you should also encrypt the password.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Option 3) Turn on Kerberos Authentication&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;You need to turn on Kerberos on IIS and configure SharePoint for this - you can refer to this KB article for the exact steps &lt;a href="http://support.microsoft.com/?id=832769"&gt;http://support.microsoft.com/?id=832769&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Any of these three options should resolve the problem.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Mohammed Jeelani&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=275921" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mjeelani/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Creating a WebPart that works both as a consumer and a provider</title><link>http://blogs.msdn.com/mjeelani/archive/2004/11/05/252851.aspx</link><pubDate>Sat, 06 Nov 2004 02:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:252851</guid><dc:creator>mjeelani</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/mjeelani/comments/252851.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mjeelani/commentrss.aspx?PostID=252851</wfw:commentRss><description>&lt;p&gt;If you ever have to create a web part that needs to act both like a provider and a consumer in which case you'll need to implement more than one Interface, you'll need to create separate classes that implement the separate interfaces...&lt;/p&gt; &lt;p&gt;To make a web part work both as a provider and a consumer you'll need to create three classes...&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;1) public class CellProviderInterface : ICellProvider&lt;br /&gt;2) public class CellConsumerInterface : ICellConsumer&lt;br /&gt;3) public class WebPart1 : Microsoft.SharePoint.WebPartPages.WebPart&lt;/font&gt;&lt;/p&gt; &lt;p&gt;In classes &lt;font face="Courier New"&gt;CellProviderInterface&lt;/font&gt; and &lt;font face="Courier New"&gt;CellConsumerInterface&lt;/font&gt; you'll have to implement the &lt;font face="Courier New"&gt;ICellProvider&lt;/font&gt; and &lt;font face="Courier New"&gt;ICellConsumer&lt;/font&gt; interfaces.&lt;/p&gt; &lt;p&gt;In your WebPart class you need to instantiate the two classes that implement the ICellProvider and ICellConsumer (viz. CellProviderInterface and CellConsumerInterface) &lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;//instantiate your classes&lt;br /&gt;CellConsumerInterface oCellConsumerInterface = new CellConsumerInterface();&lt;br /&gt;CellProviderInterface oCellProviderInterface = new CellProviderInterface();&lt;/font&gt;&lt;/p&gt; &lt;p&gt;And When you register your interface's in the overridden EnsureInterfaces() you need use the instances of these two classes.&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;public override void EnsureInterfaces() &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;// Register the ICellProvider interface &lt;br /&gt;&amp;nbsp;RegisterInterface("CellProvider_WPQ_", &lt;br /&gt;&amp;nbsp;&amp;nbsp;"ICellProvider", &lt;br /&gt;&amp;nbsp;&amp;nbsp;WebPart.UnlimitedConnections, &lt;br /&gt;&amp;nbsp;&amp;nbsp;ConnectionRunAt.Server, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;strong&gt;oCellProviderInterface&lt;/strong&gt;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;"CellProvider_WPQ_", &lt;br /&gt;&amp;nbsp;&amp;nbsp;"Provides a cell to", &lt;br /&gt;&amp;nbsp;&amp;nbsp;"Provides a cell of data"); &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;font face="Courier New"&gt;&amp;nbsp;// Register the ICellConsumer interface. &lt;br /&gt;&amp;nbsp;RegisterInterface("CellConsumer_WPQ_", &lt;br /&gt;&amp;nbsp;&amp;nbsp;"ICellConsumer", &lt;br /&gt;&amp;nbsp;&amp;nbsp;WebPart.UnlimitedConnections, &lt;br /&gt;&amp;nbsp;&amp;nbsp;ConnectionRunAt.Server, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;strong&gt;oCellConsumerInterface&lt;/strong&gt;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;"CellConsumer_WPQ_", &lt;br /&gt;&amp;nbsp;&amp;nbsp;"Consumes a cell from", &lt;br /&gt;&amp;nbsp;&amp;nbsp;"Consumes a cell of data"); &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt; &lt;p&gt;Here’s some sample code that does something very similar….&lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;font color="#800080"&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/html/smpxCreateConnectableWPMultipleInterface_SV01080585.asp?frame=true"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/html/smpxCreateConnectableWPMultipleInterface_SV01080585.asp?frame=true&lt;/a&gt;&lt;/font&gt;&lt;/u&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/html/smpxCreateConnectableWPMultipleInterface.asp"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Jeelani&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=252851" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mjeelani/archive/tags/SharePoint/default.aspx">SharePoint</category></item></channel></rss>