6398

Querying WCF Services with OData Params in POST instead of GET

Question:

We call wcf svcs (not ours) and we're using gets for searching a product database.

Example: <a href="http://foo.com/SearchProducts.svc" rel="nofollow">http://foo.com/SearchProducts.svc</a>?$skip=0$take=10$includeTotalCount=true

We were passing the Odata parameters to page the results of the SearchProducts svc. The svc has been changed to a POST because one of our filters "skus" is sometimes huge (hundres of skus) which causes the GET to break because the uri is too large. The easiest solution we thought was to just change the call to a post but now the Odata params dont seem to be used.

Do these params need to be sent in a different manner when doing a POST?

Answer1:

Compliant OData service will not support POST verb for queries (unless you use POST tunneling, but then you're going to be hitting the URL limit anyway). So I wonder how it works for you at all.

The URL size limit can be overcome using several approaches:

<ul><li>Simplify the query expression. Obviously this can only go so far, but it's usually the best solution as it will likely speed up the query execution as well.</li> <li>Use batch instead. You can send the GET request inside a batch. The length of the URL is not an issue in this case, since the query URL is sent in the payload of the batch.</li> <li>Define a service operation for the complex query you're using (but since you don't own the service this is probably not a good solution for you).</li> </ul>

Recommend

  • Cannot implicitly convert type 'System.Collections.Generic.List' to 'string'
  • Spring trigger/notify explicitly a Scheduled method
  • Difference between Embed, Embed Advanced or Dynamic Map
  • Zend Framework 2 - Building a simple form with Validators
  • Easier way to do non-recursive list on gcs bucket outside appengine
  • Thrust filter by key value
  • p:fileDownload in p:dataTable does not work (just refreshes page) after performing search on the p:d
  • Extracting individual digits from a float
  • rewrite uppercase url to lowercase url htaccess
  • Access user's phone number on iOS 7
  • How can I tell a form not to dispose a particular control when it closes?
  • Hash Code in SQL Server?
  • Intel-64 and ia32 atomic operations acquire-release semantics and GCC 5+
  • Read text file that is not in the main package in a runnable jar
  • MS Access - How to change the linked table path by amend the table
  • Is playing sound in Javascript performance heavy?
  • How to use an array of arrays with array_map(…) in PHP?
  • All Classes Conforming to Protocol Inherit Default Implementation
  • Is there a javascript serializer for JSON.Net?
  • Spring Data JPA custom method causing PropertyReferenceException
  • Insert into database using onclick function
  • Javascript simulate pressing enter in input box
  • Read text file and split every line in MSBuild
  • Why ng-show works with ng-repeat but ng-if doesn't? [duplicate]
  • Fetching methods from BroadcastReceiver to update UI
  • Excel - Autoshape get it's name from cell (value)
  • Check if a string to interpolate provides expected placeholders
  • Knitr HTML Loop - Some HTML output, some R output
  • How to apply VCL Styles to DLL-based forms in Inno Setup?
  • htaccess rewriting URLs with multiple forward slashes
  • Can a Chrome extension content script make an jQuery AJAX request for an html file that is itself a
  • Display Images one by one with next and previous functionality
  • Web-crawler for facebook in python
  • RestKit - RKRequestDelegate does not exist
  • Traverse Array and Display in markup
  • A cron job substitute?
  • Free memory of cv::Mat loaded using FileStorage API
  • Memory offsets in inline assembly
  • Turn off referential integrity in Derby? is it possible?
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize