Getting the PSI URL from an Event Handler

Getting the PSI URL from an Event Handler

  • Comments 3

Hello,

There have been a few question with regards to how to get the PSI URL from an event handler. To get the URL, you will need to call into the SharePoint object model. So the first step is to create a reference to it:

using Microsoft.SharePoint;

Then you are going to need to create a SPSite object, passing in the Site GUID which is a property of the ContextInfo object that is passed into the event handler:

SPSite ss= new SPSite(contextInfo.SiteGuid);

From the SPSite object, you can build up the URL to the PSI:

string.Format("{0}/_vti_bin/psi/{1}.asmx",ss.Url, wsName);

For impersonation, you will want to use:

string.Format("{0}//{1}:56737/{2}/psi/{3}.asmx", ss.Protocol, ss.HostName, sspName, wsName);

Chris Boyd

Leave a Comment
  • Please add 1 and 3 and type the answer here:
  • Post
Page 1 of 1 (3 items)