Coolite.AjaxMethod.request webservice only only works on localhost?

Page 1 of 2 12 LastLast
  1. #1

    Coolite.AjaxMethod.request webservice only only works on localhost?

    Hi Everyone,

    I'm new to the coolite world. I'm using the Coolite.ajaxmethod.request to make a request of my web service and return some HTML content. It all works perfectly when developing locally...but when I copy it to the server, the site loads, but the web service calls don't work. I put break points in the web service (in the same directory as my web page), and code never reaches the web service methods.

    Should be something easy...not sure what the issue is.

    thanks for any help!
    Dan

    
    
    
    function UpdateAboutSection(activeMode)</p>
    
    
    {</p>
    
    
    Coolite.AjaxMethod.request({</p>
    
    
    url : "WebService.asmx/GetAboutSection",</p>
    
    
    cleanRequest : true,</p>
    
    
    params : {</p>
    
    
    currentMode : activeMode</p>
    
    
    },</p>
    
    
    // success : function (result) {</p>
    
    
    // Ext.Msg.alert("Message", Ext.DomQuery.selectValue("string", result, ""));</p>
    
    
    success : onUpdateAboutSectionSuccess</p>
    
    
    ,</p>
    
    
    eventMask: {</p>
    
    
    showMask: true,</p>
    
    
    target:"customtarget",</p>
    
    
    customTarget:"ctl00_MainContentPlaceHolder_CommunityPanel",</p>
    
    
    // minDelay: 500,</p>
    
    
    msg: "Preparing About Info..."</p>
    
    
    }</p>
    
    
    });</p>
    
    
    }</p>
  2. #2

    RE: Coolite.AjaxMethod.request webservice only only works on localhost?

    Hi geodan,

    Welcome!


    Your code looks ok. Try checking the following...


    1. Ensure you have compiled your app and uploaded all the .dll's from the /bin/ directory to your applications /bin/ directory on the webserver.


    2. Ensure you upload you web.config.


    3. Run the .aspx in Firefox with Firebug installed. When the AjaxRequest is made, you should be able to see it in Firebug. Maybe there's a JavaScript error being thrown. Maybe the Request is throwing an Exception somewhere.


    4. You can also configure a 'failure' function to fire in the AjaxMethod.


    Example


    failure : function () { console.log('FAIL', arguments); }

    Try those ideas and post an update. We might need to see a full .aspx and .asmx code sample to determine 100%, although if it's working locally and not server-side I suspect your code is fine.


    Geoffrey McGill
    Founder
  3. #3

    RE: Coolite.AjaxMethod.request webservice only only works on localhost?

    Are you running IIS7 on the webserver, If yes, the following web.config sections should be added, see
    http://forums.ext.net/showthread.php?6999#post27793
    Last edited by geoffrey.mcgill; Jan 10, 2011 at 5:54 PM.
    Geoffrey McGill
    Founder
  4. #4

    RE: Coolite.AjaxMethod.request webservice only only works on localhost?

    I will check those things...but another thing...I have Visual Studio on the server as well, and ran the project through remote desktop and it runs ok on the server when running through the debugger (again, local host)...just not when I access as a website...all other websites work correctly...something fishy is going on. Also, when accessing the web service through regular asp.net (ScriptMethod) notation, the web service works correctly. I'll check out the "coolite failure handler" and see if anything comes back...
  5. #5

    RE: Coolite.AjaxMethod.request webservice only only works on localhost?

    Well, I tried using Firebug, and I see that all the requests I'm making using the regular asp.net scriptManager seem to be working fine. The ajax requests I'm making to the web service via Coolite are failing with "500 INTERNAL SERVER ERROR". It's strange because it works on localhost on both my laptop, as well as the server (ran locally).

    Ideas?

    Oh, and I'm running IIS6.0. I've never had any issues with copying up my websites from my laptop to the server. Just to note, I'm using a regular Asp.net script manager in addition to the coolite one...shouldn't be the issue...just mentioning.
  6. #6

    RE: Coolite.AjaxMethod.request webservice only only works on localhost?

    Any other ideas? We'd like to use Coolite. If it works, it'll save us some time.

    I suppose the layout controls work, so at least I could use those, and then just use the regular ASP.NET ajax control toolkit to make my web service calls...but ideally i'd get the coolite thing working.
  7. #7

    RE: Coolite.AjaxMethod.request webservice only only works on localhost?

    Hi,

    Using webservice with ajax methods is not a problem. Please see the following sample

    https://examples1.ext.net/#/Events/D...ds/WebService/

    What signature of your webservice method? What is 'activeMode'?
    Please provide full test sample which demonstrates the problem
    Last edited by geoffrey.mcgill; Jan 10, 2011 at 5:55 PM.
  8. #8

    RE: Coolite.AjaxMethod.request webservice only only works on localhost?



    Thanks for responding...

    Yes, I've seen the help, and I've had success on localhost. Here is some of my code that won't work via the internet (i.e. not localhost). Remember, it doesn't even reach the web service...so obviously something with that is messed up, but not sure why the localhost vs the internet. I copy up websites all the time to my server with no problems...

    //Here is one of the web service methods (it assembles an HTML table with an image in it, nothing major at all)
    
    
    [WebMethod]
    [ScriptMethod]
        public string GetAboutSection(string currentMode)
        {
            string htmlContent = "";
            MembershipUser User = Membership.GetUser();
            var db = new DataClassesDataContext(ConfigurationManager.ConnectionStrings["Climate1StopConnString"].ConnectionString);
    
    
            if (User == null)
            {
                htmlContent += GetAboutInfo();
            }
            else
            {
                htmlContent += GetAboutInfo();
            }
    
    
            return currentMode + "|~|" + htmlContent;
        }
    
    
     
    
    
    //Here is the javascript coolite ajax request (currentMode is just a string)
    function UpdateAboutSection(activeMode)
    {
        Coolite.AjaxMethod.request({
                    url          : "Climate1StopWebService.asmx/GetAboutSection",
                    cleanRequest : true,
                    params       : {
                        currentMode : activeMode
                    },
    //                success      : function (result) {
    //                    Ext.Msg.alert("Message", Ext.DomQuery.selectValue("string", result, ""));
                    success      : onUpdateAboutSectionSuccess
                    ,
                    eventMask: {
                            showMask: true,
                            target:"customtarget",
                            customTarget:"ctl00_MainContentPlaceHolder_CommunityPanel",
                           // minDelay: 500,
                            msg: "Preparing About Info..."
                        }
    
    
                });
    }
    
    
    //Here is the success handler javascript (it just gets the "content" and puts it in one of the panels)
    function onUpdateAboutSectionSuccess(result)
    {
        var strResult=Ext.DomQuery.selectValue("string", result, "");
        if (strResult!=""){
             var elem;
            if (strResult.indexOf("|~|")!=-1)
            {
                var resultParts = strResult.split("|~|");
                var sentMode = resultParts[0];
                var content = resultParts[1];
                
                if (sentMode.toUpperCase()==activeMode.toUpperCase()){
                    var communityPanel = Ext.getCmp("ctl00_MainContentPlaceHolder_CommunityPanel");
                   communityPanel.getBody().update(content);
                    //elem = $find(panel);
                   // elem._childDiv.innerHTML = result;
                }
                      
            }
            else
            {
                //Just put the HTML into the appropriate panels, we're not concerned about whether the user switched modes
                //during the send/receive process
                //elem = $find(context);
                //elem._childDiv.innerHTML = result;
            }
       }
        //alert(Ext.DomQuery.selectValue("string", result, ""));
    }
  9. #9

    RE: Coolite.AjaxMethod.request webservice only only works on localhost?

    Hi,

    If you try open 'Climate1StopWebService.asmx' directly in the browser (you should see test page) and try to call 'GetAboutSection' then what result do you get?
  10. #10

    RE: Coolite.AjaxMethod.request webservice only only works on localhost?

    I see the list of web methods. They all work using the regular asp.net ajax control toolkit. The test page that comes up doesn't allow you to test it through the browser, except on the localhost.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 7
    Last Post: Nov 29, 2011, 7:07 AM
  2. [CLOSED] [1.2] Force request from WebService-ComboBox
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 22, 2011, 12:35 PM
  3. [CLOSED] DirectMethods.Request+webservice
    By farisqadadeh in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 06, 2011, 7:13 AM
  4. Replies: 6
    Last Post: Dec 04, 2009, 11:01 PM
  5. [CLOSED] How to get Jason request from WebService
    By acrossdev in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 22, 2009, 9:59 AM

Posting Permissions