使用SoapUI和Windows身份验证测试Web服务 [英] Testing web service with SoapUI and Windows authentication

查看:117
本文介绍了使用SoapUI和Windows身份验证测试Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经花了几天的时间来寻找一种解决方案,以获取简单的HTTP Web服务salesorder.read,并且无法使用JAVA客户端.我们正在尝试首先通过NTLM来实现通信,这在许多论坛中都已提出,但我愿意接受其他建议. 我的测试标准是首先使其在VS上运行,然后在SOAP UI和Java上运行.我已经成功地通过VS进行了测试,但是使用SOAP UI却没有任何运气.

配置:

-AX 2012 R3

-已将Windows的HTTP配置绑定从Windows更改为NTLM(如许多帖子所述)

-IIS

-身份验证设置为Windows和基本身份验证

-Windows身份验证提供程序; NTLM设置为主要

-SOAP UI

-带有身份验证的基本配置设置为NTLM

-已验证服务器上的lmcompatibilitylevel设置为1

该响应曾经是发生错误".或"401-未经授权:由于凭证无效而拒绝访问".您无权使用您提供的凭据查看此目录或页面."

  • 2016年12月20日星期二11:06:41 EST:调试:过时的连接检查
  • 2016年12月20日星期二11:06:41 EST:调试:发送请求:POST/MicrosoftDynamicsAXAif60/WebSalesOrderRead/xppservice.svc HTTP/1.1
  • 星期二Dec 20 11:06:41 EST 2016:DEBUG:可以无限期保持连接状态
  • 星期二Dec 20 11:06:41 EST 2016:DEBUG:目标请求身份验证
  • 星期二12月20日11:06:41 EST 2016:DEBUG:授权挑战已处理
  • 星期二12月20日11:0美国东部标准时间2016年6:41:调试:身份验证范围:NTLM @<网站>:80
  • 2016年12月20日星期二11:06:41调试:找到凭据
  • 服务器上的事件查看器显示了类似的错误,对象服务器01:服务框架中发生了错误.方法:AifMessageInspector :: AfterReceiveRequest.错误:System.Security.SecurityException:用户名或密码 是不正确的."

    我的第一个问题是,正确的用户名/密码是IIS还是AX?我们当然尝试了多种组合,但在这个问题上感到困惑,并导致认为还有更多.

    请提供任何见解.

    (

    解决方案

    拉西姆,

    根据您的描述,它可以在VS下运行,并且我认为您的问题与SOAP UI配置有关.

    已在SOAP UI中设置了域,如果要验证NTLM,请确保在配置中注意以下几点:

    ◦文件>偏好设置> HTTP设置标签>取消选中先行身份验证"首选项

    ◦对于NTLM v2,请提供您的用户名"DOMAIN \ USERNAME";或至少作为"\ USERNAME"

    我建议您参考以下链接,逐步了解如何在SoapUI中配置身份验证肥皂请求.

    #验证SOAP请求

    https://www.soapui .org/soap-and-wsdl/authenticating-soap-requests.html

    最好的问候

    爱德华

    注意:此回复包含对第三方万维网站点的引用. Microsoft为方便您而提供此信息.
    Microsoft不控制这些站点,也没有测试在这些站点上找到的任何软件或信息;
    因此,Microsoft无法对在此找到的任何软件或信息的质量,安全性或适用性做出任何陈述.
    使用Internet上发现的任何软件都存在固有的危险,Microsoft提醒您在从Internet上检索任何软件之前,请确保您完全了解风险.


    I've spent days searching for a solution to get a simple HTTP webservice, salesorder.read, working off of a JAVA client with no avail. We're trying to achieve communication first via NTLM as this was suggested in many forums, but I'm open to other suggestions. My testing criteria is to get it working on VS first, then SOAP UI and finally java. I've been successful at testing with VS, however I haven't had any luck with SOAP UI.

    Configuration:

    -AX 2012 R3

    - Changed HTTP configuration binding from Windows to NTLM (as suggested in many posts)

    - IIS

    - Authentication set to Windows and Basic Authentication

    - Windows authentication providers; NTLM set as primary

    - SOAP UI

    - Basic configuration w/ Authentication set to NTLM

    - Verified lmcompatibilitylevel set to 1 on server

    The response has ever been "An error occurred." or "401 - Unauthorized: Access is denied due to invalid credentials. You do not have permission to view this directory or page using the credentials that you supplied."

    • Tue Dec 20 11:06:41 EST 2016:DEBUG:Stale connection check
    • Tue Dec 20 11:06:41 EST 2016:DEBUG:Attempt 1 to execute request
    • Tue Dec 20 11:06:41 EST 2016:DEBUG:Sending request: POST /MicrosoftDynamicsAXAif60/WebSalesOrderRead/xppservice.svc HTTP/1.1
    • Tue Dec 20 11:06:41 EST 2016:DEBUG:Receiving response: HTTP/1.1 401 Unauthorized
    • Tue Dec 20 11:06:41 EST 2016:DEBUG:Connection can be kept alive indefinitely
    • Tue Dec 20 11:06:41 EST 2016:DEBUG:Target requested authentication
    • Tue Dec 20 11:06:41 EST 2016:DEBUG:Authorization challenge processed
    • Tue Dec 20 11:06:41 EST 2016:DEBUG:Authentication scope: NTLM @<website>:80
    • Tue Dec 20 11:06:41 EST 2016:INFO:<website>:80 requires Windows authentication
    • Tue Dec 20 11:06:41 EST 2016:DEBUG:Found credentials
    • Tue Dec 20 11:06:41 EST 2016:DEBUG:Attempt 2 to execute request 

    Event viewer on the server shows a similar error, "Object Server 01:  An error has occurred in the services framework.  Method: AifMessageInspector::AfterReceiveRequest.  Error: System.Security.SecurityException: The user name or password is incorrect."

    My first question would be what should be the correct user/pass, is it in terms of IIS or AX? We've tried multiple of combinations of course, but perplexed at this issue and led to believe it's something more. 

    Please, any insight would be appreciated.

    (

    解决方案

    Hi Rasimh,

    Based on your description, it works under VS, and I assume your issue is related with SOAP UI configuration.

    Have you set Domain in SOAP UI, If you are authenticating NTLM, make sure to note the following in your configurations:

    ◦File > Preferences > HTTP Settings tab > uncheck Authenticate Preemptively preference

    ◦for NTLM v2 provide your username as "DOMAIN\USERNAME" or at least as "\USERNAME"

    I suggest you refer the link below for how to configure Authenticate Soap Requests in SoapUI step by step.

    # Authenticating SOAP Requests

    https://www.soapui.org/soap-and-wsdl/authenticating-soap-requests.html

    Best Regards,

    Edward

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.
    Microsoft does not control these sites and has not tested any software or information found on these sites;
    Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    这篇关于使用SoapUI和Windows身份验证测试Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