views:

38

answers:

0

I've been trying to get data from a wcf service and into the fullcalendar control. However, ive had no luck and wondered what i was doing wrong.

jscript :

$('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,basicWeek,basicDay'
        },
        editable: false,
        height: 200,
        aspectRatio: 100,
        events: "http://localhost:63295/_services/Service2.svc/DoWork/"

etc...

WCF interface :

[ServiceContract]
public interface IService2
{
    [OperationContract]
    [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]    
    string[] DoWork();
}

WCF Service :

public string[] DoWork()
{
    // Add your operation implementation here
    SortedDictionary<string, string> d = new SortedDictionary<string, string>();

    NameValueCollection AE = new NameValueCollection(); 

    SqlDataReader sdr = ReadData("SelectALLAE");
    while (sdr.Read())
    {
        AE.Add("title", sdr["AE_EmployeeID"].ToString() + " " + sdr["AE_EmployeeName"].ToString() + " " + sdr["AE_EventCode"].ToString());
        AE.Add("start", sdr["AE_StartDateTime"].ToString());
        AE.Add("end", sdr["AE_EndDateTime"].ToString());
    }

    return AE.GetValues(0).ToArray();
}

Web.config :

 <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="CountryProvinceBehavior">
                    <serviceMetadata httpGetEnabled="true"/>
                    <serviceDebug includeExceptionDetailInFaults="true"/>
                </behavior>
            </serviceBehaviors>
            <endpointBehaviors>
                <behavior name="CountryProvinceBehavior">
                    <webHttp/>
                </behavior>
            </endpointBehaviors>
        </behaviors>
        <services>
            <service behaviorConfiguration="CountryProvinceBehavior" name="TimesheetsV2._0_Investigations._services.Service2">
                <endpoint address="" binding="webHttpBinding" contract="TimesheetsV2._0_Investigations._services.IService2" behaviorConfiguration="CountryProvinceBehavior"/>
            </service>
        </services>
    </system.serviceModel>

I've successfully connected to this wcf on a page without the full calendar. This was so i could test how to connect to the wcf service via jquery.

But when i use the fullcalendar event option, nothing happens. it doesn't even connect the wcf service at all ( i tried to do a debug on the service and nothing happened ).

any help would be appreciated

thanks