TreePanel WebService Loader doesn't work in "production server"

  1. #1

    TreePanel WebService Loader doesn't work in "production server"

    Hi guys !

    I have a really strange issue with the WebService Loader for a TreePanel. If I run my project with Visual Web Developer, the "default.aspx" page looks OK. The TreePanel loads successfully.

    Also, if I put the project in the "wwwroot" folder of the IIS, and open it with a browser from the same computer that i'm working, everything is OK too.

    The problem comes when I open a browser in a different computer, and try to access the project (ie. http://myserver/WebServices). The page doesn't display the TreePanel.

    At this point, I don't know if it's a problem with the IIS itself, or another issue of configuration.

    Here is my code:
    Default.aspx
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript" language="javascript" >
    function ShowLoadMask()
    {
        Ext.getCmp("Test_Tree").el.mask('Loading ...', 'x-mask-loading');
    } 
    
    
    
    
    
    function HideLoadMask()
    {
        Ext.getCmp("Test_Tree").el.unmask();
    }
    </script>
    
    </head>
    
    
    <body>
    
    
    <form id="form1" runat="server">
    
    
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <ext:ScriptManager ID="ScriptManager2" runat="server" CleanResourceUrl="False">
    </ext:ScriptManager>
    
    
    
    
    
    <ext:TreePanel ID="Test_Tree" runat="server" Header="false" 
        Border="false" AutoScroll="true" RootVisible="False" >
        <Loader>
            <ext:WebServiceTreeLoader DataUrl="TreeLoaderService.asmx/GetNodes" />
        </Loader>
        <Root>
            <ext:AsyncTreeNode NodeID="0" Text="Root" Expanded="true" />
        </Root>
        <Listeners>
            <BeforeLoad Handler="ShowLoadMask();" />
            <Load Handler="HideLoadMask();" />
        </Listeners>
     </ext:TreePanel>
    
    
    
    
    
    </form>
    
    
    </body>
    
    
    </html>
    TreeLoaderService.cs
    
    
    
    using System;
    using System.Collections;
    using System.Linq;
    using System.Web;
    using System.Web.Services;
    using System.Web.Services.Protocols;
    using System.Xml.Linq;
    
    [WebService(Namespace = http://tempuri.org/)]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    
    
    public class TreeLoaderService : System.Web.Services.WebService {
    
    
        [WebMethod]
        public Coolite.Ext.Web.TreeNodeCollection GetNodes(string node)
        {
            int nodeID = Convert.ToInt32(node.ToString());
            Coolite.Ext.Web.TreeNodeCollection nodes = new Coolite.Ext.Web.TreeNodeCollection();
            if (!string.IsNullOrEmpty(node))
            {    
                Coolite.Ext.Web.AsyncTreeNode asyncNode = new Coolite.Ext.Web.AsyncTreeNode();
                asyncNode.Text = (nodeID + 1).ToString();
                asyncNode.NodeID = asyncNode.Text;
                asyncNode.Icon = Coolite.Ext.Web.Icon.UserAdd;
                nodes.Add(asyncNode);
            }
            return nodes;
        }
    }
    I hope that anybody can help me ...

    Best regards.
  2. #2

    RE: TreePanel WebService Loader doesn't work in "production server"

    This seems like a pathing problem. Is the "TreeLoaderService.asmx/GetNodes" webservice at the same directory level as the page you are testing?

    One little optimization I noticed (but not related to your problem)... you should be able to simplify the following


    // Existing
    Ext.getCmp("Test_Tree").el
    
    
    // Revised
    Test_Tree.el

    Hope this helps.



    Geoffrey McGill
    Founder & CEO
  3. #3

    RE: TreePanel WebService Loader doesn't work in "production server"

    Hi Geoffrey !

    Thanks for the optimization tip !!!

    And yes, the "TreeLoaderService.asmx" is at the same level of the "default.aspx" page. I checked twice before submitting this post.

    TreeLoaderService.asmx
    <%@ WebService Language="C#" CodeBehind="~/App_Code/TreeLoaderService.cs" Class="MyTreeLoaderService" %>
    And the codebehind (the .cs file) is in the App_Code folder (that I also put in the "wwwroot\webservice" folder.

    It's weird, when i'm running locally (http://localhost/webservice/default.aspx) the tree panel is successfully loaded through the web service. Even with the URL http://myserver/webservice/default.aspx running from a browser in my working computer, the TreePanel is OK. But, if I try to access the same URL "http://myserver/webservice/default.aspx" from another computer within my local network, nothing happens; the tree doesn't load.

    Thanks in advance !

    Alfonso Penunuri.
  4. #4

    RE: TreePanel WebService Loader doesn't work in "production server"

    Hi,

    Try to call web service manually


    "http://myserver/webservice/TreeLoaderService.asmx"



    Do you see anything?
    Vladimir Shcheglov
    Sr. Developer
  5. #5

    RE: TreePanel WebService Loader doesn't work in "production server"

    As well, crack open Fiddler and watch the Ajax requests. Is there a request failure happening? 404 error? Exception being thrown?

    Or, useing Firefox with Firebug installed will get you the same information.


    Maybe there's a security issue with the request and it's throwing an Exception which causes a failure on the return trip (response).


    Fiddler and Firebug should shed some light on the problem.


    Geoffrey McGill
    Founder & CEO
  6. #6

    RE: TreePanel WebService Loader doesn't work in "production server"

    Hi guys !

    Thanks for the quick responses.

    Vladsch, when I call the webservice manually, I can see it OK.

    Geoffrey, I'm agree with you. I also think that it's an issue of security or something like that, because today I use the handler loader, and this way the PanelTree loads successfully.

    Sooner I can, I post the Fiddler tests, so you can check it out and figure out what is happening.

    Again, thank you so much.

    Cheers !
    Alfonso Penunuri.

Similar Threads

  1. [CLOSED] Ext.Net status unlicensed in production server
    By sbg in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Aug 03, 2012, 5:44 PM
  2. [CLOSED] Migrating to 2: TreePanel loader
    By PhilG in forum 2.x Legacy Premium Help
    Replies: 11
    Last Post: May 18, 2012, 3:24 PM
  3. Replies: 7
    Last Post: Oct 20, 2011, 11:35 AM
  4. TreePanel - load root with loader
    By pintun in forum 1.x Help
    Replies: 2
    Last Post: Apr 14, 2010, 8:19 PM
  5. TreePanel Ajax Method Loader by code
    By Mickna in forum Examples and Extras
    Replies: 6
    Last Post: Jan 05, 2010, 11:34 PM

Posting Permissions