邮递员HTTP状态400 - 为什么?

时间:2017-09-12 11:49:53

标签: soap http-headers postman dynamics-nav

我想通过
使用Dynamics NAV 2013 R2的SOAP Web服务 http://servername:7047/DynamicsNAV71/WS/CRONUS%20AG/Codeunit/WSInterface

我只能通过Chrome访问此页面,它会要求我提供凭据(正确且有效) 如果我使用Crome登录并启动Postman我可以使用它:

POST /DynamicsNAV71/WS/CRONUS%20AG/Codeunit/WSInterface HTTP/1.1
Host: servername:7047
Content-Type: text/xml
SOAPAction: urn:microsoft-dynamics-schemas/codeunit/WSInterface:Process
Cache-Control: no-cache
Postman-Token: 5e640ab7-d0af-a098-0665-da4fa281f892

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsin="urn:microsoft-dynamics-schemas/codeunit/WSInterface">
   <soapenv:Header/>
   <soapenv:Body>
       <wsin:Process>
           <wsin:request>INPUT</wsin:request>
           <wsin:response>FAKE_RESPONSE</wsin:response>
       </wsin:Process>
   </soapenv:Body>
</soapenv:Envelope>

并获取状态码200 OK作为响应。

很快,当我关闭Chrome浏览器并再次发送请求时,我收到状态401(未授权),因此我添加了授权标头。之后,我得到状态400,其中包含以下标题:

POST /DynamicsNAV71/WS/CRONUS%20AG/Codeunit/WSInterface HTTP/1.1
Host: servername:7047
Content-Type: text/xml
SOAPAction: urn:microsoft-dynamics-schemas/codeunit/WSInterface:Process
Authorization: NTLM YWNhbVxncnU6Z3J1MTIzNA==
Cache-Control: no-cache
Postman-Token: 595777b7-5183-38d3-d49b-6bc5d4e3d30e

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsin="urn:microsoft-dynamics-schemas/codeunit/WSInterface">
   <soapenv:Header/>
       <soapenv:Body>
            <wsin:Process>
                <wsin:request>INPUT</wsin:request>
                <wsin:response>FAKE_RESPONSE</wsin:response>
            </wsin:Process>
       </soapenv:Body>
</soapenv:Envelope>

授权标题旁边没有任何变化,为什么我会获得状态400?有人可以帮忙吗? 如果我使用Chrome登录,则授权标头无论是否发送都无关紧要......

1 个答案:

答案 0 :(得分:0)

邮递员不支持NTLM身份验证,您可以使用Fiddler或Chrome浏览器进行身份验证。 https://github.com/postmanlabs/postman-app-support/issues/1137