Use the web-service keyword to define top-level methods and outer class methods. You can’t use the web-service keyword to define a class or an inner class method. … Methods defined with the web-service keyword are inherently global. Any Apex code that has access to the class can use these methods.