【发布时间】:2018-02-20 20:55:31
【问题描述】:
我想通过
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>
除了 Authorization 标头之外没有任何变化,那么为什么我会得到 Status 400?有人可以帮忙吗? 如果我使用 Chrome 登录,授权标头是否发送都无关紧要...
【问题讨论】:
标签: soap http-headers postman dynamics-nav