developer:soap-1.6:methods:searchproductscount

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:soap-1.6:methods:searchproductscount [2012/08/04 11:23] (current)
tem created
Line 1: Line 1:
 +<embed ..:​contents/>​
 +
 +====== searchProductsCount ======
 +
 +Search the product database, only return number of products matched
 +
 +===== Description =====
 +
 +Identical to the [[searchProducts]] method except only the product counts are returned. ​ Like [[searchProducts]], ​ this method returns [[..:​objects:​ProductSearchResult]]. ​ The only difference is that ProductSearchResult.Products is left empty. ​ This method provides a quicker way to determine the size of the result set before starting to retrieve the full search results.
 +
 +
 +See also [[searchProducts]],​ [[searchProductsCustom]]
 +
 +
 +===== Syntax =====
 +
 +[[developer:​soap:​objects:​ProductSearchResult]] **searchProductsCount** ( [[developer:​soap:​objects:​ueSecurityToken]] Token, [[developer:​soap:​objects:​SearchParam]] Search, boolean MatchAll, integer Start, integer Limit, string Sort)
 +
 +
 +
 +===== Arguments =====
 +
 +^Type   ​^Name ​  ​^Description ​  ^
 +|[[developer:​soap:​objects:​ueSecurityToken]] |Token |Merchant security token: used to identify merchant and validate transaction.|
 +|[[developer:​soap:​objects:​SearchParam]] |Search |Array of search parameters (SearchParam objects) available.|
 +|boolean |MatchAll |If set to "​true,"​ only results matching all search criteria will be returned, if set to "​false,"​ results matching any of the search criteria will be returned.|
 +|integer |Start |Sequence number to start returning on.|
 +|integer |Limit |Maximum number of transactions to return in result set. |
 +|string |Sort |Comma separated list of fields to sort by. |
 +
 +
 +===== Return Value =====
 +
 +|[[developer:​soap:​objects:​ProductSearchResult]] |Returns full products records for all products matching the specified search parameters. |
 +
 +===== Examples =====
 +
 +
 +
 +
 +==== PHP 5 ====
 +For directions on how to set up the WSDL link, create "​$token"​ and "​$client",​ go to [[developer:​soap:​howto:​php|PHP Soap How-to]].
 +
 +<code php>
 +
 +</​code>​
 +
 +==== .NET VB ====
 +<code vb>
 +Dim MatchAll As Boolean
 +        MatchAll = False
 +        Dim searchParams(1) As usaepay.SearchParam
 +        searchParams(0) = New usaepay.SearchParam
 +        searchParams(0).Field = "​Created"​
 +        searchParams(0).Type = "​gt"​
 +        searchParams(0).Value = "​2010-09-07"​
 +
 +        Dim SearchResults As usaepay.ProductSearchResult = New usaepay.ProductSearchResult
 +        SearchResults = client.searchProductsCount(token,​ searchParams,​ MatchAll, 0, 1000, "​created"​)
 +
 +        MsgBox(SearchResults.ProductsMatched)
 +</​code>​
 +
 +==== .NET C# ====
 +<code c>
 +            usaepay.SearchParam[] param = new usaepay.SearchParam[1];​
 +            param[0] = new usaepay.SearchParam();​
 +            param[0].Field = "​Created";​
 +            param[0].Type = "​Contains";​
 +            param[0].Value = "​2010-08-12";​
 +
 +            Boolean matchAll = true;
 +            string start = "​0";​
 +            string limit = "​10";​
 +            string sort = "​created";​
 +
 +            usaepay.ProductSearchResult response = new usaepay.ProductSearchResult();​
 +
 +            try
 +            {
 +                response = client.searchProductsCount(token,​ param, matchAll, start, limit, sort);
 +                MessageBox.Show(string.Concat(response.ProductsMatched));​
 +            }
 +            catch (Exception err)
 +            {
 +                MessageBox.Show(err.Message);​
 +            }
 +</​code>​
 +
 +===== Change History =====
 +
 +^Version ^Change ^
 +|[[developer:​soap-1.3:​methods:​searchproductscount|1.3]]| Function added in 1.3 release |
  
developer/soap-1.6/methods/searchproductscount.txt ยท Last modified: 2012/08/04 11:23 by tem

Page Tools