Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Second Post but no Reply (Webservice in Firefox)

Second Post but no Reply (Webservice in Firefox)

Scheduled Pinned Locked Moved ASP.NET
questionhelpcsharpjavascript
20 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Abubakarsb
    wrote on last edited by
    #1

    Good Morning, Friends, This is first time that I haven't got any reply of my post even after 26 hours nomally I get within one hour. My question could be tricky but not lengthy (I think) so here I am repeating my question again. I hope I will get answer this time. Please. It is urgent. I am calling a .Net webservice in javascript by using "webservice.htc". It is working perfectly in IE 6 and 7 but unfortunately not in Firefox. I need to fix this problem in firefox. Please tell me solution how can I call a webservice using javascript in Mozilla Firefox browser? Please. Kind Regards, Abubakar

    S M 2 Replies Last reply
    0
    • A Abubakarsb

      Good Morning, Friends, This is first time that I haven't got any reply of my post even after 26 hours nomally I get within one hour. My question could be tricky but not lengthy (I think) so here I am repeating my question again. I hope I will get answer this time. Please. It is urgent. I am calling a .Net webservice in javascript by using "webservice.htc". It is working perfectly in IE 6 and 7 but unfortunately not in Firefox. I need to fix this problem in firefox. Please tell me solution how can I call a webservice using javascript in Mozilla Firefox browser? Please. Kind Regards, Abubakar

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      Hi Abubakar, The question comes up again and again, but nowhere in the web seems to be the correct answer (although I describe it in my German JavaScript book since quite some time). The topic is using JavaScript to call Web Services from within Mozilla type browsers. Whereas this is quite well-documented and works more or less seamlessly with PHP Web Services, .NET Web Services are problematic. Calling the Web Service works, as does parsing the return data. However, on the server end, only empty parameters arrive. The trick is to manually set the type for the parameters you are sending to the server. So after creating a parameter: var p = new SOAPParameter(value, name); Then, you load the correct type; in this case, I am using string, but you could use other schema types like integer, as well: var enc = new SOAPEncoding(); enc = senc.getAssociatedEncoding( "http://schemas.xmlsoap.org/soap/encoding/", false); var coll = enc.schemaCollection; var type = coll.getType( "string", "http://www.microsoft.com"); Finally, you link the type to the parameter: p.schemaType = type; And that's it! The rest is business as usual: Instantiate the SOAPCall class, set the required properties, call encode(), call asyncInvoke(), implement a callback function, and you are done. By the way: When using the Atlas framework, you do not need this browser-specific code any more; calling .NET Web Services works in a browser-agnostic fashion here.

      SSK.

      A 1 Reply Last reply
      0
      • S Sathesh Sakthivel

        Hi Abubakar, The question comes up again and again, but nowhere in the web seems to be the correct answer (although I describe it in my German JavaScript book since quite some time). The topic is using JavaScript to call Web Services from within Mozilla type browsers. Whereas this is quite well-documented and works more or less seamlessly with PHP Web Services, .NET Web Services are problematic. Calling the Web Service works, as does parsing the return data. However, on the server end, only empty parameters arrive. The trick is to manually set the type for the parameters you are sending to the server. So after creating a parameter: var p = new SOAPParameter(value, name); Then, you load the correct type; in this case, I am using string, but you could use other schema types like integer, as well: var enc = new SOAPEncoding(); enc = senc.getAssociatedEncoding( "http://schemas.xmlsoap.org/soap/encoding/", false); var coll = enc.schemaCollection; var type = coll.getType( "string", "http://www.microsoft.com"); Finally, you link the type to the parameter: p.schemaType = type; And that's it! The rest is business as usual: Instantiate the SOAPCall class, set the required properties, call encode(), call asyncInvoke(), implement a callback function, and you are done. By the way: When using the Atlas framework, you do not need this browser-specific code any more; calling .NET Web Services works in a browser-agnostic fashion here.

        SSK.

        A Offline
        A Offline
        Abubakarsb
        wrote on last edited by
        #3

        HI, Thanks for this article, I have already seen this article and tried as well. It gives me error on very first line. var p = new SOAPParameter(value, name); I think browser doesn't recognise this. I neither understand this line, It will be really nice if you explain this little bit more or give a short example; "The rest is business as usual: Instantiate the SOAPCall class, set the required properties, call encode(), call asyncInvoke(), implement a callback function, and you are done." Regards, Abubakar

        1 Reply Last reply
        0
        • A Abubakarsb

          Good Morning, Friends, This is first time that I haven't got any reply of my post even after 26 hours nomally I get within one hour. My question could be tricky but not lengthy (I think) so here I am repeating my question again. I hope I will get answer this time. Please. It is urgent. I am calling a .Net webservice in javascript by using "webservice.htc". It is working perfectly in IE 6 and 7 but unfortunately not in Firefox. I need to fix this problem in firefox. Please tell me solution how can I call a webservice using javascript in Mozilla Firefox browser? Please. Kind Regards, Abubakar

          M Offline
          M Offline
          Michael Sync
          wrote on last edited by
          #4

          Abubakarsb wrote:

          I am calling a .Net webservice in javascript by using "webservice.htc". It is working perfectly in IE 6 and 7 but unfortunately not in Firefox.

          As I told you, *.htc doesnt work on non-IE browsers.

          Abubakarsb wrote:

          lease tell me solution how can I call a webservice using javascript in Mozilla Firefox browser?

          Okay. you can call a webservice by using XMLHttpRequest Object.. Example ~ var req; var isIE; function initRequest(url) { if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { isIE = true; req = new ActiveXObject("Microsoft.XMLHTTP"); } } //url will be Web Service URL. function CallWebService(url) { initRequest(url); req.onreadystatechange = processRequest; req.open("POST", url, true); req.setRequestHeader("Content-Type", "text/xml"); req.send(null); } function processRequest() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseXML; //Result in XML. } } } Note: #1. The parameter called "url" of "CallWebService" method is the URL of Web Service. #2. You should use "POST" if you wanna invoke the .NET Web Service. AFAIK, the .NET Web service used "HTTP POST" by default. If you wanna use "HTTP GET", you have to change the setting in Web.Config.

          Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

          A 1 Reply Last reply
          0
          • M Michael Sync

            Abubakarsb wrote:

            I am calling a .Net webservice in javascript by using "webservice.htc". It is working perfectly in IE 6 and 7 but unfortunately not in Firefox.

            As I told you, *.htc doesnt work on non-IE browsers.

            Abubakarsb wrote:

            lease tell me solution how can I call a webservice using javascript in Mozilla Firefox browser?

            Okay. you can call a webservice by using XMLHttpRequest Object.. Example ~ var req; var isIE; function initRequest(url) { if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { isIE = true; req = new ActiveXObject("Microsoft.XMLHTTP"); } } //url will be Web Service URL. function CallWebService(url) { initRequest(url); req.onreadystatechange = processRequest; req.open("POST", url, true); req.setRequestHeader("Content-Type", "text/xml"); req.send(null); } function processRequest() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseXML; //Result in XML. } } } Note: #1. The parameter called "url" of "CallWebService" method is the URL of Web Service. #2. You should use "POST" if you wanna invoke the .NET Web Service. AFAIK, the .NET Web service used "HTTP POST" by default. If you wanna use "HTTP GET", you have to change the setting in Web.Config.

            Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

            A Offline
            A Offline
            Abubakarsb
            wrote on last edited by
            #5

            Thanks a lot for brief reply Michael, I checked it, this is so far so good. There is no javascript error which is great. Now I want to call a "WebMethod" named "testWebService" from my webservice and want to pass and get some values from "testWebService". How is it possible? Plz.

            M 1 Reply Last reply
            0
            • A Abubakarsb

              Thanks a lot for brief reply Michael, I checked it, this is so far so good. There is no javascript error which is great. Now I want to call a "WebMethod" named "testWebService" from my webservice and want to pass and get some values from "testWebService". How is it possible? Plz.

              M Offline
              M Offline
              Michael Sync
              wrote on last edited by
              #6

              Javascript (How to call .NET Web Service from pure javascript)

              var req;
              var isIE;

                  function initRequest() {
                  if (window.XMLHttpRequest) {
                  req = new XMLHttpRequest();
                  } else if (window.ActiveXObject) {
                  isIE = true;
                  req = new ActiveXObject("Microsoft.XMLHTTP");
                  }
                  }
              
                  //url will be Web Service URL.
              
                  function CallWebService(url,params) {
              
                  initRequest();
              
                  req.onreadystatechange = processRequest;
                  req.open("POST", url, true);
                  if(params!=null)req.setRequestHeader("Content-length", params.length);
                  req.setRequestHeader("Connection", "close");
                  req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");        
                  req.send(params);
                  }
              
                  function processRequest() {
                  if (req.readyState == 4) {
                  if (req.status == 200) {
                     var message = req.responseXML; //Result in XML.
                  }
                  }
                  }
              

              HTML (How to call Javascript function ) <input type="button" value="Call .NET Web Service!" onclick="CallWebService('http://localhost:2943/WebSite1/WebService.asmx/testWebService1',null)" /> <br //> <input type="button" value="Call .NET Web Service with parameters!" onclick="CallWebService('http://localhost:2943/WebSite1/WebService.asmx/testWebService2','a=Michael&b=5')" //> Web Service using System; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; /// /// Summary description for WebService /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class WebService : System.Web.Services.WebService { public WebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string testWebService2(string a,int b) { return "Hello World " + a + " - " + b.ToString(); } [WebMethod] public string testWebService1() { return "Hello World "; } } Hope it helps.. If it is helpful for you, please vote the message. Thanks.

              Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbe

              M A 2 Replies Last reply
              0
              • M Michael Sync

                Javascript (How to call .NET Web Service from pure javascript)

                var req;
                var isIE;

                    function initRequest() {
                    if (window.XMLHttpRequest) {
                    req = new XMLHttpRequest();
                    } else if (window.ActiveXObject) {
                    isIE = true;
                    req = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    }
                
                    //url will be Web Service URL.
                
                    function CallWebService(url,params) {
                
                    initRequest();
                
                    req.onreadystatechange = processRequest;
                    req.open("POST", url, true);
                    if(params!=null)req.setRequestHeader("Content-length", params.length);
                    req.setRequestHeader("Connection", "close");
                    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");        
                    req.send(params);
                    }
                
                    function processRequest() {
                    if (req.readyState == 4) {
                    if (req.status == 200) {
                       var message = req.responseXML; //Result in XML.
                    }
                    }
                    }
                

                HTML (How to call Javascript function ) <input type="button" value="Call .NET Web Service!" onclick="CallWebService('http://localhost:2943/WebSite1/WebService.asmx/testWebService1',null)" /> <br //> <input type="button" value="Call .NET Web Service with parameters!" onclick="CallWebService('http://localhost:2943/WebSite1/WebService.asmx/testWebService2','a=Michael&b=5')" //> Web Service using System; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; /// /// Summary description for WebService /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class WebService : System.Web.Services.WebService { public WebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string testWebService2(string a,int b) { return "Hello World " + a + " - " + b.ToString(); } [WebMethod] public string testWebService1() { return "Hello World "; } } Hope it helps.. If it is helpful for you, please vote the message. Thanks.

                Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbe

                M Offline
                M Offline
                Michael Sync
                wrote on last edited by
                #7

                Note: Even though I'm sure that it can be done with pure Javascript, it is toooo much work to do if your project is big. So, I would like to suggest you to try some Ajax frameworks (ASP.NET Ajax)or Javascrpt framework (Prototype javascript library)....

                Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                A 1 Reply Last reply
                0
                • M Michael Sync

                  Javascript (How to call .NET Web Service from pure javascript)

                  var req;
                  var isIE;

                      function initRequest() {
                      if (window.XMLHttpRequest) {
                      req = new XMLHttpRequest();
                      } else if (window.ActiveXObject) {
                      isIE = true;
                      req = new ActiveXObject("Microsoft.XMLHTTP");
                      }
                      }
                  
                      //url will be Web Service URL.
                  
                      function CallWebService(url,params) {
                  
                      initRequest();
                  
                      req.onreadystatechange = processRequest;
                      req.open("POST", url, true);
                      if(params!=null)req.setRequestHeader("Content-length", params.length);
                      req.setRequestHeader("Connection", "close");
                      req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");        
                      req.send(params);
                      }
                  
                      function processRequest() {
                      if (req.readyState == 4) {
                      if (req.status == 200) {
                         var message = req.responseXML; //Result in XML.
                      }
                      }
                      }
                  

                  HTML (How to call Javascript function ) <input type="button" value="Call .NET Web Service!" onclick="CallWebService('http://localhost:2943/WebSite1/WebService.asmx/testWebService1',null)" /> <br //> <input type="button" value="Call .NET Web Service with parameters!" onclick="CallWebService('http://localhost:2943/WebSite1/WebService.asmx/testWebService2','a=Michael&b=5')" //> Web Service using System; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; /// /// Summary description for WebService /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class WebService : System.Web.Services.WebService { public WebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string testWebService2(string a,int b) { return "Hello World " + a + " - " + b.ToString(); } [WebMethod] public string testWebService1() { return "Hello World "; } } Hope it helps.. If it is helpful for you, please vote the message. Thanks.

                  Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbe

                  A Offline
                  A Offline
                  Abubakarsb
                  wrote on last edited by
                  #8

                  Thanks for code. So far It is great there in no javascript error in IE6 and Firefox as well. Only thing which I am missing is that I couln't find any code to receive value from webservice and use here in Javascript. Please tell me how can I catch value returned by webservice? I also tried this but in vain. function processRequest() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseXML; //Result in XML. alert(message); } } }

                  A 1 Reply Last reply
                  0
                  • A Abubakarsb

                    Thanks for code. So far It is great there in no javascript error in IE6 and Firefox as well. Only thing which I am missing is that I couln't find any code to receive value from webservice and use here in Javascript. Please tell me how can I catch value returned by webservice? I also tried this but in vain. function processRequest() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseXML; //Result in XML. alert(message); } } }

                    A Offline
                    A Offline
                    Abubakarsb
                    wrote on last edited by
                    #9

                    My project is not so big, I just need to call some webservices and return their data to javascript. That's all. I think it could be best solution which we are trying because It is almost done.

                    1 Reply Last reply
                    0
                    • M Michael Sync

                      Note: Even though I'm sure that it can be done with pure Javascript, it is toooo much work to do if your project is big. So, I would like to suggest you to try some Ajax frameworks (ASP.NET Ajax)or Javascrpt framework (Prototype javascript library)....

                      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                      A Offline
                      A Offline
                      Abubakarsb
                      wrote on last edited by
                      #10

                      Hi Friend, I just checked one thing, In following code I am getting status value 500 but not 200 which is require. so what could be wrong? function processRequest() { if (req.readyState == 4) { alert(req.status); } }

                      M 1 Reply Last reply
                      0
                      • A Abubakarsb

                        Hi Friend, I just checked one thing, In following code I am getting status value 500 but not 200 which is require. so what could be wrong? function processRequest() { if (req.readyState == 4) { alert(req.status); } }

                        M Offline
                        M Offline
                        Michael Sync
                        wrote on last edited by
                        #11

                        You can use "statusText" to know what problem is. eg: alert("Problem: " + req.statusText);

                        Internal Error 500 The server encountered an unexpected condition which prevented it from fulfilling the request.

                        I would like to suggest you one thing. It is better if you try this in new project. #1. Create Web Project (C#) #2. Add Web Service item to your web project. #3. Paste Web Service Code that I gave you. #4. Rebuild the application and test whether your web service is working fine or not.. (If you don't know know how to test the web service, I will tell you one simple way. Click "Add Web Reference" and find the web service. If you found the correct web service, click to this link. it will show two functions (testwebservice1 and testwebservice2). then, click on this link and type some data and click "Invoke" button. ) #5. If those steps above are working fine, paste the javascript code to your aspx page. and paste the HTML code. #6. Check the url whether it is correct or not. (the url from sample might not be matched with the actual URL of your project) #7. then, try to invoke the function which has no parameter first.... if it is working fine, try another function with argument... if you are still getting the error, let me know which step you got error... The code that I gave you has been tested with Visual Studio 2005 on Windows XP. It is working fine. Please try first with my code without modifying anything... if it works then you can carry on with your code.... 3

                        Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                        A 3 Replies Last reply
                        0
                        • M Michael Sync

                          You can use "statusText" to know what problem is. eg: alert("Problem: " + req.statusText);

                          Internal Error 500 The server encountered an unexpected condition which prevented it from fulfilling the request.

                          I would like to suggest you one thing. It is better if you try this in new project. #1. Create Web Project (C#) #2. Add Web Service item to your web project. #3. Paste Web Service Code that I gave you. #4. Rebuild the application and test whether your web service is working fine or not.. (If you don't know know how to test the web service, I will tell you one simple way. Click "Add Web Reference" and find the web service. If you found the correct web service, click to this link. it will show two functions (testwebservice1 and testwebservice2). then, click on this link and type some data and click "Invoke" button. ) #5. If those steps above are working fine, paste the javascript code to your aspx page. and paste the HTML code. #6. Check the url whether it is correct or not. (the url from sample might not be matched with the actual URL of your project) #7. then, try to invoke the function which has no parameter first.... if it is working fine, try another function with argument... if you are still getting the error, let me know which step you got error... The code that I gave you has been tested with Visual Studio 2005 on Windows XP. It is working fine. Please try first with my code without modifying anything... if it works then you can carry on with your code.... 3

                          Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                          A Offline
                          A Offline
                          Abubakarsb
                          wrote on last edited by
                          #12

                          I tried same way as u said even with your code and I created a new project as well. It is really strange. I am using following statement. It works perfectly in IE6 and IE7 as well but unfortunately not in Firefox which I really need. Also tell me how can I get value from that specific xml tag but this is next step. function processRequest() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseXML; //Result in XML. alert(message.xml); } } }

                          1 Reply Last reply
                          0
                          • M Michael Sync

                            You can use "statusText" to know what problem is. eg: alert("Problem: " + req.statusText);

                            Internal Error 500 The server encountered an unexpected condition which prevented it from fulfilling the request.

                            I would like to suggest you one thing. It is better if you try this in new project. #1. Create Web Project (C#) #2. Add Web Service item to your web project. #3. Paste Web Service Code that I gave you. #4. Rebuild the application and test whether your web service is working fine or not.. (If you don't know know how to test the web service, I will tell you one simple way. Click "Add Web Reference" and find the web service. If you found the correct web service, click to this link. it will show two functions (testwebservice1 and testwebservice2). then, click on this link and type some data and click "Invoke" button. ) #5. If those steps above are working fine, paste the javascript code to your aspx page. and paste the HTML code. #6. Check the url whether it is correct or not. (the url from sample might not be matched with the actual URL of your project) #7. then, try to invoke the function which has no parameter first.... if it is working fine, try another function with argument... if you are still getting the error, let me know which step you got error... The code that I gave you has been tested with Visual Studio 2005 on Windows XP. It is working fine. Please try first with my code without modifying anything... if it works then you can carry on with your code.... 3

                            Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                            A Offline
                            A Offline
                            Abubakarsb
                            wrote on last edited by
                            #13

                            OH, Brother It is working now in Firefox as well. This is great. Let me have some more tests tomorrow with my webservice then I will post final in the forum. Meanwhile If I have poblem I will come to you again please don't mind. In the end, I just want to say U a lot of THANKS for your time and nice replys. You don't know how much you help me. GOD ALWAYS BLESS U and KEEP U HAPPY. See U Tomorrow then, Have a nice Evening. Bye Abubakar

                            1 Reply Last reply
                            0
                            • M Michael Sync

                              You can use "statusText" to know what problem is. eg: alert("Problem: " + req.statusText);

                              Internal Error 500 The server encountered an unexpected condition which prevented it from fulfilling the request.

                              I would like to suggest you one thing. It is better if you try this in new project. #1. Create Web Project (C#) #2. Add Web Service item to your web project. #3. Paste Web Service Code that I gave you. #4. Rebuild the application and test whether your web service is working fine or not.. (If you don't know know how to test the web service, I will tell you one simple way. Click "Add Web Reference" and find the web service. If you found the correct web service, click to this link. it will show two functions (testwebservice1 and testwebservice2). then, click on this link and type some data and click "Invoke" button. ) #5. If those steps above are working fine, paste the javascript code to your aspx page. and paste the HTML code. #6. Check the url whether it is correct or not. (the url from sample might not be matched with the actual URL of your project) #7. then, try to invoke the function which has no parameter first.... if it is working fine, try another function with argument... if you are still getting the error, let me know which step you got error... The code that I gave you has been tested with Visual Studio 2005 on Windows XP. It is working fine. Please try first with my code without modifying anything... if it works then you can carry on with your code.... 3

                              Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                              A Offline
                              A Offline
                              Abubakarsb
                              wrote on last edited by
                              #14

                              Sorry Brother I got little bit more excited. I am having this error message when I tried to use my code. "Problem:Internal Server Error" Do u know what could be reason? My webservice exists at following address and I am calling this from the same location. Here is code. <input type="button" value="Call .NET Web Service!" onclick="CallWebService('http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx/testWebService','testVar=SUCCESS')" /> Any Idea? Please suggest. Thanks. Abubakar

                              M 1 Reply Last reply
                              0
                              • A Abubakarsb

                                Sorry Brother I got little bit more excited. I am having this error message when I tried to use my code. "Problem:Internal Server Error" Do u know what could be reason? My webservice exists at following address and I am calling this from the same location. Here is code. <input type="button" value="Call .NET Web Service!" onclick="CallWebService('http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx/testWebService','testVar=SUCCESS')" /> Any Idea? Please suggest. Thanks. Abubakar

                                M Offline
                                M Offline
                                Michael Sync
                                wrote on last edited by
                                #15

                                Abubakarsb wrote:

                                http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx/testWebService','testVar=SUCCESS')"

                                The HTML file (or aspx) and Webservice are in same domain?? I mean, if your web service is in http://192.114.169.164 then the HTML or aspx which invoke the webservice should be in http://192.114.169.164 too.. Thats mean you should be able to access like http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx/testWebService and http://192.114.169.164/myAjaxPage.aspx. Because it is not allowed to invode the Cross-sites by using XMLHttpRequest object.. (I have a problem in explaining things to other people. :) I don't know how to say/write clearly. :) ) So, put the test file in same place where your web service is stored and try to test againn... btw, Have you tested your web service thought "web reference" dialog (as I mentioned in last thread)? I hope your webservice is working fine. Good Luck.

                                Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                                A 1 Reply Last reply
                                0
                                • M Michael Sync

                                  Abubakarsb wrote:

                                  http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx/testWebService','testVar=SUCCESS')"

                                  The HTML file (or aspx) and Webservice are in same domain?? I mean, if your web service is in http://192.114.169.164 then the HTML or aspx which invoke the webservice should be in http://192.114.169.164 too.. Thats mean you should be able to access like http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx/testWebService and http://192.114.169.164/myAjaxPage.aspx. Because it is not allowed to invode the Cross-sites by using XMLHttpRequest object.. (I have a problem in explaining things to other people. :) I don't know how to say/write clearly. :) ) So, put the test file in same place where your web service is stored and try to test againn... btw, Have you tested your web service thought "web reference" dialog (as I mentioned in last thread)? I hope your webservice is working fine. Good Luck.

                                  Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                                  A Offline
                                  A Offline
                                  Abubakarsb
                                  wrote on last edited by
                                  #16

                                  Friend, I put the project online. I put the same code in it which you sent me. You can also check urself, it is not returning right status. It is behaving dramatically different in IE and Firefox. In IE it is returning status value 500 while 411 in Firefox. I request you to check it in both IE and Firefox. In following file I am calling websevice by name only without full URL as both files (Webservice and .aspx file) exist in same folder. http://192.114.169.164/Customers/NL/testWebservice/Default.aspx[^] And in the following page I am calling webservice through full URL path with IP etc. http://192.114.169.164/Customers/NL/testWebservice/testWebService.aspx[^] One thing more both these files work perfectly on local computer but not on internet. Please check both links and tell me where I am doing wrong. Plz.

                                  M 1 Reply Last reply
                                  0
                                  • A Abubakarsb

                                    Friend, I put the project online. I put the same code in it which you sent me. You can also check urself, it is not returning right status. It is behaving dramatically different in IE and Firefox. In IE it is returning status value 500 while 411 in Firefox. I request you to check it in both IE and Firefox. In following file I am calling websevice by name only without full URL as both files (Webservice and .aspx file) exist in same folder. http://192.114.169.164/Customers/NL/testWebservice/Default.aspx[^] And in the following page I am calling webservice through full URL path with IP etc. http://192.114.169.164/Customers/NL/testWebservice/testWebService.aspx[^] One thing more both these files work perfectly on local computer but not on internet. Please check both links and tell me where I am doing wrong. Plz.

                                    M Offline
                                    M Offline
                                    Michael Sync
                                    wrote on last edited by
                                    #17

                                    I have checked your webservice file. http://192.114.169.164/Customers/NL/testWebservice/WebService.asmx Your web service file is not working properly. It is giving me the errors. So, I suggest you to check your web service to make error clean. When we are accessing the webservice url, it should give the list of functions available in that service... now, your webservice file is returning the error.... so, Please fix this webservice file first..

                                    Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                                    A 1 Reply Last reply
                                    0
                                    • M Michael Sync

                                      I have checked your webservice file. http://192.114.169.164/Customers/NL/testWebservice/WebService.asmx Your web service file is not working properly. It is giving me the errors. So, I suggest you to check your web service to make error clean. When we are accessing the webservice url, it should give the list of functions available in that service... now, your webservice file is returning the error.... so, Please fix this webservice file first..

                                      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                                      A Offline
                                      A Offline
                                      Abubakarsb
                                      wrote on last edited by
                                      #18

                                      Hi, I used a new webservice now http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx[^] and this is working really good in all the browsers. Today at night I will implement my real code and I hope it will work there as well. If not I will bother u again (Don't mind). If it works I will post its soution in the forums as well. Thanks a lot for your consistent help. GOD BLESS U. Bye

                                      M 1 Reply Last reply
                                      0
                                      • A Abubakarsb

                                        Hi, I used a new webservice now http://192.114.169.164/customers/nl/Hotmale/PPMService.asmx[^] and this is working really good in all the browsers. Today at night I will implement my real code and I hope it will work there as well. If not I will bother u again (Don't mind). If it works I will post its soution in the forums as well. Thanks a lot for your consistent help. GOD BLESS U. Bye

                                        M Offline
                                        M Offline
                                        Michael Sync
                                        wrote on last edited by
                                        #19

                                        I'm glad to hear that your problem is solved. If my post is helpful for you, don't forget to vote it. Thanks. :)

                                        Abubakarsb wrote:

                                        If not I will bother u again (Don't mind).

                                        Yeah. sure. We all here are trying to help as much as we can.. :) All the best!!

                                        Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                                        M 1 Reply Last reply
                                        0
                                        • M Michael Sync

                                          I'm glad to hear that your problem is solved. If my post is helpful for you, don't forget to vote it. Thanks. :)

                                          Abubakarsb wrote:

                                          If not I will bother u again (Don't mind).

                                          Yeah. sure. We all here are trying to help as much as we can.. :) All the best!!

                                          Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                                          M Offline
                                          M Offline
                                          Michael Sync
                                          wrote on last edited by
                                          #20

                                          seem like someone hate me about this post... cuz i got vote 1... :)

                                          Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups