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

RadScheduler WCF binding on SharePoint site

1 Answer 42 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Aleksandras
Top achievements
Rank 1
Aleksandras asked on 26 Nov 2013, 10:03 AM
I'm trying to make WCF binding to work on SharePoint site. Basically all code is nearly the same as it is in demo example.
After some investigation I found out that on OnClientRequestSuccess() event I see appointments array - so it looks like it manages to get appointments from the service. However on OnClientDataBound() event - there are no appointments. As a result - there are no visible appointments in the view by some reason.

I tried similar scenario with isolated Web project (outside SharePoint site) - and it works. So it's somehow related to SharePoint and related changes.. Any ideas?

Main difference related to SharePoint is in *.svc file, it looks like that:

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

Also I had to implement some sort of authorization, because anonymous access is not supported:
protected void RadScheduler1_ResourcesPopulating(object sender, ResourcesPopulatingEventArgs e)
{
HttpCookie cookie = FormsAuthentication.GetAuthCookie(User.Identity.Name, false);
string cookieHeader = string.Format("{0}={1}", cookie.Name, cookie.Value);
e.Headers.Add(HttpRequestHeader.Cookie, cookieHeader);
}

My web.config, which is located in ISAPI folder under SharePoint root (it's just an additional/local web.config):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <customErrors mode="Off"/>
  </system.web> 
  <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="5000000"/>
      </webServices>
    </scripting>
  </system.web.extensions>   
  <system.serviceModel>
    <services>
      <service name="CustomPlannerService">
        <endpoint address="" behaviorConfiguration="CustomPlannerServiceBehavior" binding="webHttpBinding" contract="CustomPlannerService"/>
      </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="CustomPlannerServiceBehavior">
          <enableWebScript/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel> 
</configuration>


Update: found out that issue was coming because my webservice was returning data in slightly different format. Managed to workaround it and now events are shown in the Scheduker.

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 29 Nov 2013, 11:02 AM
Hello,

I would like to clarify that we are not aware of such problem with RadScheduler in SharePoint populated from WCF service. It is quite unusual issue considering the fact that the service is accessible and the data is successfully loaded from the service. Usually the problem you might face is that the request to the services fails or the service could not be accessed.


Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Scheduler
Asked by
Aleksandras
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or