Just looking for some feedback on best-practices regarding Web Service interface design.
I have two options:
Option 1
public string GetSomeData(SomeCriteriaClass criteria);
where SomeCriteriaClass is defined as:
public int ID;
public string Name;
public string Property2; etc.
Option 2
public string GetSomeData(int id, string name, string property2)
Which is the preferred option? It seems like a conflict of design patterns - 1 is to wrap up parameters in a class, but the other is keeping the web service interface flexible and open.
The second question is - if we choose Option1 - how do you call this via a URL?
Thanks
You can go the hard way and implement option #1, using SOAP. With SOAP you can define complex data types. On the other hand, you can do it the "hack" way as in option #2, using REST and just encode the parameters in either the URL or the HTTP POST message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With