[SalesForce] Exposing class as webservice

For an example I have a webservice class as shown below .This should be exposed to one of the portal.

This portal is having a callbackurl to configure.That means this portal is going to hit my application .

My question is how to create url for this class and do i need to give them Partner WSDL file or the webservice class wsdl file.so that they can hit my class.

global class AccountPlan {

   webservice String area; 
   webservice String region; 

   //Define an object in apex that is exposed in apex web service
   global class Plan {
      webservice String name;
      webservice Integer planNumber;
      webservice Date planningPeriod;
      webservice Id planId;
   }

   webservice static Plan createAccountPlan(Plan vPlan) {

       //A plan maps to the Account object in salesforce.com. 
       //So need to map the Plan class object to Account standard object
       Account acct = new Account();
       acct.Name = vPlan.name;
       acct.AccountNumber = String.valueOf(vPlan.planNumber);
       insert acct;

       vPlan.planId=acct.Id;
       return vPlan;
  }
}

Best Answer

You can generate a WSDL specific for calling you Apex web service.

Go to: Setup > App Setup > Develop > Apex Classes.

Find your class. There will be a WSDL link next to the Edit and Del links, or a Generate WSDL button with viewing the Apex Class.

This WSDL will include the required URL.

Note that to call the web service you will need to specify the SessionId in the SessionHeader.