Deploying ClickHome-SharePoint Connections Web Service


    Description

    This section will provide instructions on how to deploy ClickHomeSharePointConnections web service in SharePoint site. Web service class library will be stored in SharePoint Site “Bin” Folder instead of in the GAC.


    Process

    List of required files for deploying the ClickHomeSharePointConnections web service. These are available HERE


    ClickHomeSharePointConnections.asmx
    ClickHomeSharePointConnectionswsdl.aspx
    ClickHomeSharePointConnectionsdisco.aspx
    ClickHomeSharePointConnections.dll


    1. Copy ClickHomeSharePointConnections.dll to “bin” folder of the target SharePoint site.

    Open IIS Manager > Find target SharePoint site > Right click and select Open. An explorer window should be opened. E.g.: C:\Inetpub\wwwroot\wss\VirtualDirectories\1412


    Figure 1 – IIS Manager

     


    Figure 2 – SharePoint Site “Bin” Folder


    2. Copy ClickHomeSharePointConnections.asmx, ClickHomeSharePointConnectionswsdl.aspx, and ClickHomeSharePointConnectionsdisco.aspx to SharePoint ISAPI folder.

    E.g. C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI. 

    Figure 3 – SharePoint ISAPI Folder


    You might also want to modify the trust level of your SharePoint site since the custom web service needs access to SharePoint object model.


      1. Add new custom trust level configuration
      Open IIS Manager, navigate to target SharePoint site (e.g.: SharePoint - 1412)
      Right click the site, select Open (it should open explorer window to physical location of your site. E.g.: C:\Inetpub\wwwroot\wss\VirtualDirectories\1412)
      Open the web.config file

       

      Figure 4 – SharePoint Site (Root Site)

      Find BEFORE section and add new trust level.


      BEFORE:

      <system.web>
      <securityPolicy>
      <trustLevel name="WSS_Medium" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_mediumtrust.config" />
      <trustLevel name="WSS_Minimal" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_minimaltrust.config" />


      AFTER:

      <system.web>
      <securityPolicy>
      <trustLevel name="WSS_Medium" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_mediumtrust.config" />
      <trustLevel name="WSS_Minimal" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_minimaltrust.config" />
      <trustLevel name="WSS_Custom" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_customTrust.config" />


        2. Modify your trust level configuration reference to the custom one. Find this section:

        Note: YOUR_TRUST_LEVEL_CONFIGURATION_NAME could be WSS_Minimal or WSS_Medium


        BEFORE:

        <trust level="YOUR_TRUST_LEVEL_CONFIGURATION_NAME" originUrl="" />

        AFTER:

        <trust level="WSS_Custom" originUrl="" />


          3. Create a new trust level configuration file based on your previous trust level configuration
          Navigate to the location of trust level config file. E.g.: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\
          Make a backup copy of your previous trust level configuration file
          Rename the Copy file to: WSS_customTrust.config
          Open the WSS_customTrust.config


           

          Figure 5 – SharePoint Site CONFIG Folder

          Add new SecurityClass in <SecurityClasses>


          <SecurityClass Name="SharePointPermission" Description="Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />


          Add new PermissionSet in <NamedPermissionSets>


          <PermissionSet class="NamedPermissionSet" version="1" Name="wss_customTrust">
          <IPermission class="AspNetHostingPermission" version="1" Level="Minimal" />
          <IPermission class="SecurityPermission" version="1" Flags="Execution" />
          <IPermission class="WebPartPermission" version="1" Connections="True" />
          <IPermission class="SharePointPermission" version="1" ObjectModel="True" />
          </PermissionSet>


          Add new CodeGroup under <CodeGroup class="FirstMatchCodeGroup"


          <CodeGroup
           class="UnionCodeGroup"
           version="1"
           PermissionSetName="FullTrust">
           <IMembershipCondition
           class="UrlMembershipCondition"
          version="1"
          Url="$AppDirUrl$/bin/ClickHomeSharePointConnections.dll"
          />
          </CodeGroup>


            4. Test the installed custom web service. 

            Issue an IISRESET and browse to the web service through http://yoursharepointsiteurl/_vti_bin/ClickHomeSharePointConnections.asmx At this point, you should be able to see four web methods:
            BindListItemAddedEvent
            CreateNewList
            ExportDocument
            FetchCustomListTemplates

               

              Figure 6 – ClickHomeSharePointConnections Web Service


              2. Deploying Custom Lists Item Added Event Receiver


              Description

              This section will provide instructions on how to deploy Custom Lists Item Event Receiver to the GAC.


              Process

              The required file for deploying Custom List Item Added Event receiver also can be found HERE

                CustomListItemEventReceiver.dll

                Copy the CustomListItemEventReceiver.dll file to the \Windows\Assembly folder:
                Open Window Explorer > navigate to C:\Windows\Assembly
                Open another Windows Explorer > locate the CustomListItemEventReceiver.dll
                Drag the CustomListItemEventReceiver.dll to the C:\Windows\Assembly window.


                  Add new key under <appSettings> section in your SharePoint site web.config file:
                  Open IIS Manager > navigate to your SharePoint site
                  Select the site > Right Click and select Open.
                  Open the web.config > add this section under <appSettings> to define the ClickHome database file.
                  <add key="ClickHomeSqlConnectionString" value="Data Source=SP_ROOT; Initial Catalog=DEMO-ClickHomeOffice;User Id=sa;Password=sasasa;" />
                  Do not forget to modify the DataSource, InitialCatalog, UserId, Password values.


                    Should you encounter any problems add this section under <SafeControls> in your SharePoint’s server web.config file:
                    <SafeControl Assembly="CustomListItemEventReceiver, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6f67c7579166bebc" Namespace="CustomListItemEventReceiver" TypeName="*" Safe="True" />

                         

                    Perform IIS reset. Start > Run > "iisreset" > OK





                    [End]