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:
Also I had to implement some sort of authorization, because anonymous access is not supported:
My web.config, which is located in ISAPI folder under SharePoint root (it's just an additional/local web.config):
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.
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.