Ravi Fulani

Ravi Fulani

  • NA
  • 56
  • 739

WCF best code practise

Jan 2 2020 7:50 AM
Hi Guys, 
 
I need little advice. I have created a web servicre which seems to call mutliple methods and each method working on different API and bringing data in XML format in which i am doing manipulation and sending it back.
 
Now, the data I have in XML has 17 fields in it, and i want to update only 2 fields so i just set their value and sending the xml as it is.
 
Some of the people are suggesting me to make a class which will be having all 17 variables in it, and than i set the value and send the data. Should I do that like, just to update 3 to 4 variables why should i get all data and put it to classes. what good it will do to me? and at sema time i have to prepare class for every API that i am accessing.
 
What i have done is, create a method call the api, parse the xml get and set the data or add the data and done send it back.
 
i really need advice on this, what i was told is if tomorrow some change took place like if i am accessing tag <name> and if tomorrow that thing changes in xml format from provider side my code will go in error.  Do providers generally do that?

Answers (1)