【发布时间】:2014-10-13 11:06:28
【问题描述】:
我正在 Perl 中迈出第一步,我想使用现有的 web 服务,但我似乎做错了什么,因为我不断收到错误“服务器无法识别 http 标头的值”。谁能帮我解决这个问题?
代码如下:
use warnings;
use strict;
use SOAP::Lite 'trace';
my $soap = SOAP::Lite
-> uri('http://ws.cdyne.com/WeatherWS/Weather.asmx')
-> on_action( sub { join '/', 'http://wsf.cdyne.com/WeatherWS/Weather.asmx', $_[1] } )
-> proxy('http://wsf.cdyne.com/WeatherWS/Weather.asmx');
my $method = SOAP::Data->name('GetCityWeatherByZIP')
->attr({xmlns => 'http://ws.cdyne.com/WeatherWS/'});
my @params = ( SOAP::Data->name(ZIP => 10007));
print $soap->call($method => @params)->result;
【问题讨论】:
标签: web-services perl soap