Web services. Narrowing down data to output.

  • Thread starter Thread starter helveticus
  • Start date Start date
H

helveticus

How can I restrict the number of variables to be sent via a web
service? Example: Assume function fn1() returns a generic list of
objects (obj1, .., objN). Only properties (p1, p2) of each member in
the collection should be displayed on a given page. (Properties p3,
p4, .. may be required on another page, etc.)

If a web method calls up fn1(), how can the output be dynamically
restricted to just those two properties in order to save traffic
bandwidth? TIA for any hints.

Note: Adding the XML <Ignore> attribute in the class declaration did
not produce the filtering effect. Is there a json equivalent?.
 
I found an answer to my question by employing vb.net structures.
Creating a generic list of specific structures to refer to certain
class properties enables cutting down on traffic data while
maintaining flexibility since new structures can easily be added and
tailored to specific needs. Totally forgot about that object! :=)
 
Back
Top