Saturday, January 10, 2015

Using SharePoint web services with SSL ; Adding SSL Certificate to SharePoint Site ; Error : The remote certificate is invalid according to the validation procedure.

Task : Uploading file using SharePoint web services ( Authentication.asmx , Copy.asmx , Lists.asmx ).
Conditions :

  1. Using webserivces from http://www.xyz.com to https://www.abc.com .
  2. Using Webpart ( c# Code )
  3. Caller and Consumer both are SharePoint portals.
Errors:
The remote certificate is invalid according to the validation procedure.
An operation failed because the following certificate has validation errors:\n\nSubject Name: CN=*.abc.xyz.ae
Solution :

Step 1 # open https portal and download (Export) ssl certificate.
Step 2 # Go to sharepoint central admin > Secuirty > Manage Trust
  • Add new certificate
Step 3 # Reset IIS on All web front ends.

Help Links :

http://blogs.msdn.com/b/jpsanders/archive/2009/09/16/troubleshooting-asp-net-the-remote-certificate-is-invalid-according-to-the-validation-procedure.aspx

Sunday, January 4, 2015

How to Remove SharePoint extended web application;How to change SharePoint web-application Host Header

I came across the issue where I have to change Host Header of Extended web application in SharePoint 2010 , I found that you can not change host header of extended web application  to new one ,To achieve this we have to remove that extended zone web application from central administration 

1.  Go to Central Administrator, Application Management, Select the Web Application you wish to change and hit the arrow under Delete and choose  Remove SharePoint from IIS Site.

clip_image002

2. Next, select the associated site you which to update the host header URL against.    For Delete IIS web sites, select No and hit OK.
image

After these steps ,extended web application will no longer be associated with your web application and you can extend it again with new Host Header and details for the same zone , I hope it helps.

I found above solution @ http://blogs.msdn.com/b/russmax/archive/2013/02/27/how-to-properly-change-the-host-header-url-of-a-web-application-in-sharepoint-2010.aspx , Thanks to  "Russ Maxwell"

Thanks,
Rahim
RahimKhowaja@hotmail.com

Saturday, January 3, 2015

Is that possible to have two Web-application on Port 80 ? Yes ; Two web application on Port 80 with Different Host headers

Issue : I have to use same port for two web application , Simply by changing host header name we can achieve this.

http://www.hotmail.com
http://www.yahoo.com

Both web applications can survive on same port

Thanks,
Rahim

How to convert base64 to bitmap image ; how to show image from base64 to Rdlc report ; Show QRCode in PDF ;

Problem :

We codded for QRCode with the help of JQuery but it was difficult to show that QR Code on Report Viewer and genrate PDF . Following code will change the QRCode to stream and save it in local place and then placed it in report viewer ; Sorry for dirty code but It might help you out .

 ReportViewer1.LocalReport.Refresh();
        string imageDataParsed = Image1.Value.Substring(Image1.Value.IndexOf(',') + 1);
        byte[] imageBytes = Convert.FromBase64String(imageDataParsed);
        using (var imageStream = new MemoryStream(imageBytes, false))
        {
            Bitmap image = new Bitmap(imageStream);
            image.Save(Server.MapPath("test.jpg"));
        }

        ReportViewer1.LocalReport.ReportPath = Server.MapPath("Report.rdlc");
        ReportViewer1.LocalReport.EnableExternalImages = true;
        string imagePath = new Uri(Server.MapPath("test.jpg")).AbsoluteUri;
        Microsoft.Reporting.WebForms.ReportParameter rptZoneName = new Microsoft.Reporting.WebForms.ReportParameter();
        rptZoneName.Name = "ReportParameter1";
        rptZoneName.Values.Add(imagePath);
        // rptZoneName.Values.Add(imagePath);
        ReportViewer1.LocalReport.SetParameters(rptZoneName);

Thanks,
Rahim 

How to deploy Solution in SharePoint with Power Shell ; Solved Error : Feature is already installed in this farm use the -force attribute;

I Come across the error while deploying wsp package on SharePoint 2010 , I was trying to do it with command "Add-SPSolution -LiteralPath " but once it shows the solution in central administration and I tried to deploy , it throws an error that feature no ##### is already installed please use some -force attribute to install it , It was resolved once I used following command 

Install-SPSolution -Identity "XXXXXXX.wsp" -WebApplication "http://abcd.com" -GACDeployment -Force

Thanks,
Rahim