如何将 NTLM 身份验证与 Perl 的 SOAP::Lite 模块集成?
此 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();
This Perl code works with Anonymous access to an ASP.NET web service, but when integrated security is turned on, the service returns 401 errors. I think I need to use the NTLM module in conjunction with SOAP::Lite, but it's not clear how to do so. How can these components be integrated?
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();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您这样做,您可以让 SOAP::Lite 打印一些调试输出:
而不是
编辑:
好的,我想我现在明白了。 打开集成安全功能使 IIS 需要 NTLM 身份验证。 在 perlmonks.org 上有一个线程似乎揭示了答案。
You can get SOAP::Lite to print some debugging output if you do:
instead of
EDIT:
OK, I think I get it now. Turning on the integrated security feature makes IIS require NTLM authentication. There's a thread over at perlmonks.org that seems to reveal the answer.
我有点晚了,但我也遇到了同样的问题。 尝试这个:
I'm a bit late, but I just faced the same problem. Try this: