- 论坛徽章:
- 0
|
使用soap:lite调用web服务,http报文正常,但是反回- Not a HASH reference at /usr/local/lib/perl5/site_perl/5.16.1/SOAP/Lite.pm line 3828.
复制代码 请问是什么问题。
详细报文如下:client代码如下:
- #!/usr/local/bin/perl
- use SOAP::Lite +trace;
- my $soap = SOAP::Lite
- -> uri('World')
- -> proxy('http://localhost/cgi-bin/sev.pl');
- my $temperatures = $soap
- -> call(new => 100) # accept Fahrenheits
- -> result;
- print $soap
- -> as_celsius($temperatures)
- -> result;
复制代码 servcie代码如下:
- #!/usr/local/bin/perl
- use strict;
- use warnings;
- package World;
-
- sub new {
- my $self = shift;
- my $class = ref($self) || $self;
- bless {_temperature => shift} => $class;
- }
- sub as_fahrenheit {
- return shift->{_temperature};
- }
- sub as_celsius {
- return 5/9*(shift->{_temperature}-32);
- }
复制代码 |
|