SharePoint Resource

The latest insights from the SharePoint Experts

Archive for the ‘SharePoint 2010’ Category

“Some or all identity references could not be translated” error when creating SharePoint 2010 web application.

Posted by lukecostin on April 26, 2012

I ran into a small but annoying issue yesterday while setting up a web application for one of our SharePoint 2010 environments.
The issue in question stated “Some or all identity references could not be translated” when it attempted to set up a web application using the AutoSPinstaller scripts as shown below.

Identity error

The issue can also occur when you attempt to register an account in the “Managed Account” Central Administration page.
After some investigation, I found that the reason for the issue was that the account name (along with it domain prefix) was exceeding 20 characters, which is the limit for all managed accounts.

If you change the managed account you are using to one below 20 characters (For example, changing the managed account from Domain\ServiceAccount15 to Domain\Servacct15) you should not experience this issue anymore.

Posted in SharePoint, SharePoint 2010, SharePoint Deployment | Tagged: , , | Leave a Comment »

The benefits of using Microsoft Office 365

Posted by tomshaw94 on November 22, 2011

Microsoft Office 365 is a revolutionary technology that allows individuals and companies to create and maintain a virtual office in the cloud. It offers businesses and professionals with an easy and flexible way to work on the go from a PC, through a browser and a smartphone. Features include the familiar Microsoft Office 2010 applications and their web applications; Exchange Online, SharePoint Online, and Lync Online.

Office 365 offers the following benefits:

One of the biggest benefits of using Office 365 is that it enables you to work from virtually anywhere and on nearly any device- be it PC, Mac, iPhone, Android or Blackberry. This benefits you as information can be accessed anywhere at any time, and still have a high security level.  Emails can be accessed anywhere through the Outlook Web App, documents can be viewed and edited with Office Web App and online meetings can take place with the Lync Web App.

Your mail, documents and services are always available whenever you need them. Your data is delivered and kept in a data centre protected by layers of security. Office 365 also includes a ‘financially-backed Service Level Agreement’ to guarantee 99.9% uptime.

Office 365 provides your business with a fixed annual cost for using communication, collaboration, and productivity tools. Also it can significantly reduce costs and effort for deploying and managing servers on-premise.

Your information is always protected by the highest standard of security. Microsoft Exchange Online has built in anti-virus and spam filtering protection. In addition to this you can safeguard your data with enterprise-grade reliability, continuous data back-up, disaster recovery capabilities and strict privacy policies.

Through the Office 365 management site you can keep control of your IT. Tasks and authority can be delegated through Role-Based Access Controls. Patches, updates and back-end upgrades are automatically applied, while you retain control over the deployment of major changes.

Using Office 365 can be an easy transition for you. This is because you can become productive right away using familiar Office tools that integrate with Office 365. Furthermore Office 365 doesn’t require a complicated setup and configuration, which again speeds up the time in which you can become productive.

With a variety of contracts available it is easy to find one that fits your business and IT needs well. Each contract has the same 99.9% uptime guarantee and a high security level that you expect from Microsoft.Your employees can simultaneously edit documents with colleagues. In addition to this, Office 365 provides an easy platform for emails, collaboration and online meeting solutions.

Office 365 makes it possible to have mailboxes in the cloud and on premise, and allows them to work effectively as a single, integrated architecture. Features in Office 365 are available to both cloud users and on-premise users. This shows again how seamless the collaboration is between cloud and on-premise users.

Microsoft provides a global IT support 24 hours a day, 7 days a week. This benefits to your company as it reduces down time. Your problems can be sorted at any time and as quickly as possible.

For a free 30 day trail of the full enterprise version of Office 365 (including SharePoint, Lync and Exchange) click here

Posted in Office 365, SharePoint 2010 | Leave a Comment »

Creating a WCF web service and calling JSON objects from JQUERY – SharePoint 2010 C#

Posted by niknovotronix on October 13, 2011

WCF or ASMX?

First off, why create a WCF web service in SharePoint instead of the old ASMX web service? Did some reading on this and would recommend these blog posts on the subject:

http://dotnetarchitecthouston.com/post/WCF-versus-ASMX-services.aspx

http://www.bishoylabib.com/2009/08/comparing-asmx-and-wcf.html

Creating a WCF web service in Visual Studio 2010

1. Start off by creating a new SharePoint project in visual studio

