API Design: Expose XML or Objects

We are embarking on a new mid-range service that will allow internal client systems to create and update and query records in some basic data stores. The service will collect as many as 3 separate base data stores. For the purposes of this question, suppose:

Data Warehouse # 1: Native XML Database.
Data Warehouse No. 2: outside the shelf relational database.
Data Warehouse # 3: flat file storage (files are stored as binary).

Clients will not know (and do not care) what data they request / udpating. This decision will be made by the new service. My question is this: should my API expose XML or objects? For example. The new API will have an add method. Assuming our system is a car storage system, then the method of adding an API might look like this:

AddNewCar( CarObject car )

or, it might look like this:

AddNewCar( string carXml )

Now, although the second method is weakly entered as you type, XML will immediately be validated at least in the schema.

The new service will be written in C # (which version has not yet been determined, but probably 3 / 3.5 with WCF). API clients can be C # / VBA / VB.Net / C ++ / Java).

For more information, please let me know. Thanks


: , API XML . . , XML, , , .

+1
5

API- . , , - XML, , .

, API - , XML - . , , XML.

- IMNSHO - . API , - -. API -.

, - XML. XML- - , API XML API .

+1

XML, , . , , .

XML , , XML - , API , API XML .

+2

, , . , Xml , , .

+1

API WCF XML API, .

+1

API Objects, - API (, Java java2wsdl , wsdl2java , , WCF ), .

, , - - , ( -) - API. wsdl xsd , .

+1

Source: https://habr.com/ru/post/1703069/


All Articles