Since the communication between ACP Server and Microsoft Add-in is done through network socket communication, the message sent need to be specially formatted so as to keep the structure of the objects intact when sending through the network connection.
Possible Choices
Two popular choices: XML and JSON, are considered.
JavaScript Object Notation (JSON) |
Extensible Markup Language (XML) |
|---|---|
Pros
|
Pros
|
Cons
|
Cons
|
source from: http://msdn.microsoft.com/en-us/library/bb299886.aspx
Design Decision Made
Since JSON is more data-oriented and lightweight than XML, JSON is used in ACP to structured the request message before sending it through the network connection. Another reason to use JSON is that it allows ACP Server to return an array of objects (eg. List of suggestion objects) natively to Microsoft Add-in. If no suggestions is retrieved based on the user input, it can also send a null object to the Add-in client.
However, with this design decision made, there is a need to look for Java and .NET libraries to provide function to serialize and deserialize objects into JSON.