2. Call it WCFService (or name of your choice)
3. Create a new “Mapped folder” by right clicking on the project and select “Add”
4. Point to the ISAPI folder (Usually: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI)
5. Create a folder called WCFService (or name of your choice)
6. Create a folder called “WCFObjects” (or name of your choice)
7. Add a class called “Staff” in the newly created folder

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WCFService
{
public class Staff
{
public string name { get; set; }
public string country { get; set; }
}
}

8. Create an Interface class called “IService.cs” with following code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Web;
namespace WCFService
{
[ServiceContract(Namespace = "WCFService.Service")]
public interface IService
{
[WebInvoke(UriTemplate = "/returnStaff", Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
List<Staff> returnStaff(string staffName, string staffCountry);
}
}

9. Now we need to create the /returnStaff method defined in the interface
10. Create a class called “Service.cs” with following code in it:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Activation;
namespace WCFService
{
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Service:IService
{
public List returnStaff(string staffName, string staffCountry)
{
//create staff list
List staffList = new List();
Staff staff = new Staff();
staff.name = staffName;
staff.country = staffCountry;
//add staff to list
staffList.Add(staff);
//return list
return staffList;
}
}
}

11. Now that we have the logic for the web service, the actual Service.svc can be created

12. Add a “Service.svc” file in the ISAPI\WCFService folder with following code in it:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$"%>
<%@ServiceHost Debug="true" Language="C#" CodeBehind="Service.cs" Service="WCFService.Service, WCFService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=KEY TOKEN"
Factory="Microsoft.SharePoint.Client.Services.MultipleBaseAddressWebServiceHostFactory, Microsoft.SharePoint.Client.ServerRuntime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

13. Put your token id from the assembly instead of “KEY TOKEN”

14. Your solution should now look like this:

15. Deploy your solution

16. Try to go to “http://yourservername/_vti_bin/WCFService/Service.svc to check if your service is working

17. You will get “Endpoint not found” as a return message from your service

Calling web service from client side JQUERY (ASPX) in a Web Part

1. Create a new SharePoint project called “WebParts”

2.  Create a new visual web part called “StaffViewer” (http://weblogs.asp.net/sreejukg/archive/2011/03/26/create-a-visual-web-part-using-visual-studio-2010.aspx)

3. Add following code to the StaffViewerUserControl.ascx to create input boxes and tables to view data:
<table id="tblInput">
<tr>
<td>
Name:
</td>
<td>
<input type="text" id="name" />
</td>
</tr>
<tr>
<td>
Country:
</td>
<td>
<input type="text" id="country" />
</td>
<td>
<button id="btnCallService" type="button" onclick="getStaff()">
Call web service</button>
</td>
</tr>
</table>
<table id="tblStaff">
</table>

4. Add a JQUERY function called “getStaff” which calls the WCF web service

function getStaff() {
//input parameters
var name = $('#name').val();
var country = $('#country').val();
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
//url to web service
url: "/_vti_bin/WCFService/Service.svc/returnStaff",
//input parameters (JSON)
data: JSON.stringify({ staffName: name, staffCountry: country }),
success: function (data) {
var staff = data;
//iterate through data
$.each(staff, function (index, person) {
//view data
$('#tblStaff').append('
Name: ' + person.name + '| Country: ' + person.country + '
');
});
}
});
};

5. Note the  ”JSON.stringify({ staffName: name, staffCountry: country })” which passes through parameters as in JSON format

6. Add a .click event to the button

$(function () {
$("btnCallService").click(function () {
getStaff();
});
});

7. Your solution should now look like this:

8. Deploy the solution

9. Activate the “Web Part” feature

10. Add the Web Part to your page

11. Type a name and country, then click “Call web service”

12. The service is now called, JSON array returned to user control and the result is displayed on the page

Source code:

Download source code

Posted in C#, jQuery, SharePoint 2010, WCF, Web Service | Leave a Comment »

Best practices for capacity management for SharePoint Server 2010

Posted by Steve Jones on September 16, 2011

For those involved in designing SharePoint 2010 infrastructure I would recommend reading the newly published article on capacity management best practices.  See http://technet.microsoft.com/en-us/library/hh403882.aspx

Posted in SharePoint 2010 | Leave a Comment »

Timer job: No changes after deployment

Posted by niknovotronix on August 31, 2011

Ever re-deployed a timer job in SharePoint without any changes being made (even after GAC deployment and “iisreset”)?

Remember to restart the “SharePoint 2010 Timer” Service as well after deployment for changes to be made immediately.

Posted in SharePoint 2010, SharePoint Deployment, SharePoint Development | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 48 other followers