使用 Ruby/Powershell 使用 Web 服务
目前我使用 Ruby 作为配置管理支持的核心编程语言。自从 Ruby (1.9.3) 新版本发布以来,我无法使用 gem 配置来使用 NTLM 身份验证来使用 Web 服务。这是我使用 ruby 1.9.1 的 gem 配置。
httpclient (2.2.3)
nokogiri (1.5.0 x86-mingw32)
ocra (1.3.0)
rake (0.9.2.2)
rubysspi (1.3.1)
soap4r (1.5.8)
test-unit (2.4.0)
trollop (1.16.2)
win32-api (1.4.8 x86-mingw32)
win32-eventlog (0.5.2.fix)
windows-api (0.4.0)
windows-pr (1.2.1)
我总是试图让事情变得简单,但我当然无法跟上更新。我在想,不是使用完整的 ruby 实现来提供配置管理支持,可能是时候使用微软(我根本不喜欢)脚本引擎(powershell)来运行特定的微软任务,而不需要创建对越来越多的 gem 的依赖关系并使得维护和更新非常困难。最初,我想为某些任务创建 ac# 控制台工具,但我发现了 powershell。我尝试使用soap4r,但在1.9.3上不起作用,但在1.9.1(自定义固定gem)上起作用。我尝试了 savon gem,但 NTLM 身份验证没有成功的结果。也许是时候结合使用两个脚本引擎来保持其可维护性了。有什么想法。
Currently I am using Ruby as the core programming language for Configuration Management support. Since the new release of Ruby (1.9.3) i was not able to use gem configuration to consume web services using NTLM authentication. This is my gem configuration using ruby 1.9.1.
httpclient (2.2.3)
nokogiri (1.5.0 x86-mingw32)
ocra (1.3.0)
rake (0.9.2.2)
rubysspi (1.3.1)
soap4r (1.5.8)
test-unit (2.4.0)
trollop (1.16.2)
win32-api (1.4.8 x86-mingw32)
win32-eventlog (0.5.2.fix)
windows-api (0.4.0)
windows-pr (1.2.1)
I always try to keep things simple but certainly i can not keep up with the updates. I was thinking instead of using a full ruby implementation for configuration management support, may be is time to use microsoft(which i dont like at all) scripting engine(powershell) to run specific microsoft task without creating dependencies to more and more gems and making it so difficult to maintain and update. Originally, i was thinking to create a c# console tool for certaing tasks but i found about powershell. I tried to use soap4r and does not work on the 1.9.3 but it works on 1.9.1(custom fixed gem). I tried savon gem but with no successful results for NTLM authentication. May be it is time to use a combination of two scripting engines to keep it maintainable. Any thoughts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只有您了解您的大局,但在 PowerShell 中,如果您想调用受 NTLM 保护的 Web 服务,则非常简单:
如果您想提示输入凭据,请使用
get-credential
Only you understand your big picture, but in PowerShell, if you want to call a web service secured with NTLM, it's as easy as:
If you want to prompt for credentials, use
get-credential