function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SanchitaSanchita 

I have ceated a callout class for the web service, but i am not getting how to call its methods?

Sanchita Deshpande
I have ceated a callout class for the web service, but i am not getting how to call its methods?


public  with sharing  class HttpCallout {

     @future (callout=true)
     public  static void Customer(string URL)  {
    //  string getCustomer;
   //   oracleJde.getCustomer stub = new oracleJde.getCustomer();

    //getCustomer = oracleJde.getCustomer();
      URL='https://172.17.25.78:7005/DV910/CustomerManager?wsdlL';
      HttpRequest req = new HttpRequest();     
      HttpResponse res = new HttpResponse();      
      Http http = new Http();
      req.setEndpoint(URL);
      req.setMethod('POST');
  
    
    // System.debug('URL is:'+URL);

  try{
  res = http.send(req);

  }catch(System.CalloutException e)
  {
  System.debug('Job Error: '+ e);       
   System.debug(res.toString());
  }
}
   @future(callout=true)
   public static void webServiceInvoke( )
   {
     // oracleJde.getCustomer stub = new oracleJde.getCustomer();
  
   }
}

oracleJde is the call generated via wsdl and  getCustomer is which i wanted to call..
ShashForceShashForce
Hi,

You might have to get a WSDL for the web service, and generate apex classes in your org from it using the ""Generate from WSDL" option, and you should then be able to use the methids.

Some help here: http://help.salesforce.com/HTViewHelpDoc?id=code_wsdl_to_package.htm&language=en_US

If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.

Thanks,
Shashank