Seeking opinion on web service layer

VBAHole22

Contributor
Joined
Oct 21, 2003
Messages
432
Location
VA
I'm getting ready to write a web service layer for an asp.net 2.0 application and i wanted to get opinions on particular aspects of how to go about this the best way specifically: parameter format and response format.

Currently all of the clients that call my web service tier will be browsers, but i can foresee in the future where win apps might hit it as well.

In the past I have used a single xml request parameter that was a string and contained all of the elements and attributes to describe the input params. I liked this because I could parse the single xml param when it came in and quickly determine if the attributes (the true params) were bogus so I could reject the call quickly. I found that this kind of request was a little tougher to formulate in the browser through javascript (for ajax). but if the client were a win app it would be trivial.

The other approach i have used is to just leave the params in the web service call and use query string to pass them along. This is fairly easy to setup in javascript (i typically make all params strings).

Now for the response. I have done xml and json in the past. Sometimes my response is large so i like json for compaction. But json requires more knowledge of the object being passed within the javascript. I would like to have the response be a consistent package deal - for example, a call to any web service method returns 3 things: a success/failure flag, a status message, and the method-specific results. This seemed tough to get working in json.

Any suggestions before I push off on this voyage? Does AJAX.NET change the issues within this equation.
 
Back
Top