How to apply the WebMethod attribute?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

How to apply the WebMethod attribute?

Rating:

The HelloWorld public method is not available with the Web service until the WebMethod attribute is attached to it. Take the following steps to apply the WebMethod attribute:

  1. Use the following code to add the WebMethod attribute:

    [WebMethod]
    public string HelloWorld()
    {
       return "Hello World";
    }

  2. Attach the WebMethod attribute as shown in the following code window:



  3. Run the code; the following output window will open:



Rating:



Other articles

Click here to Article home

Microsoft Certification MCSE: MCSA , MCTS, MCDST, MCAD, MCDBA, MCSE Messaging, MCSE Security
JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    Photoshop ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.
 
HACKER SAFE certified sites prevent over 99.9% of hacker crime.