getWeatherbyCityName 我在同一单元第二次调用getWeatherbyCityName,获取不同城市天气,出错:No WSDL or URL property was set in the THTTPRIO component. 第一次调用没问题,那位处理过这种问题? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 2个 Button2Click 代码类似procedure TiWeather.Button2Click(Sender: TObject);var a:shortint; myWp: WeatherWebServiceSoap; my: ArrayOfString; I: Integer; CityName:string; t: string; t2: string; ii:integer; b: integer;begin HTTPRIO2.HTTPWebNode.UseUTF8InHeader:= true; myWp:= HTTPRIO2 as WeatherWebServiceSoap; CityName:='北京'; my:= mywp.getWeatherbyCityName(cityname); Label6.Caption:=''+ my[5] ; t := ExtractFilePath(Application.ExeName) +'weather\a_'+ my[8]; if FileExists(t) then Image3.Picture.LoadFromFile(t) // Image1.Picture.LoadFromFile('D:\天气预报\weather\3.gif') else begin t := ExtractFilePath(Application.ExeName) + 'weather\a_' + my[8]; if FileExists(t) then Image3.Picture.LoadFromFile(t); end; if Image3.Picture.Graphic = nil then Image3.Height := 0 else Image3.Height := 50 ; t2 := ExtractFilePath(Application.ExeName) +'weather\b_'+ my[9]; if FileExists(t2) then Image4.Picture.LoadFromFile(t2) else begin t := ExtractFilePath(Application.ExeName) + 'weather\b_' + my[9]; if FileExists(t2) then Image4.Picture.LoadFromFile(t2); if Image4.Picture.Graphic = nil then Image4.Height := 0 else Image4.Height := 50 end; 你用THTTPRIO我没试过,我是直接用DELPHI从中国天气导入WEBSERVICE单元,然后: FWeatherWebServiceSoap:=WEBSERVICE单元.GetWeatherWebServiceSoap(); Debug('根据城市编码获取天气信息(编码:'+ACityCode+')'); FWeatherWebServiceSoap.getWeatherbyCityName(ACityCode);就是这样,天气预报的接口也有可能,像中国天气的免费接口,同电脑当天只能访问五次还是十次,而且天气图标和天气界面的制作,呵呵,,我当时也花了差不多一个月。。加油吧! 纠结。 关于内存读取的问题! D7,ActiveX开发很奇怪的问题,求救阿 急招delphi软件工程师 工作地点哈尔滨 我想作一个小程序实现sql语法检查,和执行sql脚本。 关于位图按钮的小问题 用delphi怎么实现象word那样在编辑文本时插入图象,最好有代码,实在不行给个思路。 PopupMenu的问题 如何将金额转换成英文 问一个IE的问题 D7 自带报表打印工具用法 delphi中的DBgrid点击数据后老是自动跳到第一行?
procedure TiWeather.Button2Click(Sender: TObject);
var a:shortint;
myWp: WeatherWebServiceSoap;
my: ArrayOfString;
I: Integer;
CityName:string;
t: string;
t2: string;
ii:integer; b: integer;begin
HTTPRIO2.HTTPWebNode.UseUTF8InHeader:= true;
myWp:= HTTPRIO2 as WeatherWebServiceSoap;
CityName:='北京';
my:= mywp.getWeatherbyCityName(cityname);
Label6.Caption:=''+ my[5] ; t := ExtractFilePath(Application.ExeName) +'weather\a_'+ my[8]; if FileExists(t) then
Image3.Picture.LoadFromFile(t)
// Image1.Picture.LoadFromFile('D:\天气预报\weather\3.gif')
else
begin
t := ExtractFilePath(Application.ExeName) + 'weather\a_' + my[8];
if FileExists(t) then
Image3.Picture.LoadFromFile(t);
end;
if Image3.Picture.Graphic = nil then
Image3.Height := 0
else
Image3.Height := 50 ;
t2 := ExtractFilePath(Application.ExeName) +'weather\b_'+ my[9]; if FileExists(t2) then
Image4.Picture.LoadFromFile(t2)
else
begin
t := ExtractFilePath(Application.ExeName) + 'weather\b_' + my[9];
if FileExists(t2) then
Image4.Picture.LoadFromFile(t2); if Image4.Picture.Graphic = nil then
Image4.Height := 0
else
Image4.Height := 50
end;
你用THTTPRIO我没试过,我是直接用DELPHI从中国天气导入WEBSERVICE单元,
然后:
FWeatherWebServiceSoap:=WEBSERVICE单元.GetWeatherWebServiceSoap();
Debug('根据城市编码获取天气信息(编码:'+ACityCode+')');
FWeatherWebServiceSoap.getWeatherbyCityName(ACityCode);
就是这样,天气预报的接口也有可能,像中国天气的免费接口,同电脑当天只能访问五次还是十次,
而且天气图标和天气界面的制作,呵呵,,我当时也花了差不多一个月。。
加油吧!