0

I'm trying to use soap API. Answer contains : The sort order has to be specified as %1 for ascending order or %2 for descending order. What i'm doing wrong? request:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:def="http://xxx/Magento-2-0-2-0-ce/soap/default?services=salesOrderRepositoryV1">
   <soap:Header/>
   <soap:Body>
      <def:salesOrderRepositoryV1GetListRequest>
         <searchCriteria>
            <filterGroups>
               <!--Zero or more repetitions:-->
               <item>
                  <!--Optional:-->
                  <filters>
                     <!--Zero or more repetitions:-->
                     <item>
                        <field>*</field>
                        <value>*</value>
                        <!--Optional:-->
                        <conditionType>?</conditionType>
                     </item>
                  </filters>
               </item>
            </filterGroups>
            <!--Optional:-->
            <sortOrders>
               <!--Zero or more repetitions:-->
               <item>
                  <field>Name</field>
                  <direction>%1</direction>
               </item>
            </sortOrders>
            <!--Optional:-->
            <pageSize>10</pageSize><currentPage>0</currentPage>
            <!--Optional:-->

         </searchCriteria>
      </def:salesOrderRepositoryV1GetListRequest>
   </soap:Body>
</soap:Envelope>

response:

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
   <env:Body>
      <env:Fault>
         <env:Code>
            <env:Value>env:Sender</env:Value>
         </env:Code>
         <env:Reason>
            <env:Text xml:lang="en">The sort order has to be specified as %1 for ascending order or %2 for descending order.</env:Text>
         </env:Reason>
      </env:Fault>
   </env:Body>
</env:Envelope>
  • Looks like bug in magento response. According to sources instead of %1 and %2 i should be ASC and DESC. code 'The sort order has to be specified as %1 for ascending order or %2 for descending order.',] [SortOrder::SORT_ASC, SortOrder::SORT_DESC] I have replaced %1 to ASC in my request, but it is still not working – burzhuy Feb 29 '16 at 22:51
0

To avoid this error i had removed this filter

            <!--Zero or more repetitions:-->
             <item>
                <field>*</field>
                <value>*</value>
                <!--Optional:-->
                <conditionType>?</conditionType>
             </item>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.