API返回错误:请求主体权限失败

时间:2020-08-03 17:50:18

标签: c# xml api soap postman

我通过邮递员使用了另一家公司的SOAP API,并且不断返回错误

根据我的研究,当人们遇到此错误时,他们也在开发API,并且此修复程序始终是服务器端编辑。因此,我不得不相信这个错误不是我的错。

如果我使用不正确的凭据,错误的XML格式等,我还会遇到其他错误。我可以成功使用此API的SOAP“登录”请求,但是此API的所有getter SOAP请求都抛出相同的错误

我不认为这是帐户权限错误,因为我的上级告诉我该帐户具有所需的权限。我可以做些什么来解决此错误?

我的SOAP正文:

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <AuthenticationHeader xmlns="http://url/omitted/">
            <userName>{{username}}</userName>
            <userPassword>{{password}}</userPassword>
        </AuthenticationHeader>
    </soap:Header>
    <soap:Body>
        <GetDeviceCommands xmlns="http://url/omitted/">
            <datagateId>{{datagateid}}</datagateId>
        </GetDeviceCommands>
    </soap:Body>
</soap:Envelope>

错误:

<soap:Fault>
    <faultcode>soap:Server</faultcode>
    <faultstring>Server was unable to process request. ---&gt; Request for principal permission failed.</faultstring>
    <detail />
</soap:Fault>

当我从C#发出请求时,我也遇到相同的错误,所以我知道它是服务器端的。

System.AggregateException: 'constructorArgs[0]Server was unable to process
request. ---> Request for principal permission failed.)'

Inner Exception
FaultException: Server was unable to process request. ---> Request for principal permission failed.

1 个答案:

答案 0 :(得分:0)

事实证明,这是一个权限错误,无论谁设置该帐户都做错了。