2

I'm trying to extend my NetSuite search beyond the 100 item limit. I'm using SOAP through zeep in a python app but I'm testing in Postman first. I can successfully get the first page of the search using a CustomRecordSearchAdvanced. However, when I use the nsid from the response in the follow on searchMoreWithId request I am getting the following error

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

The SOAP header is exactly the same in both cases. The SOAP body for the first search which works is

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

The SOAP body for the second search which fails is below. I copy the searchId exactly from the response of the first search.

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

The WSDL I am using is https://webservices.na1.netsuite.com/wsdl/v2020_1_0/netsuite.wsdl and from what I can tell, this should work although there is no section in the WSDL with SOAP actions.

Nick
  • 23
  • 4

1 Answers1

1

The message inside the SOAP Fault is:

Invalid SOAPAction header: Search

Looking at the WSDL, the header value should be searchMoreWithId not Search.

You can find the value to use for the SOAPAction header inside each <soap:operation> of the WSDL. The name of the operation you are requesting needs to match with an appropriate header. You are making a request to searchMoreWithId with a Search header, and from here your error message. Change the header value to searchMoreWithId and try again.

Note also that the SOAPAction header is a HTTP header, not a SOAP header.

Bogdan
  • 23,890
  • 3
  • 69
  • 61
  • That's brilliant - all is working - thanks! I'd not connected the changes in the body from search to searchMoreWithId to a required change in the SOPAAction in the http header. Now I just need to work out how to make zeep do the same thing. – Nick Feb 16 '21 at 22:35