This is a migrated thread and some comments may be shown as answers.

RadComboBoxContext is empty in WCF service

1 Answer 119 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sharepoint Developer
Top achievements
Rank 1
Sharepoint Developer asked on 08 Dec 2011, 10:02 PM
Hi all, I have a custom WCF service hosted in Sharepoint layouts folder, and I'm trying to do something like this:

http://demos.telerik.com/aspnet-ajax/combobox/examples/loadondemand/wcf/defaultcs.aspx

The service is effectively invoked but the context is empty (the dictionary doesn't contain any item).
Also, if I also "hardcode" the list of results to be returned, the combobox doesn't bind anything (seems the context is also empty on its way back to the page).

My interface is defined as follows:

    [ServiceContract]
    public interface IACT
    {
        [OperationContract]
        RadComboBoxData GetCustomerOrderHistoryTelerik(RadComboBoxContext context);
    }

The class is currently a copy of what's in the sample to make it work (with the following attributes applied to it):

    [BasicHttpBindingServiceMetadataExchangeEndpoint]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class ACT : IACT
    {
        public RadComboBoxData GetCustomerOrderHistoryTelerik(RadComboBoxContext context)
        {
            //The RadComboBoxData object contains all required information for load on demand:
            // - the items 
            // - are there more items in case of paging
            // - status message to be displayed (which is optional)
            RadComboBoxData result = new RadComboBoxData();
            ...

The svc file contains the following definition to allow for automatic endpoint exposure via Sharepoint (using the Factory):

<%@ ServiceHost Language="C#" Debug="true"
    Service="ACT, $SharePoint.Project.AssemblyFullName$"  
    CodeBehind="ACT.svc.cs"
    Factory="Microsoft.SharePoint.Client.Services.MultipleBaseAddressWebServiceHostFactory, Microsoft.SharePoint.Client.ServerRuntime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

And the layout of my page contains a combobox such as:

                                    <telerik:RadComboBox runat="server" ID="RadComboBox1" Height="100px"
                                        AllowCustomText="true"
                                        LoadingMessage="Loading, please wait..."
                                        EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                                        EmptyMessage="Type here ..." ItemsPerRequest="10">
                                        <WebServiceSettings
                                            Path="~/_layouts/Sample/Services/ACT.svc"
                                            Method="GetCustomerOrderHistoryTelerik" />
                                    </telerik:RadComboBox>

The only thing I have in the web.config of the Sharepoint application regarding WCF is this, as the endpoints are exposed automatically:

  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
  </system.serviceModel>

Currently the master page contains a regular ScriptManager, but I've tried replacing it with a RadScriptManager and the results are the same.

The problem with the above method is that when debugging the code, the context doesn't contain anything, 
And the service works normally for other methods via Ajax requests, etc...

What am I missing here? Any hint would be greatly appreciated.

Thank you very much.

1 Answer, 1 is accepted

Sort by
0
Cat Cheshire
Top achievements
Rank 1
answered on 13 Dec 2011, 07:43 PM
Have you tried to deploy your custom WCF service at SharePoint ISAPI mapped folder?
Tags
ComboBox
Asked by
Sharepoint Developer
Top achievements
Rank 1
Answers by
Cat Cheshire
Top achievements
Rank 1
Share this question
or