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. Calling Webservice throught Javascript

Calling Webservice throught Javascript

Scheduled Pinned Locked Moved ASP.NET
helpcsharpjavascriptasp-netquestion
6 Posts 3 Posters 0 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.
  • L Offline
    L Offline
    lovedotnet
    wrote on last edited by
    #1

    Hi, I need to call a webservice through javascript, i am using scripmanager(http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx[^]....it was succesfful when i use webservice in my project..now i need to use a webservice which is running from another machine....i tried to give path to the serviceReference trough code...the path is something like this(http://165.8.15.10/myServices/WebServiceone.asmx), but couldnt solve it...Javascript throws error that "WebServiceone" is undefined.....i have googled and found that we can use .HTC and solve it..is there any other way? or..can anyone help me to solve this??

    C W 2 Replies Last reply
    0
    • L lovedotnet

      Hi, I need to call a webservice through javascript, i am using scripmanager(http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx[^]....it was succesfful when i use webservice in my project..now i need to use a webservice which is running from another machine....i tried to give path to the serviceReference trough code...the path is something like this(http://165.8.15.10/myServices/WebServiceone.asmx), but couldnt solve it...Javascript throws error that "WebServiceone" is undefined.....i have googled and found that we can use .HTC and solve it..is there any other way? or..can anyone help me to solve this??

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I am assuming this code uses AJAX to make the call. I would import the web service using the usual mechanisms so that you end up with a helper class in your project and you just call that.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      L 1 Reply Last reply
      0
      • C Christian Graus

        I am assuming this code uses AJAX to make the call. I would import the web service using the usual mechanisms so that you end up with a helper class in your project and you just call that.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        L Offline
        L Offline
        lovedotnet
        wrote on last edited by
        #3

        Hi...thanks for replying.... i have written "ScriptManagerMain.Services[0].Path = autoFillService.Url;" in the Page_load event. where autoFillService is the object of my webservice....but it couldnt help me out..when i debug it.....i am getting the correct path into the path....can u help me ? thanks, deep.

        C 1 Reply Last reply
        0
        • L lovedotnet

          Hi...thanks for replying.... i have written "ScriptManagerMain.Services[0].Path = autoFillService.Url;" in the Page_load event. where autoFillService is the object of my webservice....but it couldnt help me out..when i debug it.....i am getting the correct path into the path....can u help me ? thanks, deep.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          To be honest, I answered b/c the question was unanswered, I've not looked at this code. It doesn't use AJAX to make a web service call from code behind ? If it does, I am still all for adding a proper web reference and just calling it, then it's just plain AJAX.

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          L 1 Reply Last reply
          0
          • C Christian Graus

            To be honest, I answered b/c the question was unanswered, I've not looked at this code. It doesn't use AJAX to make a web service call from code behind ? If it does, I am still all for adding a proper web reference and just calling it, then it's just plain AJAX.

            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            L Offline
            L Offline
            lovedotnet
            wrote on last edited by
            #5

            Hi...please go through this URL and read my question...u will understand wat i am asking http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx[ href="http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx" target="_blank" title="New Window">^]....i hope u can suggest something.... Thanks, deep.

            1 Reply Last reply
            0
            • L lovedotnet

              Hi, I need to call a webservice through javascript, i am using scripmanager(http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx[^]....it was succesfful when i use webservice in my project..now i need to use a webservice which is running from another machine....i tried to give path to the serviceReference trough code...the path is something like this(http://165.8.15.10/myServices/WebServiceone.asmx), but couldnt solve it...Javascript throws error that "WebServiceone" is undefined.....i have googled and found that we can use .HTC and solve it..is there any other way? or..can anyone help me to solve this??

              W Offline
              W Offline
              webtips
              wrote on last edited by
              #6

              Check this link http://www.webtips.co.in/javascript/javascript-client-code-to-call-webservice.aspx[^]

              Regards, Webtips - Web Development tips

              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