XML structure of an output message
The SOAP payload of the response from a MOBY service takes a
similar structure:
<?xml version="1.0" encoding="UTF-8"?> <moby:MOBY xmlns:moby="http://www.biomoby.org/moby"> <moby:mobyContent moby:authority="http://tempcalculator.org/tempcalculator"> <moby:serviceNotes>freetext notes here</moby:serviceNotes> <moby:mobyData queryID=''> <!-- articles (Simple/Collection/Secondary Parameter) returned from the service in response to a single queryInput block --> </moby:mobyData> [<moby:mobyData queryID=''> <!-- articles (Simple/Collection/Secondary Parameter) returned from the service in response to a single queryInput block --> </moby:mobyData>] ... ... </moby:mobyContent> </moby:MOBY>The
mobyContent
envelope is required and gathers together
individual invocation results along with generalized service provision
data (i.e. data that is not specific to a single service invocation,
but to the use of that service in general). There is currently only
one defined attribute of the mobyContent
element of a
response message - "authority" is optional, and meant to be a URI
describing the service (authority and servicename). There are two
currently defined child elements of the mobyContent
tag
in a response message - mobyData
, and serviceNotes.
mobyData
blocks are the output results of associated
mobyData
input blocks; the association is made through
the queryID
attribute, where the service provider should
enumerate the mobyData
response block with the
mobyData
input to which it is the response.
The serviceNotes
block is only loosely defined in this
version of the API, and is currently meant to contain human-readable
freetext. serviceNotes
are optional.
There must be as many mobyData
response
elements as there were mobyData
input elements (if a
service can not respond to a specific query for whatever reason, this
element may be empty!).
For example, the following response payloads are both valid.
<?xml version="1.0" encoding="UTF-8"?> <moby:MOBY xmlns:moby="http://www.biomoby.org/moby"> <moby:mobyContent moby:authority="http://www.tempcalculator.org/meltyman"> <moby:serviceNotes> Our software was updated April 30, 2003 due to a bug in the previous version. Earlier results should be considered unreliable </moby:serviceNotes> <moby:mobyData queryID='a1'> <Simple> <moby:Float moby:namespace="NCBI_gi" moby:id="163483">69.8</moby:Float> </Simple> </moby:mobyData> </moby:mobyContent> </moby:MOBY>or
<?xml version="1.0" encoding="UTF-8"?> <moby:MOBY xmlns:moby="http://www.biomoby.org/moby"> <moby:mobyContent moby:authority="http://www.tempcalculator.org/meltyman"> <moby:mobyData queryID='a1'> <Simple> <moby:Float moby:namespace="NCBI_gi" moby:id="163483">69.8</moby:Float> </Simple> </moby:mobyData> <moby:mobyData queryID='a2'> <Simple> <moby:Float moby:namespace="NCBI_gi" moby:id="635543">72.1</moby:Float> </Simple> </moby:mobyData> </moby:mobyContent> </moby:MOBY>Similarly with
Collection
s:
<?xml version="1.0" encoding="UTF-8"?> <moby:MOBY xmlns:moby="http://www.biomoby.org/moby"> <moby:mobyContent> <moby:serviceNotes>Genbank update patch applied June 29, 2003. </moby:serviceNotes> <moby:mobyData queryID='b1'> <Collection articleName="mySequenceCollection"> <Simple> <Object namespace="NCBI_gi" id="163483"/> </Simple> <Simple> <Object namespace="NCBI_gi" id="244355"/> </Simple> <Simple> <Object namespace="NCBI_gi" id="533253"/> </Simple> <Simple> <Object namespace="NCBI_gi" id="745290"/> </Simple> </Collection> </moby:mobyData> </moby:mobyContent> </moby:MOBY>