Web服务接受xml数据并将值返回到xml中。我正在尝试将xml数据发布到Web服务,但没有任何成功,我需要使用Perl来完成。以下是代码我想:Perl:无法将xml数据发布到Web服务
use SOAP::Lite ;
my $URL = "http://webservice.com:7011/webServices/HealthService.jws?WSDL=";
my $xml_data = '<Request>HealthCheck</Request>' ;
my $result = SOAP::Lite -> service($xml_data);
print $result ;
我试图与代理另一种方法:
use SOAP::Lite +trace => 'debug';
my $URI = 'webServices/HealthService' ;
my $URL = "http://webservice.com:7011/webServices/HealthService.jws?WSDL=" ;
my $test = SOAP::Lite -> uri($URI)
-> proxy($URL) ;
my $xml_data = '<Request>HealthCheck</Request>' ;
my $result = $test -> healthRequest($xml_data);
print $result ;
然而,这是抛出以下错误:
Can't locate class method "http://webservice.com:7011/healthRequest" via package "SOAP::Lite\" at 7.pl line 4. BEGIN failed--compilation aborted at 7.pl line 4.
的Web服务只提供了一个方法HealthRequest
。我不知道为什么它试图找出SOAP:Lite
中的类方法。这两种方法我都得到了同样的错误。
有没有其他的方法可以使用Perl来实现相同的功能?