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 

How to call Webservice class through Apex class generated from WSDL file?



I need to call an Apex web service that will be invoked from an external system. To test this out, I am trying to call this webservice from apex class generated from WSDL file.


I have performed the following steps:


* Developed  the global apex webservice class called ‘Billing Integration’. Its code snippet is as follows:


global class Billing_Integration{
    WebService static String Import(String input,Integer Action) {
        String result;
        Integration__c i = new Integration__c();
        if(Action == 1){
            OpenCsvParser.StringBuilder sb = new OpenCsvParser.StringBuilder();
            List<account> accounts = new List<account>();
            OpenCsvReader reader = new OpenCsvReader(new OpenCsvParser(),sb.asString(),'\n');

* Downloaded its WSDL file in xml format using the WSDL link on the class name.


* Generated the Apex Class called ‘soapSforceComSchemasClassBillingIn’ from its WSDL file.


Is this approach right?


Now I don’t know how to call webservice class ‘Billing Integration’ through newly generated apex class ‘soapSforceComSchemasClassBillingIn’. 

Plz help.




its not required to generate wsdl to invoke a class from apex itself.. if you want to test your webserivce you can use system log console by givng ur test data..