Monday, October 28, 2013

SharePoint 2013 WorkFlow +System.ServiceModel.ServerTooBusyException:

System.ServiceModel.ServerTooBusyException:

Found this error while trying to publish List WF from designer .Many post suggest while googling that you can increase the "QUEUE Length" of the particular process in IIS for particular application pool.

But for me a System restart did the magic
 

Sharepoint 2013 reports + An unexpected error occurred while connecting to the report server. Verify that the Reporting Services Service Application mapped to this web application is available OR the report server is available and configured for SharePoint Integrated mode

An unexpected error occurred while connecting to the report server. Verify that the Reporting Services Service Application mapped to this web application is available OR the report server is available and configured for SharePoint Integrated mode. --> The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<title>IIS 8.0 Detailed Error - 500.19 - Internal Server Error</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;}
code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;}
.config_source code{font-size:.8em;color:#000000;}
pre{margin:0;font-size:1.4em;word-wrap:break-word;}
ul,ol{margin:10px 0 10px 5px;}
ul.first,ol.first{margin-top:5px;}
fieldset{padding:0 15px 10px 15px;word-break:break-all;}
.summary-container fieldset{padding-bottom:5px;margin-top:4px;}
legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;}
legend{color:#333333;;margin:4px 0 8px -12px;_margin-top:0px;
font-weight:bold;font-size:1em;}
a:link,a:visited{color:#007EFF;font-weight:bold;}
a:hover{text-decoration:none;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0'. --> The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<title>IIS 8.0 Detailed Error - 500.19 - Internal Server Error</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;}
code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;}
.config_source code{font-size:.8em;color:#000000;}
pre{margin:0;font-size:1.4em;word-wrap:break-word;}
ul,ol{margin:10px 0 10px 5px;}
ul.first,ol.first{margin-top:5px;}
fieldset{padding:0 15px 10px 15px;word-break:break-all;}
.summary-container fieldset{padding-bottom:5px;margin-top:4px;}
legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;}
legend{color:#333333;;margin:4px 0 8px -12px;_margin-top:0px;
font-weight:bold;font-size:1em;}
a:link,a:visited{color:#007EFF;font-weight:bold;}
a:hover{text-decoration:none;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0'. --> The remote server returned an error: (500) Internal Server Error.



Found this error when tried to use the Report Viewer webpart in SharePoint 2013 page after the "REPORT SERVICE was configured in SHAREPOINT INTEGRATED MODE"


Solution: Run the SP1 for SQL server 2012

Problem: the report viewer try to access web service from this location -->C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\WebServices\Reporting

But if you have not applied SP1 for SQL2012 you will find this Reporting folder only in 14 Hive not in 15 hive. After the update of Report service in SharePoint integrated mode from SP1 you will  be able to see the Reporting folder in 15 Hive too.


For Report to work in SharePoint integrated mode in SharePoin 2013 SP1 for SQL 2012 is very much required

Sharepoint 2013 workflow + The server was unable to process the request due to an internal error


RequestorId: 321d7a5c-ca52-907e-0000-000000000000. Details: RequestorId: 321d7a5c-ca52-907e-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 401 {"error_description":"The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs."} {"x-ms-diagnostics":["3001000;reason=\"There has been an error authenticating the request.\";category=\"invalid_client\""],"SPRequestGuid":["321d7a5c-ca52-907e-aab4-69867fb6c2f8"],"request-id":["321d7a5c-ca52-907e-aab4-69867fb6c2f8"],"X-FRAME-
":["SAMEORIGIN"],"SPRequestDuration":["64"],"SPIisLatency":["3"],"Cache-Control":["private"],"WWW-Authenticate":["Bearer realm=\"3eafb22a-93a3-48a8-9c32-16829fce2722\",client_id=\"00000003-0000-0ff1-ce00-000000000000\",trusted_issuers=\"
00000005-0000-0000-c000-000000000000@*,00000003-0000-0ff1-ce00-000000000000@3eafb22a-93a3-48a8-9c32-16829fce2722\"","NTLM"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"MicrosoftSharePointTeamServices":["15.0.0.4481"],"Date":["Mon, 28 Oct 2013 10:49:09 GMT"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem
System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)



I found this error when I attached a designer List workflow and tried to start the workflow

Solution: Your User Profile Sync Service Should be running .If not add the user to the "Manage User " of User Profile server ,this is the user who triggers the workflow


Basic principle behind this is every user triggering the WF should have a profile of him in User Profile Application Service.

 

Wednesday, October 16, 2013

Connect custom webpart to List View Webpart in SharePoint 2013 .Connected Webparts send parameter from Custom webpart

I had a requirement to sending a parameter from custom webpart and sending it to a report view webpart .This code can also be used to connect any custom webpart with List view webpart.

All you need to do is
1)Open visual studio
2)Create a project
3)Using the template "Webpart" which is grouped under Sharepoint section in VS create a item
named "FilterWebpart".

Use the below code in FilterWebpart.cs



using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
using System.Collections.ObjectModel;

namespace ProviderWebpartVS.FilterWebpart
{
    [ToolboxItemAttribute(false)]
    public class FilterWebpart : System.Web.UI.WebControls.WebParts.WebPart, ITransformableFilterValues
    {

        string propertyvalue = "BSW3";     

        #region ITransformableFilterValues Members

        public bool AllowAllValue
        {
            get { return true; }
        }

        public bool AllowEmptyValue
        {
            get { return true; }
        }

        public bool AllowMultipleValues
        {
            get { return false; }
        }

        public string ParameterName
        {
            get { return "ConnectionProperty"; }
        }

        public System.Collections.ObjectModel.ReadOnlyCollection<string> ParameterValues
        {
            get
            {
                string[] values = new string[] { propertyvalue };
                return new ReadOnlyCollection<string>(values);
            }
        }

        [ConnectionProvider("Connection Property Filter", "ITransformableFilterValues", AllowsMultipleConnections = true)]
        public ITransformableFilterValues SetConnectionInterface()
        {
            return this;
        }

        #endregion
        protected override void CreateChildControls()
        {
        }
    }
}

4)Now deploy the solution into a sharepoint site.
5)Open the site in browser 
6)Add this custom webpart .
7) Also add report view webpart which has parameters or any other list view webpart
8)Edit the webpart -->click -->Connection -->Connect to any webpart on the page.A configuartion window popups on the page where you can configure which parameter is connected to which webpart.


