此 Perl 代码适用于对 ASP.NET Web 服务的匿名访问,但是当集成安全性打开时,该服务会返回 401 错误。我认为我需要将 NTLM 模块与 SOAP::Lite 结合使用,但不清楚如何这样做。这些组件如何集成?
use SOAP::Lite;
use strict;
my $proxy = "http://localhost:28606/WebService.asmx";
my $method_name = "HelloWorld";
my $uri = "http://tempuri.org/";
my $methodAction = $uri . $method_name;
my $soap = SOAP::Lite
->uri( $uri )
->proxy( $proxy )
->on_action(sub{ $methodAction; });
my $method = SOAP::Data->name($method_name)->attr({xmlns=>$uri});
my $result = $soap->call($method);
print $result->result();