If I run ASP.NET, and I am accessing a foreign asmx web service that returns a List of Person objects, where Person is some DTO defined by the foreign company, then what is the best way for me to handle the result? Should I create my own DTO object called Person to receive their Person object, should I have them send me class definitions? How do people normally deal with this?
Share
Define your own DTO and map the foreign object (from a proxy class or something) to your own. Take only what you need. This gives you a layer of abstraction from the webservice if it ever changes.
http://automapper.codeplex.com/ might be helpful for the mappings.