I am thinking about a system which includes XML or XML-like tech. My scenario, i have products in my database tables and i want to export these products, so any user can get my product list with an XML or another way and import their system. It is common usage, i know but i wonder, how can i sync the product quantities. What will be happen, if any user sell my product. How can i edit the quantity field in my DB ? Which technologies can i use ? I think API will be best but how can i use XML ?
Asked
Active
Viewed 156 times
1 Answers
1
You need to create a public api.
users should create an account and you give them an api-key in order to access the api.
you give them a GET
method with they use to recieve the product list and a POST
method to report the purchases. Once the purchase comes in from the user, you update the records accordingly in your database.
MVC 4 has some good capabilities to create api.
See below:
http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api

Community
- 1
- 1

user3311522
- 1,638
- 3
- 19
- 33
-
what if i can only need to give an xml file to end user, and ens user make a sell.. How can i reduce the quantity ? – umki Feb 27 '14 at 20:57
-
u have to have a mechanism listening for user to report sell. no other way around it. – user3311522 Feb 27 '14 at 21:32
-
I think this mechanism has no relation with the XML right ? Consider, i gave an XML to the customer. And a product has 10 quantity, and one of them sold. So how can i edit the XML which customer has ? I think customer's program should do this. And i need to recognize and reduce the count in supplier, right ? – umki Feb 28 '14 at 11:25
-
once your api recieves a call and updates the database, from that point on, the GET request's output will be the updated xml. – user3311522 Feb 28 '14 at 16:15
-
i am wonderin how can get a receive to my api from only an xml file ? woth the link in the XML ? – umki Feb 28 '14 at 20:01
-
no, your post request has a body. you can put your xml or json in the body of your post request which converts to a model on your api server. – user3311522 Feb 28 '14 at 20:05