【问题标题】:NetSuite searchMoreWithID fails with Invalid SOAP actionNetSuite searchMoreWithID 因 SOAP 操作无效而失败
【发布时间】:2021-02-16 17:43:31
【问题描述】:

我正在尝试将我的 NetSuite 搜索扩展到超过 100 个项目的限制。我在 python 应用程序中通过 zeep 使用 SOAP,但我首先在 Postman 中进行测试。我可以使用 CustomRecordSearchAdvanced 成功获得搜索的第一页。但是,当我在 searchMoreWithId 请求的后续响应中使用 nsid 时,我收到以下错误

        <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
        <faultstring>Invalid SOAPAction header: Search</faultstring>

两种情况下的 SOAP 标头完全相同。第一个有效的搜索的 SOAP 主体是

<soapenv:Body>
    <search xsi:type='platformMsgs:SearchRequest'>
        <searchRecord xsi:type='setupCustom:CustomRecordSearchAdvanced' savedSearchId='1234'/>
    </search>
</soapenv:Body>

第二次搜索失败的 SOAP 正文如下。我完全从第一次搜索的响应中复制了 searchId。

<soapenv:Body>
    <searchMoreWithId xsi:type='platformMsgs:SearchMoreWithIdRequest'>
        <searchId xsi:type='xsd:string'>WEBSERVICES_************</searchId>
        <pageIndex xsi:type='xsd:int'>2</pageIndex>
    </searchMoreWithId>
</soapenv:Body>

我使用的 WSDL 是 https://webservices.na1.netsuite.com/wsdl/v2020_1_0/netsuite.wsdl,据我所知,尽管 WSDL 中没有包含 SOAP 操作的部分,但这应该可以工作。

【问题讨论】:

    标签: soap netsuite


    【解决方案1】:

    SOAP Fault 中的消息是:

    无效的 SOAPAction 标头:搜索

    查看 WSDL,标头值应该是 searchMoreWithId 而不是 Search

    您可以在 WSDL 的每个 &lt;soap:operation&gt; 内找到用于 SOAPAction 标头的值。您请求的操作的名称需要与适当的标头匹配。您正在使用 Search 标头向 searchMoreWithId 发出请求,并从此处获取错误消息。将标头值更改为searchMoreWithId,然后重试。

    还要注意SOAPAction 标头是a HTTP header, not a SOAP header

    【讨论】:

    • 太棒了 - 一切正常 - 谢谢!我没有将正文中从 search 到 searchMoreWithId 的更改连接到 http 标头中 SOPAAction 的所需更改。现在我只需要弄清楚如何让 zeep 做同样的事情。
    猜你喜欢
    • 1970-01-01
    • 2019-10-01
    • 1970-01-01
    • 2020-05-27
    • 2021-09-22
    • 2017-03-25
    • 2014-12-31
    • 1970-01-01
    • 2021-01-30
    相关资源
    最近更新 更多