You cannot implement a single API that conforms to both REST and SOAP.
However, you can create a system that provides RESTful and SOAP APIs with equivalent functionality.
To do this, the base system implementation must be independent of both APIs. If, for example, you implement your system with Java, the base implementation and each API must be in independent packages. If Python, independent modules. Etc.
, , API , : API RESTful , SOAP API .
, , SOAP API REST API, HTTP. - REST-via-SOAP.
, REST API Mailboxes, GET, POST, PUT DELETE, application/json, , SOAP:
get_mailboxes(url, options) returns jsonDocpost_mailboxes(url, options, jsonDoc) returns jsonDocput_mailboxes(url, options, jsonDoc) returns jsonDocdelete_mailboxes(url, options) returns nothing
, , SOAP.