NetSuite searchMoreWithID 因 SOAP 操作无效而失败
NetSuite searchMoreWithID fails with Invalid SOAP action
我正在尝试将我的 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 header 在这两种情况下完全相同。第一次搜索的 SOAP body 是
<soapenv:Body>
<search xsi:type='platformMsgs:SearchRequest'>
<searchRecord xsi:type='setupCustom:CustomRecordSearchAdvanced' savedSearchId='1234'/>
</search>
</soapenv:Body>
第二次搜索失败的 SOAP body 如下。我从第一次搜索的响应中完全复制了 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 Fault 中的消息是:
Invalid SOAPAction header: Search
查看 WSDL,header 值应该是 searchMoreWithId
而不是 Search
。
您可以在 WSDL 的每个 <soap:operation>
中找到用于 SOAPAction
header 的值。您请求的操作名称需要与适当的 header 相匹配。您正在使用 Search
header 向 searchMoreWithId
发出请求,并从这里收到您的错误消息。将 header 值更改为 searchMoreWithId
并重试。
另请注意 SOAPAction
header 是 a HTTP header, not a SOAP header。
我正在尝试将我的 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 header 在这两种情况下完全相同。第一次搜索的 SOAP body 是
<soapenv:Body>
<search xsi:type='platformMsgs:SearchRequest'>
<searchRecord xsi:type='setupCustom:CustomRecordSearchAdvanced' savedSearchId='1234'/>
</search>
</soapenv:Body>
第二次搜索失败的 SOAP body 如下。我从第一次搜索的响应中完全复制了 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 Fault 中的消息是:
Invalid SOAPAction header: Search
查看 WSDL,header 值应该是 searchMoreWithId
而不是 Search
。
您可以在 WSDL 的每个 <soap:operation>
中找到用于 SOAPAction
header 的值。您请求的操作名称需要与适当的 header 相匹配。您正在使用 Search
header 向 searchMoreWithId
发出请求,并从这里收到您的错误消息。将 header 值更改为 searchMoreWithId
并重试。
另请注意 SOAPAction
header 是 a HTTP header, not a SOAP header。