Demo WebService isn't responding - Newbie Question

3 posts, 0 answers
  1. KI performance
    KI performance avatar
    13 posts
    Member since:
    Jun 2013

    Posted 14 Apr 2014 Link to this post

    Hello everbody,

    i am unable to configure my WCF WebService and RadTreeView Control to work together 'On Demand', and because i am absolutly new with WebServices, i have no clue what is the problem. Anybody can give me a hint? By the way, i strongly use the following Demo of Telerik: http://www.telerik.com/help/aspnet-ajax/treeview-load-on-demand-wcf.html and http://demos.telerik.com/aspnet-ajax/treeview/examples/programming/performance/defaultcs.aspx

    myTopBarNavigation.svc

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

    myTopBarNavigation.svc.cs

    namespace kibp.nordlb.layout.ISAPI.kibp.nordlb.layout
    {
         class NodeData
        {
            private string text;
            public string Text
            {
                get { return text; }
                set { text = value; }
            }
        }
     
        //[BasicHttpBindingServiceMetadataExchangeEndpoint]
        [ServiceContract]
        [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
        class kibpTopBarNavigation
        {
             [OperationContract] 
            public IEnumerable GetNodes(RadTreeNodeData node, IDictionary context)
            {
                int numberOfNodes = 100;
                List<NodeData> nodes = new List<NodeData>();
                for (int i = 0; i < numberOfNodes; i++)
                {
                    NodeData nodeData = new NodeData();
                    nodeData.Text = "Node " + i;
                    nodes.Add(nodeData);
                }
                 return nodes;
            }
        }
    }

    Error Message @Fiddler:

    HTTP/1.1 500 System.ServiceModel.ServiceActivationException

    P.s.: The Request looks like this:


    and tries to send the following Data:

    {"node":{"Text":"Root Node","Value":null,"Key":null,"ExpandMode":3,"NavigateUrl":null,"PostBack":true,"DisabledCssClass":null,"SelectedCssClass":null,"HoveredCssClass":null,"ImageUrl":null,"HoveredImageUrl":null,"DisabledImageUrl":null,"ExpandedImageUrl":null,"ContextMenuID":"","Checked":false},"context":[]}




  2. KI performance
    KI performance avatar
    13 posts
    Member since:
    Jun 2013

    Posted 14 Apr 2014 in reply to KI performance Link to this post

    I've build a Interface with following Content:

    myTopBarNavigationInterface.cs

    namespace xxxx.xxxx.xxxx.ISAPI.xxxx.xxxx.xxxx
    {
        [ServiceContract]
        interface myTopBarNavigationInterface
        {
     
            [OperationContract]
            [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
            IEnumerable GetNodes(RadTreeNodeData node, IDictionary context);
        }
    }

    modified: myTopBarNavigation.svc.cs

    namespace xxxx.xxxx.xxxx.ISAPI.xxxx.xxxx.xxxx
    {
     
        class NodeData
        {
            private string text;
     
            public string Text
            {
                get { return text; }
                set { text = value; }
            }
        }
     
        [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
        class myTopBarNavigation : myTopBarNavigationInterface
        {
            public IEnumerable GetNodes(RadTreeNodeData node, IDictionary context)
            {
                int numberOfNodes = 100;
                List<NodeData> nodes = new List<NodeData>();
                for (int i = 0; i < numberOfNodes; i++)
                {
                    NodeData nodeData = new NodeData();
                    nodeData.Text = "Node " + i;
                    nodes.Add(nodeData);
                }
     
                return nodes;
            }
        }
    }

    With this modified edition, i see that the WebService is called and it jumpes into the correct function. Btw. i dont know why but the webservice is called three times and the page returns 401 as error, but this is another story :)
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 17 Apr 2014 Link to this post

    Hi Sascha,

    Does this mean that the problem is solved?

    Regards,
    Hristo Valyavicharski
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top