You need to sign in to do that
Don't have an account?
RAJNag
Please write page anyone in below code
Hi
I wrote One soap class i checked developer consloe its displyed country and state values .
//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;
}
}
}
but new requirement is whenever select the country then display the state values in visualforce page .
Thanks in advance
Raj
I wrote One soap class i checked developer consloe its displyed country and state values .
//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;
}
}
}
but new requirement is whenever select the country then display the state values in visualforce page .
Thanks in advance
Raj
NOTE:- You need to modify above code according to your requirement
Please let us know if this will help you.
Thanks,
Amit Chaudhary