You need to sign in to do that
Don't have an account?
sriram anil
error:OUTPUT CityName:<NewDataSet />.
I am enter input:INDIA, output display cities in country. but not showing data how to solve any one explain
vfpage:
======
<apex:page controller="Searchwether">
<apex:form>
ENTER COUNTRYNAME:<apex:inputText value="{!CountryName}"/><br/>
<apex:commandButton value="Submit" action="{!GetCities}"/>
OUTPUT CityName:<apex:outputText value="{!CityName}"/>
</apex:form>
</apex:page>
APEXCLASS:
==========
//Generated by wsdl2apex
public class Searchwether {
public String CountryName{get;set;}
public String CityName{get;set;}
public void GetCities(){
Searchwether.GlobalWeatherSoap wrs = new Searchwether.GlobalWeatherSoap();
string s = wrs.GetCitiesByCountry('CountryName');
CityName=s ;
}
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.net/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', 'Searchwether'};
public String GetCitiesByCountry(String CountryName) {
Searchwether.GetCitiesByCountry_element request_x = new Searchwether.GetCitiesByCountry_element();
request_x.CountryName = CountryName;
Searchwether.GetCitiesByCountryResponse_element response_x;
Map<String, Searchwether.GetCitiesByCountryResponse_element> response_map_x = new Map<String, Searchwether.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',
'Searchwether.GetCitiesByCountryResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.GetCitiesByCountryResult;
}
public String GetWeather(String CityName,String CountryName) {
Searchwether.GetWeather_element request_x = new Searchwether.GetWeather_element();
request_x.CityName = CityName;
request_x.CountryName = CountryName;
Searchwether.GetWeatherResponse_element response_x;
Map<String, Searchwether.GetWeatherResponse_element> response_map_x = new Map<String, Searchwether.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',
'Searchwether.GetWeatherResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.GetWeatherResult;
}
}
}
vfpage:
======
<apex:page controller="Searchwether">
<apex:form>
ENTER COUNTRYNAME:<apex:inputText value="{!CountryName}"/><br/>
<apex:commandButton value="Submit" action="{!GetCities}"/>
OUTPUT CityName:<apex:outputText value="{!CityName}"/>
</apex:form>
</apex:page>
APEXCLASS:
==========
//Generated by wsdl2apex
public class Searchwether {
public String CountryName{get;set;}
public String CityName{get;set;}
public void GetCities(){
Searchwether.GlobalWeatherSoap wrs = new Searchwether.GlobalWeatherSoap();
string s = wrs.GetCitiesByCountry('CountryName');
CityName=s ;
}
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.net/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', 'Searchwether'};
public String GetCitiesByCountry(String CountryName) {
Searchwether.GetCitiesByCountry_element request_x = new Searchwether.GetCitiesByCountry_element();
request_x.CountryName = CountryName;
Searchwether.GetCitiesByCountryResponse_element response_x;
Map<String, Searchwether.GetCitiesByCountryResponse_element> response_map_x = new Map<String, Searchwether.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',
'Searchwether.GetCitiesByCountryResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.GetCitiesByCountryResult;
}
public String GetWeather(String CityName,String CountryName) {
Searchwether.GetWeather_element request_x = new Searchwether.GetWeather_element();
request_x.CityName = CityName;
request_x.CountryName = CountryName;
Searchwether.GetWeatherResponse_element response_x;
Map<String, Searchwether.GetWeatherResponse_element> response_map_x = new Map<String, Searchwether.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',
'Searchwether.GetWeatherResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.GetWeatherResult;
}
}
}
public String CountryName{get;set;}
public String CityName{get;set;}
but then you have public variables also
public class GetWeather_element {
public String CityName;
public String CountryName;
public class GetCitiesByCountry_element {
public String CountryName;
Did you ever set the variables using the getter/setters?
public String CountryName{get;set;}
public String CityName{get;set;}
Thx