SOAPjr
SOAPjr is a protocol specification for exchanging structured information in the implementation of web services in computer networks. It is a hybrid of SOAP and JSON-RPC (abbreviated as "jr" in this case).
Introduction
SOAPjr is designed to create clean, fast, Ajax-style APIs and is analogous to the introduction of out of band signalling in the telephony world.
Traditional SOAP[1] is based on XML, which can make it computationally expensive to parse and manipulate[2], especially on mobile or embedded clients.[3] However, its core envelope/head/body design pattern is useful for Ajax style APIs.
SOAPjr uses a similar Envelope/Head/Body model, using lightweight and easier to manipulate JSON.[4]
In contrast to SOAP, JSON-RPC[5] is very simple, tunneling HTTP[6] GET-style key/value pairs within a query string using JSON. Within JSON-RPC there is no head/body separation, leaving metadata to pollute the main data space.
SOAPjr is intended to combine the best of these two technologies, and to create modern Ajax APIs that can easily be used by mobile devices, embedded systems or desktop browsers.
SOAPjr is an open-source project with software released under the GPL and content under Creative Commons.[7]
JSON-Schema definitions
The following SOAPjr entities are defined as JSON-Schemas.
The latest versions can also be downloaded in a single file.
Common data models
SOAPjr.org also aims to contribute to the creation of a common set of DMDs (Data Model Definitions)[8] that may align with the JSON-schema proposal[9] and Service Mapping Description Proposal[10] so applications within specific domains can easily share data. The primary extension that SOAPjr may provide here is the use of consistent or standardised error codes.
Other resources that may inform this development are common data models utilised within microformats[11][12] and RDF[13]
Examples
This is a basic request to view the jCard details for a single user (based on their username). This message would be passed in a request within the "json" parameter e.g.
?json={"HEAD":{"service_type":"contacts","action_type":"view",
"sid":"80e5b8a8b9cbf3a79fe8d624628a0fe5"},"BODY":{"username":"jbloggs"}}
{
"HEAD" : {
"service_type" : "contacts",
"action_type" : "view",
"sid" : "80e5b8a8b9cbf3a79fe8d624628a0fe5"
},
"BODY" : {
"username" : "jbloggs"
}
}
This is a simple SOAPjr response with a HEAD.result that represents a success. The BODY contains a single jCard record. In a list "list" or "search" context this would contain an array of 0 or more jCard records.
{
"HEAD" : {
"result" : "1"
},
"BODY" : {
"email" : [
{
"type" : ["internet","pref"],
"value" : "[email protected]"
}
],
"fn" : "Joe Bloggs",
"kind" : "individual",
"n" : {
"family-name" : ["Bloggs"],
"given-name" : ["Joe"],
"value" : "Bloggs;Joe"
},
"org" : [
{
"organization-name" : "SOAPjr.org"
}
]
}
}
See also
References
- ↑ "RFC 3902 : SOAP 1.2 Technical Report Recommendation". Network Working Group. Retrieved 2008-10-29.
- ↑ JSON may be up to 100x faster to parse than XML
- ↑ Cheaper parsing of XML on Mobile Devices
- ↑ JSON RFC
- ↑ JSON-RPC 1.1 Working Draft Specification Archived 2010-07-18 at the Wayback Machine
- ↑ HTTP RFC
- ↑ https://github.com/gitpan/SOAPjr
- ↑ SOAPjr DMDs (Data Model Definitions)
- ↑ JSON-Schema Proposal
- ↑ JSON-Schema Service Mapping Description Proposal
- ↑ ufJSON
- ↑ uf and RDF Metadata Formats
- ↑ RDF JSON Archived 2008-12-18 at the Wayback Machine
External links
- SOAPjr Main Page
- SOAPjr jQuery Plugin
- SOAPjr Perl modules on CPAN
- pSOAPjr php project
- SOAPjr demonstration
- Augmented Reality website built using SOAPjr
This article "SOAPjr" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:SOAPjr. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.