9)Here in this example propertyvalue will be sent as parameter to other webpart.You can change it to take arrary of string in "string[] values"  as shown in code.You your custom logic here to fill the data into string[] values.



Thanks to links below which helped in achieving this

http://blogs.msdn.com/b/edhild/archive/2007/03/28/how-to-build-a-custom-filter-provider-web-part.aspx














Wednesday, October 9, 2013

SharePoint 2013 "Developer Dashboard" configuration and usage

Enabling the SharePoint 2013 "Developer Dashboard" is quite simple
There is no difference between the 2010 version and 2013 version of SharePoint

Below are the steps to enable it.

  • Log on to server where the SharePoint is Installed
  • Open  SharePoint Management Shell
  • Use the below code


 $devDash = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
 $devDashSetting = $devDash.DeveloperDashboardSettings
 $devDashSetting.DisplayLevel = "On"
 $devDashSetting.Update()



The only difference between the SharePoint 2010 and SharePoint 2013 is that there is only two state now
  1. "On"
  2. "Off"

In SharePoint 2010 you had a state name "OnDemand" too which is deprecated in this version
After execution of this command you can open any off your SharePoint site in the farm .You will see a link at the right top corner in the master page.

Click on the link It may not work sometime !!
The reason behind it is your farm may not  have the "Usage and Health Data Collection Service Application"

Create a new 
"Usage and Health Data Collection Service Application" through central Admin site or through
Powershell
In Sharepoint 2013 the data in Developer tool is synced with Usage and heath data collection Service database.Hence this service application should be up and running to use the Developer DashBoard

Now come back to the site.Click on the  developer Dashboard Link.
You can notice that a seperate window is getting opened  this is nothing but your new Developer DashBoard

Advantage of this is that this console is not integrated with in the site as in SharePoint 2010 did,hence by reducing the time delay to open the page.You also see that this has many more options like
  • Better UI
  • Better segregation of data
  • ULS viewer-You may use this to check logs rather than separately relying on other ULS viewers
  • You can also have a better refined way look at each methods and query hit to the database.