Web services. Narrowing down data to output.

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?.
 
H

helveticus

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! :=)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top