Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

Last post 05-06-2008 8:56 PM by Ed Hastings. 11 replies.

Sort Posts:

  • Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    07-12-2007, 1:30 PM
    • Loading...
    • KowDot
    • Joined on 02-09-2006, 3:25 AM
    • Posts 107

    I've written a webservice to track clicks on my site. The links simply call the Clicked javascript funtion which calls my webservice. Everything works great except that I get the error below in FF (IE works fine) which causes OnComplete to not be fired. There are stacks of references on the web to this but I'm a complete newbie to AJAX and I'm losing my hair! Any ideas please.

      [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: http://localhost/MyApp/ScriptResource.axd?d=sNf-S_qpfQuvJ7CNt07NjBZkuTP1bFju3HNBVvz2rGx1Tcgj1oT5yim_zNFYPY02gAMr466-mrpW4_33Ns8IcukVGR7Ev8cL5jTpYGe5KbQ1&t=633198502904062500 :: Sys$Net$XMLHttpExecutor$get_statusCode :: line 4166"  data: no]
    http://localhost/MyApp/ScriptResource.axd?d=sNf-S_qpfQuvJ7CNt07NjBZkuTP1bFju3HNBVvz2rGx1Tcgj1oT5yim_zNFYPY02gAMr466-mrpW4_33Ns8IcukVGR7Ev8cL5jTpYGe5KbQ1&t=633198502904062500
    Line 4166

    function Clicked(arg)
    {
      ret = MyWebService.Clicked(arg, OnComplete, OnTimeOut, OnError);
      return(ret);
    }

    function OnComplete(arg)
    {
      return(true);
    }

    function OnTimeOut(arg)
    {
      alert("TimeOut");
    }

    function OnError(arg)
    {
      alert("Error");
    }

     

  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    07-12-2007, 3:51 PM
    • Loading...
    • Vinija
    • Joined on 05-11-2007, 9:45 AM
    • Posts 77

     This error generally indicates no connection with server.

    Assuming your service is on your local host the error might be something else.

    What is needed is that you put your web method declaration on this forum as well so we can assist you
     

    Ran.
    http://blogs.microsoft.co.il/blogs/ranw
  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    07-12-2007, 5:41 PM
    • Loading...
    • KowDot
    • Joined on 02-09-2006, 3:25 AM
    • Posts 107

    Here is my webmethod. It works absolutely great (in both IE and FF) in that it updates my database. It returns correctly in IE if I put an alert into the oncomplete function however the error occurs in Firefox.

    I've just put the code live and its still displaying the error for Firefox in firebug. Don't need it to return anything but even with a standard sub it displays the error.

    Imports System.Web
    Imports System.Web.Services
    Imports System.Web.Services.Protocols

    <WebService(Namespace:="http://tempuri.org/")> _
    <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
    <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
    <System.Web.Script.Services.ScriptService()> _
    Public Class MyWebService
        Inherits System.Web.Services.WebService

        <WebMethod()> _
        Public Function Clicked(ByVal sClicked As String) As String
           

            //Does some stuff to update click counter in database 

            Return "Success"
           
        End Function

  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    07-13-2007, 6:16 PM
    • Loading...
    • KowDot
    • Joined on 02-09-2006, 3:25 AM
    • Posts 107

    Anyone got any ideas please? 

  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    07-18-2007, 5:55 AM

    Hi,

    It seems this is a FireFox specific issue, you may refer to this for a workaround: http://radio.javaranch.com/pascarello/2006/02/07/1139345471027.html

     
    Hope this helps. 

     

    NOTE:This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

     

  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    07-18-2007, 4:37 PM
    • Loading...
    • KowDot
    • Joined on 02-09-2006, 3:25 AM
    • Posts 107

    Thanks. I've read this post but like many others I've no clue how to implement a solution. Any ideas please how to code the solution in conjunction with my posted code?

  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    07-18-2007, 11:48 PM
    Answer

    It seems the code that read the status code is encapsulated in the Microsoft Script Library, may be you have to not register the onError handler if the browser is Firefox.

    For instance:

    function Clicked(arg)
    {
      var ret;

       if( ! browser is firefox)

           ret = MyWebService.Clicked(arg, OnComplete, OnTimeOut, OnError);

       else

            ret = MyWebService.Clicked(arg, OnComplete, OnTimeOut);
      return(ret);
    }

  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    07-19-2007, 5:59 AM
    • Loading...
    • KowDot
    • Joined on 02-09-2006, 3:25 AM
    • Posts 107

    Thanks All-Star, it works great locally and now fires the OnComplete function in firefox but doesn't work on the live site ... I'll have a think.

    function Clicked(arg)
    {
        var ret;
        if (navigator.userAgent.indexOf("Firefox")!=-1)
            ret = MyWebService.Clicked(arg, OnComplete, OnTimeOut, OnError);
        else
            ret = MyWebService.Clicked(arg, OnComplete, OnTimeOut);
        return(ret);
    }

  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    08-22-2007, 7:58 AM
    • Loading...
    • KowDot
    • Joined on 02-09-2006, 3:25 AM
    • Posts 107

    Still no joy with this, think it's a firefox bug? Any ideas please. This post has had 5000+ views so must be a common problem.


    I'm also getting the following error occasionally:

    An unhandled error was caught by Application_Error in /categories/MyService.asmx/js
    System.InvalidOperationException: No web service found at: /categories/MyService.asmx.
       at System.Web.Script.Services.WebServiceData.GetWebServiceData(HttpContext context, String virtualPath, Boolean failIfNoData, Boolean pageMethods)
       at System.Web.Script.Services.WebServiceClientProxyGenerator.GetClientProxyScript(HttpContext context)
       at System.Web.Script.Services.RestClientProxyHandler.ProcessRequest(HttpContext context)
       at System.Web.Script.Services.ScriptHandlerFactory.HandlerWrapper.ProcessRequest(HttpContext context)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Even though I've got the following, i.e. the service is not located in the categories folder: I'm doing some url rewriting so I'm guessing that is the problem.

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">

    <Services>
    <asp:ServiceReference Path="~/WebServices/MyService.asmx" />
    </Services>

    </asp:ScriptManager>

    Filed under:
  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    10-30-2007, 10:14 AM
    • Loading...
    • mcgyver83
    • Joined on 10-30-2007, 2:10 PM
    • Posts 1

     

    I have the same problem and I find the solution whit debug bar and IE debugger.

    My problem was:

     

    initialize: function(options)
        {
            this.nomeForm = 'ricercaForm';
            this.setOptions(options);
        },
       
        setOptions: function(options) {
            this.options = {
                contextPath: window.contextPath,
                alertRemove: "Confermare cancellazione?",
            }
            Object.extend(this.options, options || {});
        },

     

     

    the problem is in a js and is the comma,I delete it and all ok! 

  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    12-01-2007, 6:14 PM

    KowDot:

    Thanks. I've read this post but like many others I've no clue how to implement a solution. Any ideas please how to code the solution in conjunction with my posted code?

     

    Have the same problem. I've done some googling and found really simple solution: call web service using setTimeout!

    like this one:

    function OnComplete(result, eventArgs)
    {
      alert(result);
    }

    function OnError(arg)
    {
      alert('Error');
    }

    function OnMediaUploaded(sender, args)
    {
        setTimeout('CallbackFunctions.MyTestFunction(\'Parameter\', OnComplete, OnError)', 100);
    }

    enjoy :)
     

     

  • Re: Help - Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)

    05-06-2008, 8:56 PM
    • Loading...
    • Ed Hastings
    • Joined on 05-06-2008, 8:49 PM
    • Posts 1

    I ran into this today too. I wasted entirely too much time on it, and in the end this is what it turned out to be for me:

    If you are driving the action off of a asp:button OnClientClick event, the button is getting rendered as an input of type SUBMIT, which causes the button to do a POST. However the asynch callback is doing a GET to get the readystatus. If the POST isn't finished yet the readystate GET is blocked / can't complete. IE eats the error / is less sensitive to it, FF throws NS_ERROR_NOT_AVAILABLE.

     
    To fix, drive the asynch request from an HTML input of type BUTTON on its onclick event instead so that you perform two GETS instead of a POST and a GET; this should fix your problem (assuming that a submit is the cause).

     



     

Page 1 of 1 (12 items)
Microsoft Communities
Page view counter