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. Calling Web Services from a web page

Calling Web Services from a web page

Scheduled Pinned Locked Moved Web Development
wcfalgorithmstutorialquestion
3 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.
  • N Offline
    N Offline
    NiteShade
    wrote on last edited by
    #1

    Dear people, I have been searching for the correct code to call upon a webservice directly from an aspx page. Can anyone tell me how to do it?

    V M 2 Replies Last reply
    0
    • N NiteShade

      Dear people, I have been searching for the correct code to call upon a webservice directly from an aspx page. Can anyone tell me how to do it?

      V Offline
      V Offline
      VenkatFor NET
      wrote on last edited by
      #2

      wherever you need to call a web service, it is same. add a web reference to the asmx, which will create a proxy class for you. Then just make calls to methods as if the Web service is local to you. Bhaskara

      1 Reply Last reply
      0
      • N NiteShade

        Dear people, I have been searching for the correct code to call upon a webservice directly from an aspx page. Can anyone tell me how to do it?

        M Offline
        M Offline
        mysorian
        wrote on last edited by
        #3

        Let us say you created web service with some web method called foo(). Now you create a web page in a new project from which you want to call this web service. The first thing you need to do is to add a web reference to the Reference node of your project. This opens up a wizard where you need to reference your .asmx or .wdl url reference. Once you do this, you have the localhost( your local website)with the web service ready. Add a button to your page. In the click event you need to create the following code. Before you write this code, at the top of the page, you need to add: imports localhost.service1 in the click event add the following code: dim mysvc as new service1 document.write(mysvc.foo()) ps;The service1 is having the method foo() when you created the web service. I will try to write a codewalk on this next time to the CodeProject. :)

        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