XDS Stored Query Implementation

From IHE Wiki
Jump to: navigation, search

This page is dedicate to the discussion of implementing the Stored Query transaction [ITI-18].

WARNING: This page is currently only demonstrating the GetAssociation query, a very uncommon query to use. For information about implementing this transaction please refer to ITI TF-2a:3.18.


Sample transaction request and response

This is an example of the request and response messages for this transaction taken from the Public Registry. The original packet trace used chunked encoding. The header Transfer-Encoding: chunked was removed for readability. Without chunked encoding the HTTP would have included a Content-Length header.


POST /axis2/services/xdsregistryb HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:ihe:iti:2007:RegistryStoredQuery"
User-Agent: Axis2
Host: localhost:9085

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
    xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <soapenv:Header>
        <wsa:To>http://localhost:9085/axis2/services/xdsregistryb</wsa:To>
        <wsa:MessageID>urn:uuid:F347E1483350B8D6511198803333967</wsa:MessageID>
        <wsa:Action>urn:ihe:iti:2007:RegistryStoredQuery</wsa:Action>
    </soapenv:Header>
    <soapenv:Body>
        <query:AdhocQueryRequest xmlns:query="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
            xmlns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
            <query:ResponseOption returnComposedObjects="true" returnType="LeafClass"/>
            <AdhocQuery id="urn:uuid:a7ae438b-4bc2-4642-93e9-be891f7bb155">
                <Slot name="$uuid">
                    <ValueList>
                        <Value>('urn:uuid:b2632772-1de7-480d-94b1-c2074d79c871')</Value>
                    </ValueList>
                </Slot>
            </AdhocQuery>
        </query:AdhocQueryRequest>
    </soapenv:Body>
</soapenv:Envelope>

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/soap+xml; action="urn:ihe:iti:2007:RegistryStoredQueryResponse";charset=UTF-8
Date: Fri, 28 Dec 2007 00:55:34 GMT

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
    xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <soapenv:Header>
        <wsa:Action>urn:ihe:iti:2007:RegistryStoredQueryResponse</wsa:Action>
        <wsa:RelatesTo>urn:uuid:F347E1483350B8D6511198803333967</wsa:RelatesTo>
    </soapenv:Header>
    <soapenv:Body>
        <query:AdhocQueryResponse xmlns:query="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0"
            status="urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Success">
            <rim:RegistryObjectList xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
                <rim:Association id="urn:uuid:ec05c9a2-c17b-4746-a3c1-882f03e92d1c"
                    objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Association"
                    associationType="urn:oasis:names:tc:ebxml-regrep:AssociationType:HasMember"
                    sourceObject="urn:uuid:b2632772-1de7-480d-94b1-c2074d79c871"
                    targetObject="urn:uuid:a7b8ebbf-4490-4f74-8b70-e2465149a7b6" home=""
                    lid="urn:uuid:ec05c9a2-c17b-4746-a3c1-882f03e92d1c">
                    <rim:Name/>
                    <rim:Description/>
                    <rim:VersionInfo versionName="1.1"/>
                </rim:Association>
                <rim:Association id="urn:uuid:e4990faf-81b3-44b8-9f24-a843ccd76437"
                    objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Association"
                    associationType="urn:oasis:names:tc:ebxml-regrep:AssociationType:HasMember"
                    sourceObject="urn:uuid:b2632772-1de7-480d-94b1-c2074d79c871"
                    targetObject="urn:uuid:c025925a-7f63-435f-879e-c3a7197007fb" home=""
                    lid="urn:uuid:e4990faf-81b3-44b8-9f24-a843ccd76437">
                    <rim:Slot name="SubmissionSetStatus">
                        <rim:ValueList>
                            <rim:Value>Original</rim:Value>
                        </rim:ValueList>
                    </rim:Slot>
                    <rim:Name/>
                    <rim:Description/>
                    <rim:VersionInfo versionName="1.1"/>
                </rim:Association>
            </rim:RegistryObjectList>
        </query:AdhocQueryResponse>
    </soapenv:Body>
</soapenv:Envelope>

ObjectRef Response

A Stored Query request can ask for one of two formats for the return data:

  • LeafClass - which returns the full metadata (ExtrinsicObject, RegistryPackage, and Association objects) in full detail. When interested in many documents, requesting LeafClass format can overwhelm an XML processor since most build a full model of the XML in memory. For dealing with large numbers of documents I suggest using:
  • ObjectRef - which returns a simple handle for each document (or object in general). A second query is then used to request the full metadata (LeafClass) for a small bunch at a time. An example ObjectRef return is shown below. Note that if the Stored Query request is used in the context of XCA (request is Cross-Gateway) then each ObjectRef would have a home attribute (XCA calls it the homeCommunityId attribute).
<query:AdhocQueryResponse xmlns:query="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0"
    status="urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Success">
    <rim:RegistryObjectList xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
        <rim:ObjectRef id="urn:uuid:90bb7391-1a6c-47ff-b845-c32e6dd848f2"/>
        <rim:ObjectRef id="urn:uuid:a87b184e-e12b-4cf5-90ca-d6f7053eadcc"/>
    </rim:RegistryObjectList>
</query:AdhocQueryResponse>

This section intentionally left blank

This section intentionally left blank

See Also

The IT Infrastructure Domain manages this profile.

The ITI Technical Framework is the official master document for this Profile.

The Registry Stored Query Transaction for Cross-Enterprise Document Sharing Profile page is an overview of the Profile.