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
RAJNagRAJNag 

need dynamic code

Hi all
I wrote one soap class in a perticlur endpoint url (wsdl Class).I need dynamically means i will give any endpoind url to apex class it will through soap request output. plz need dyanamically

/Generated by wsdl2apex

public class GlobalWhetherClass {
    public class GetWeather_element {
        public String CityName;
        public String CountryName;
        private String[] CityName_type_info = new String[]{'CityName','http://www.webserviceX.NET',null,'0','1','false'};
        private String[] CountryName_type_info = new String[]{'CountryName','http://www.webserviceX.NET',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.webserviceX.NET','true','false'};
        private String[] field_order_type_info = new String[]{'CityName','CountryName'};
    }
    public class GetCitiesByCountry_element {
        public String CountryName;
        private String[] CountryName_type_info = new String[]{'CountryName','http://www.webserviceX.NET',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.webserviceX.NET','true','false'};
        private String[] field_order_type_info = new String[]{'CountryName'};
    }
    public class GetWeatherResponse_element {
        public String GetWeatherResult;
        private String[] GetWeatherResult_type_info = new String[]{'GetWeatherResult','http://www.webserviceX.NET',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.webserviceX.NET','true','false'};
        private String[] field_order_type_info = new String[]{'GetWeatherResult'};
    }
    public class GetCitiesByCountryResponse_element {
        public String GetCitiesByCountryResult;
        private String[] GetCitiesByCountryResult_type_info = new String[]{'GetCitiesByCountryResult','http://www.webserviceX.NET',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.webserviceX.NET','true','false'};
        private String[] field_order_type_info = new String[]{'GetCitiesByCountryResult'};
    }
    public class GlobalWeatherSoap {
        public String endpoint_x = 'http://www.webservicex.com/globalweather.asmx';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://www.webserviceX.NET', 'GlobalWhetherClass'};
        public String GetCitiesByCountry(String CountryName) {
            GlobalWhetherClass.GetCitiesByCountry_element request_x = new GlobalWhetherClass.GetCitiesByCountry_element();
            request_x.CountryName = CountryName;
            GlobalWhetherClass.GetCitiesByCountryResponse_element response_x;
            Map<String, GlobalWhetherClass.GetCitiesByCountryResponse_element> response_map_x = new Map<String, GlobalWhetherClass.GetCitiesByCountryResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.webserviceX.NET/GetCitiesByCountry',
              'http://www.webserviceX.NET',
              'GetCitiesByCountry',
              'http://www.webserviceX.NET',
              'GetCitiesByCountryResponse',
              'GlobalWhetherClass.GetCitiesByCountryResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetCitiesByCountryResult;
        }
        public String GetWeather(String CityName,String CountryName) {
            GlobalWhetherClass.GetWeather_element request_x = new GlobalWhetherClass.GetWeather_element();
            request_x.CityName = CityName;
            request_x.CountryName = CountryName;
            GlobalWhetherClass.GetWeatherResponse_element response_x;
            Map<String, GlobalWhetherClass.GetWeatherResponse_element> response_map_x = new Map<String, GlobalWhetherClass.GetWeatherResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.webserviceX.NET/GetWeather',
              'http://www.webserviceX.NET',
              'GetWeather',
              'http://www.webserviceX.NET',
              'GetWeatherResponse',
              'GlobalWhetherClass.GetWeatherResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetWeatherResult;
        }
    }
}

Thanks In advance
Raj.