在NetSuite SuiteTalk Web服务搜索操作中使用已保存的搜索

时间:2016-10-18 10:49:10

标签: web-services soap soapui netsuite

我已经在NetSuite中创建并保存了搜索。现在我想在SuiteTalk Web服务调用中使用相同的搜索。无法在CustomerSearchBasic和CustomerSearch中设置SavedSearchId。所以我使用了CustomerSearchAdvanced,如下所示

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:messages_2016_1.platform.webservices.netsuite.com" xmlns:urn1="urn:core_2016_1.platform.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header>
      <urn:searchPreferences>
         <urn:pageSize>10</urn:pageSize>
      </urn:searchPreferences>
      <urn:applicationInfo>
         <urn:applicationId>some id</urn:applicationId>
      </urn:applicationInfo>
      <urn:passport>
      <!-- With Credentials -->
      </urn:passport>
   </soapenv:Header>
   <soapenv:Body>
      <urn:search>
         <urn:searchRecord ns7:savedSearchId = "732" xsi:type="ns7:CustomerSearchAdvanced"
                xmlns:ns7="urn:relationships_2016_1.lists.webservices.netsuite.com">
        </urn:searchRecord>
      </urn:search>
   </soapenv:Body>
</soapenv:Envelope>

但我从NetSuite服务器

收到此错误
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header>
      <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2016_1.platform.webservices.netsuite.com">
         <platformMsgs:nsId>some id</platformMsgs:nsId>
      </platformMsgs:documentInfo>
   </soapenv:Header>
   <soapenv:Body>
      <searchResponse xmlns="urn:messages_2016_1.platform.webservices.netsuite.com">
         <platformCore:searchResult xmlns:platformCore="urn:core_2016_1.platform.webservices.netsuite.com">
            <platformCore:status isSuccess="false">
               <platformCore:statusDetail type="ERROR">
                  <platformCore:code>UNEXPECTED_ERROR</platformCore:code>
                  <platformCore:message>An unexpected error occurred. Error ID: iufcwwrkjcqii34kqgag</platformCore:message>
               </platformCore:statusDetail>
            </platformCore:status>
         </platformCore:searchResult>
      </searchResponse>
   </soapenv:Body>
</soapenv:Envelope>

我无法获取有关错误ID的信息:iufcwwrkjcqii34kqgag

是否可以在SuiteTalk Web服务中使用已保存的搜索?如果是,我应该使用哪种电话和类型?

我正在使用使用this wsdl

创建的SOAP UI项目

1 个答案:

答案 0 :(得分:0)

以下是成功运行的 SOAP 请求以及配置 Netsuite 帐户、令牌、消费者密钥、随机数、时间戳和签名所需的内容。使用保存的搜索 id(这里是 -7734)调用保存的搜索

