soapuiaxaptaaif

How to create request with OR in AIF Soap UI


I have webservice AIF from Dynamics AX 2012 which return information from CustTable. How can I write request that return me information about Customers with AccountNum "1111" or "2222" if they are exist?

Something like this, doesn't work.

            <quer:CriteriaElement>
               <quer:DataSourceName>CustTable</quer:DataSourceName>
               <quer:FieldName>AccountNum</quer:FieldName>
               <quer:Operator>Equal</quer:Operator>
               <quer:Value1>1111,2222</quer:Value1>   
               <!--Optional:-->
               <quer:Value2></quer:Value2>
            </quer:CriteriaElement>
         </quer:QueryCriteria>


Solution

  • You can place more than one <CriteriaElement> tag in the <QueryCriteria> section. The system uses Boolean OR logic to connect all the tags. This means that the record information returned in the outbound message comes from records that satisfy any one of the following conditions:

    <quer:QueryCriteria>
        <quer:CriteriaElement>
            <quer:DataSourceName>CustTable</quer:DataSourceName>
            <quer:FieldName>AccountNum</quer:FieldName>
            <quer:Operator>Equal</quer:Operator>
            <quer:Value1>1111</quer:Value1>   
            <quer:Value2></quer:Value2>
        </quer:CriteriaElement>
        <quer:CriteriaElement>
            <quer:DataSourceName>CustTable</quer:DataSourceName>
            <quer:FieldName>AccountNum</quer:FieldName>
            <quer:Operator>Equal</quer:Operator>
            <quer:Value1>2222</quer:Value1>   
            <quer:Value2></quer:Value2>
        </quer:CriteriaElement>
    </quer:QueryCriteria>