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

The server method getresources and getappointments failed

6 Answers 192 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
G S S
Top achievements
Rank 1
G S S asked on 25 Oct 2009, 03:45 PM
Hi,

I am using the Telerik Scheduler on my site. At the moment, I am doing local testing. My

The server method getresources failed
The server method getappointments failed

Now I am using WCF. I have the service interface and implementation in the website project and my .svc file points to this service (path is fine).

My service implementation looks like this:

  [ServiceContract(Namespace = "")] 
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] 
    [ServiceBehavior(IncludeExceptionDetailInFaults = true)] 
    public class Scheduler 
    { 
        private WebServiceAppointmentController _controller; 
 
        private WebServiceAppointmentController Controller 
        { 
            get 
            { 
                if (_controller == null) 
                { 
                    _controller = 
                        new WebServiceAppointmentController( 
                            new XmlSchedulerProvider(HttpContext.Current.Server.MapPath("~/Content/Schedule.xml"), 
                                                     false)); 
                } 
                return _controller; 
            } 
        } 
 
        [OperationContract] 
        public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo) 
        { 
            return Controller.GetAppointments(schedulerInfo); 
        } 
 
        [OperationContract] 
        public IEnumerable<AppointmentData> InsertAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) 
        { 
            return Controller.InsertAppointment(schedulerInfo, appointmentData); 
        } 
 
        [OperationContract] 
        public IEnumerable<AppointmentData> UpdateAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) 
        { 
            return Controller.UpdateAppointment(schedulerInfo, appointmentData); 
        } 
 
        [OperationContract] 
        public IEnumerable<AppointmentData> CreateRecurrenceException(SchedulerInfo schedulerInfo, 
                                                                      AppointmentData recurrenceExceptionData) 
        { 
            return Controller.CreateRecurrenceException(schedulerInfo, recurrenceExceptionData); 
        } 
 
 
        [OperationContract] 
        public IEnumerable<ResourceData> GetResources(SchedulerInfo schedulerInfo) 
        { 
            return Controller.GetResources(schedulerInfo); 
        } 
 
    } 


And the aspx:

      <telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Black" Visible="true" SelectedDate="2009-02-02" 
                        Width="1043px"
                    <Localization AdvancedAllDayEvent="All day"></Localization> 
                    <AdvancedForm DateFormat="dd/MM/yyyy" TimeFormat="HH:mm"></AdvancedForm> 
                    <WebServiceSettings Path="Service.svc" /> 
                    </telerik:RadScheduler> 

These errors appear even if I press the buttons on the control.

What am I missing?


6 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 30 Oct 2009, 07:47 PM
Hi,

Can you please try to determine the exact error message from the server? You can do so using Fiddler or Firebug to inspect the response to the Web Service requests. Thank you.

Greetings,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Manu
Top achievements
Rank 1
answered on 19 May 2010, 12:32 AM
I'm not sure if this was the asker's issue, but this problem comes up when the webservice is not configured correctly.  Make sure that the following code:

//[System.Web.Script.Services.ScriptService] 

is commented back in (it's commented out by default):

[System.Web.Script.Services.ScriptService] 

Without this, the service won't connect properly and the error mentioned above will happen.
0
Monsignor
Top achievements
Rank 2
answered on 02 Nov 2010, 12:58 PM
Hi

I see that you used the code from telerik's demo. I had issues with that demo too.

Here is how I fixed it (note that I have extracted interface IService from my Service class):

1) Register WCF service in web.config 
<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <behavior name="">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
      </behavior>
    </serviceBehaviors>
    <endpointBehaviors>
      <behavior name="MyServiceTypeBehaviors">
        <enableWebScript />
      </behavior>
    </endpointBehaviors>
  </behaviors>
   
  <services>
    <service name="Service" >
      <endpoint contract="IService" behaviorConfiguration="MyServiceTypeBehaviors" binding="webHttpBinding" address="" />
    </service>
  </services>
  <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
   
</system.serviceModel>

2) Add this attribure to each method of service
[WebGet(ResponseFormat = WebMessageFormat.Json)]

3) Use this code in your scheduler
<WebServiceSettings Path="Service.svc" UseHttpGet="true" ResourcePopulationMode="ServerSide" />

0
Varun
Top achievements
Rank 1
answered on 02 Sep 2011, 03:08 AM
I have problem using RadScheduler on an MVC Project. It works well over http but when we use https, it gives getappointments failed error.

Reason i have checked using Firebug is that it is not able to find the Service used.

Please check. Gives  a 404 error.

http://mytimescore.com/Models/SchedulerWebService.asmx/GetAppointments

Please help!

Varun
0
Peter
Telerik team
answered on 07 Sep 2011, 10:42 AM
Hi Varun,

Please, review this article and check if it helps -
http://msdn.microsoft.com/en-us/library/ee414240.aspx

Note that the problem is not directly related to RadScheduler.

Regards, Peter
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
PPT
Top achievements
Rank 1
answered on 07 May 2012, 06:06 PM
I know this is an old post... but for people who land here... another thing to make sure is that you have your Path correct in your ascx.
 <WebServiceSettings Path="~/Models/Service.svc" />  etc.
A symptom of this will be a 404 in your server's response while looking for the WS.
Seems simple enough to miss... but can happen.
Tags
Scheduler
Asked by
G S S
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Manu
Top achievements
Rank 1
Monsignor
Top achievements
Rank 2
Varun
Top achievements
Rank 1
Peter
Telerik team
PPT
Top achievements
Rank 1
Share this question
or