<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:messages="urn:messages_2020_1.platform.webservices.netsuite.com" xmlns:accountingLists="urn:accounting_2020_1.lists.webservices.netsuite.com" xmlns:employeesLists="urn:employees_2020_1.lists.webservices.netsuite.com" xmlns:employeesTransactionsTypes="urn:types.employees_2020_1.transactions.webservices.netsuite.com" xmlns:demandplanningTransactions="urn:demandplanning_2020_1.transactions.webservices.netsuite.com" xmlns:common="urn:common_2020_1.platform.webservices.netsuite.com" xmlns:commonTypes="urn:types.common_2020_1.platform.webservices.netsuite.com" xmlns:accountingListsTypes="urn:types.accounting_2020_1.lists.webservices.netsuite.com" xmlns:customizationSetup="urn:customization_2020_1.setup.webservices.netsuite.com" xmlns:inventoryTransactionsTypes="urn:types.inventory_2020_1.transactions.webservices.netsuite.com" xmlns:filecabinetDocuments="urn:filecabinet_2020_1.documents.webservices.netsuite.com" xmlns:bankTransactionsTypes="urn:types.bank_2020_1.transactions.webservices.netsuite.com" xmlns:communicationGeneralTypes="urn:types.communication_2020_1.general.webservices.netsuite.com" xmlns:customizationSetupTypes="urn:types.customization_2020_1.setup.webservices.netsuite.com" xmlns:supplychainListsTypes="urn:types.supplychain_2020_1.lists.webservices.netsuite.com" xmlns:core="urn:core_2020_1.platform.webservices.netsuite.com" xmlns:coreTypes="urn:types.core_2020_1.platform.webservices.netsuite.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:supplychainLists="urn:supplychain_2020_1.lists.webservices.netsuite.com" xmlns:demandplanningTransactionsTypes="urn:types.demandplanning_2020_1.transactions.webservices.netsuite.com" xmlns:websiteLists="urn:website_2020_1.lists.webservices.netsuite.com" xmlns:salesTransactions="urn:sales_2020_1.transactions.webservices.netsuite.com" xmlns:salesTransactionsTypes="urn:types.sales_2020_1.transactions.webservices.netsuite.com" xmlns:relationshipsLists="urn:relationships_2020_1.lists.webservices.netsuite.com" xmlns:inventoryTransactions="urn:inventory_2020_1.transactions.webservices.netsuite.com" xmlns:employeesListsTypes="urn:types.employees_2020_1.lists.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:customersTransactions="urn:customers_2020_1.transactions.webservices.netsuite.com" xmlns:schedulingActivitiesTypes="urn:types.scheduling_2020_1.activities.webservices.netsuite.com" xmlns:financialTransactions="urn:financial_2020_1.transactions.webservices.netsuite.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:relationshipsListsTypes="urn:types.relationships_2020_1.lists.webservices.netsuite.com" xmlns:employeesTransactions="urn:employees_2020_1.transactions.webservices.netsuite.com" xmlns:faults="urn:faults_2020_1.platform.webservices.netsuite.com" xmlns:marketingListsTypes="urn:types.marketing_2020_1.lists.webservices.netsuite.com" xmlns:communicationGeneral="urn:communication_2020_1.general.webservices.netsuite.com" xmlns:faultsTypes="urn:types.faults_2020_1.platform.webservices.netsuite.com" xmlns:supportListsTypes="urn:types.support_2020_1.lists.webservices.netsuite.com" xmlns:websiteListsTypes="urn:types.website_2020_1.lists.webservices.netsuite.com" xmlns:purchasesTransactions="urn:purchases_2020_1.transactions.webservices.netsuite.com" xmlns:financialTransactionsTypes="urn:types.financial_2020_1.transactions.webservices.netsuite.com" xmlns:schedulingActivities="urn:scheduling_2020_1.activities.webservices.netsuite.com" xmlns:bankTransactions="urn:bank_2020_1.transactions.webservices.netsuite.com" xmlns:marketingLists="urn:marketing_2020_1.lists.webservices.netsuite.com" xmlns:customersTransactionsTypes="urn:types.customers_2020_1.transactions.webservices.netsuite.com" xmlns:purchasesTransactionsTypes="urn:types.purchases_2020_1.transactions.webservices.netsuite.com" xmlns:generalTransactions="urn:general_2020_1.transactions.webservices.netsuite.com" xmlns:filecabinetDocumentsTypes="urn:types.filecabinet_2020_1.documents.webservices.netsuite.com">
    <soap:Header>
    <urn:tokenPassport xmlns:urn="urn:messages_2020_1.platform.webservices.netsuite.com">
    <ns8:account xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com">NetSuite Account</ns8:account>
    <ns8:consumerKey xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com">Consumer Key</ns8:consumerKey>
    <ns8:token xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com">Token</ns8:token>
    <ns8:nonce xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com">nonce</ns8:nonce>
    <ns8:timestamp xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com">timestamp</ns8:timestamp>
    <ns8:signature xmlns:ns8="urn:core_2020_1.platform.webservices.netsuite.com" algorithm="HMAC_SHA256">t/WP6f33JePu7rdqtnInwPtJSRIB24RNy3GKhDDpn94=</ns8:signature>
    </urn:tokenPassport>
    <ns1:preferences xmlns:ns1="urn:messages.platform.webservices.netsuite.com">
    <ns2:ignoreReadOnlyFields xmlns:ns2="urn:messages_2020_1.platform.webservices.netsuite.com">true</ns2:ignoreReadOnlyFields>
    </ns1:preferences>
    <ns3:searchPreferences xmlns:ns3="urn:messages.platform.webservices.netsuite.com">
    <ns4:bodyFieldsOnly xmlns:ns4="urn:messages_2020_1.platform.webservices.netsuite.com">true</ns4:bodyFieldsOnly>
    <ns5:pageSize xmlns:ns5="urn:messages_2020_1.platform.webservices.netsuite.com">999</ns5:pageSize>
    </ns3:searchPreferences>
    </soap:Header>
    <soap:Body>
    <ns24:search xmlns:ns5="urn:filecabinet_2020_1.documents.webservices.netsuite.com" xmlns:ns6="urn:relationships_2020_1.lists.webservices.netsuite.com" xmlns:ns3="urn:common_2020_1.platform.webservices.netsuite.com" xmlns:ns4="urn:communication_2020_1.general.webservices.netsuite.com" xmlns:ns9="urn:sales_2020_1.transactions.webservices.netsuite.com" xmlns:ns7="urn:support_2020_1.lists.webservices.netsuite.com" xmlns:ns8="urn:accounting_2020_1.lists.webservices.netsuite.com" xmlns="urn:core_2020_1.platform.webservices.netsuite.com" xmlns:ns19="urn:supplychain_2020_1.lists.webservices.netsuite.com" xmlns:ns18="urn:demandplanning_2020_1.transactions.webservices.netsuite.com" xmlns:ns2="urn:scheduling_2020_1.activities.webservices.netsuite.com" xmlns:ns17="urn:marketing_2020_1.lists.webservices.netsuite.com" xmlns:ns16="urn:employees_2020_1.transactions.webservices.netsuite.com" xmlns:ns15="urn:website_2020_1.lists.webservices.netsuite.com" xmlns:ns14="urn:employees_2020_1.lists.webservices.netsuite.com" xmlns:ns13="urn:customization_2020_1.setup.webservices.netsuite.com" xmlns:ns24="urn:messages_2020_1.platform.webservices.netsuite.com" xmlns:ns12="urn:financial_2020_1.transactions.webservices.netsuite.com" xmlns:ns23="urn:faults_2020_1.platform.webservices.netsuite.com" xmlns:ns11="urn:customers_2020_1.transactions.webservices.netsuite.com" xmlns:ns22="urn:general_2020_1.transactions.webservices.netsuite.com" xmlns:ns10="urn:purchases_2020_1.transactions.webservices.netsuite.com" xmlns:ns21="urn:inventory_2020_1.transactions.webservices.netsuite.com" xmlns:ns20="urn:bank_2020_1.transactions.webservices.netsuite.com">
    <ns24:searchRecord xsi:type="ns13:CustomRecordSearchAdvanced" savedSearchId="7734"/>
    </ns24:search>
    </soap:Body>
    </soap:Envelope>