WebService Methods

Apex class methods can be exposed as custom Force.com Web Services API calls and used to access external servers. Use the webService keyword to define these methods. For example:
global class MyWebService {webService static Id makeContact(String lastName, Account a) {Contact c = new Contact(lastName = 'Weissman', AccountId = a.Id);
        insert c;
        return c.id;
    }
}
You can download a WSDL from the Apex class detail page:
  1. In the application navigate to Setup | Develop | Apex Classes.
  2. Click the name of a class that contains webService methods.
  3. Click Generate WSDL.
© Copyright 2000-2009 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.