Question

Being completely new to the whole SharePoint environment, I am having trouble understanding exactly how to crawl external data into a SharePoint index.

What I need to accomplish is that a user can use SP search to search an external data source. The results will show the external data which should (ideally) be clickable and redirect the user to the external source(such as a web page).

So far what I understand is that you use BCS and import a BDC Model. WCF is used to "give" the information through to SharePoint from the external data source.

My question is now, how exactly does one deploy/execute a WCF Service?

I have searched for ways to do this but the material I'm finding does not really clear anything up

This is what I have so far in IService.cs but I'm battling to understand exactly what to do with it.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WcfServiceLibrary1
{
    [ServiceContract]
public interface IService1
{
    [OperationContract]
    List<string> GetData(int value);

    [OperationContract]
    CompositeType GetDataUsingDataContract(CompositeType composite);

      }

    [DataContract]
public class CompositeType
{
    bool boolValue = true;
    string stringValue = "Hello ";

    [DataMember]
    public bool BoolValue
    {
        get { return boolValue; }
        set { boolValue = value; }
    }

    [DataMember]
    public string StringValue
    {
        get { return stringValue; }
        set { stringValue = value; }
    }
}
}

and this is in Service.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WcfServiceLibrary1
{    public class Service1 : IService1
{
    public List<string> GetData(int value)
    {
        List<string> list = new List<string>();
        list.Add(string.Format("Order1", value));
        list.Add(string.Format("Order2", value));
        list.Add(string.Format("Order3", value));
        list.Add(string.Format("Order4", value));
        list.Add(string.Format("Order5", value));
        return list;
    }

    public CompositeType GetDataUsingDataContract(CompositeType composite)
    {
        if (composite == null)
        {
            throw new ArgumentNullException("composite");
        }
        if (composite.BoolValue)
        {
            composite.StringValue += "Suffix";
        }
        return composite;
    }
}
}

Thanks in Advance

Was it helpful?

Solution

The creation of WCF based web service is independent of its consumption in SharePoint via BCS. The Search mechanism of the External list (sourced from WCF services) is more complex (using Hybrid).There are other items that need to be addressed - Secured Stored Service, etc. To learn more, I'd suggest starting with some examples from Fabian Williams -

Using WCF and BCS to bring your Enterprise Data to the Cloud [PDF presentation]

Several BCS-related blog postings

Using SharePoint BCS in the Cloud – Surfacing CRUD Data with WCF and Office 365 [excellent series]

OTHER TIPS

I would also recommend Scot Hillier's excellent book on the topic of BCS Professional Business Connectivity Services for SharePoint 2010. Even though it's 2010 it is still a very viable reference. It does not address the cloud, but does provide great depth on the topic.

I'd paste a link but it looks like this is not allowed.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top