Retrieving content as a compressed file

To retrieve the content and dependent content from the registry in the form of an archive or compressed file, perform a GET based on the bsrURI. The bsrURI can be the bsrURI of the service version, in which case, the API will retrieve WSDL and XSDs for the service.

When you register a service, you upload service definition documents (WSDL and XSD files) to WSRR and attach them to the service. When you use the service, you must download the service definition documents, and the WSDL and XSD files that those documents have imported. To download all of the files that the WSDL attached to the service requires, download the content as a compressed file with the extension .zip.

If the bsrURI is that of a WSDL or an XSD document, then the document content and all dependent documents (and their dependencies) are stored in the resultant compressed file. The compressed file then contains the document and any imported WSDL or XSD documents, included or redefined WSDL or XSD documents. For each of these WSDL or XSD documents, any included, imported, or redefined WSDL or XSD documents are included in the compressed file. This situation is depicted in Figure 1
This diagram shows how WSDL and XSD documents are imported into a compressed file
To create the result shown in Figure 1, select the AccountCreationDev.wsdl file and select the Download Service Definition Documents option from the Action menu in the Detail widget, or use the API to download as archive, providing the bsrURI of the AccountCreationDev.wsdl file. The AccountCreationDev.wsdl file imports AccountCreationInterface.wsdl, and in turn AccountCreationInterface.wsdl imports the schema AccountCreationSchema.xsd. If the download is started from the AccountCreationDev.wsdl file, then AccountCreationDev.wsdl is added to the archive file. The Imports WSDL relationship from AccountCreationDev.wsdl is followed; AccountCreationInterface.wsdl is found and added to the archive file. Then the Imports schema relationship from AccountCreationInterface.wsdl is followed and AccountCreationSchema.xsd is found and added to the archive file. If AccountCreationDev.wsdl also imported AccountCreationSchema.xsd, then AccountCreationSchema.xsd is added to the archive file only once.

If the bsrURI is that of a Capability Version, the named queries ArtifactsFromServiceVersion and ProvidedWebServicesFromServiceVersion are run. Any XSD or WSDL documents returned by these queries are used to create the content of the compressed file, with the documents on which they depend. In the Governance Enablement Profile, the previously mentioned queries retrieve documents from the Documentation relationship and the Provided Web Services relationship on the Capability Version.

If the bsrURI is that of a SOAP Service Endpoint, the named query SourceDocumentFromSOAPServiceEndpoint is run. In the Governance Enablement Profile, the source WSDL document for the SOAP Service Endpoint is used to create the content of the compressed file, with the documents on which it depends.

Compressed file format

All content is stored in the root folder or directory of the compressed file. Any document imports are rewritten to refer to documents in the same directory. Document names must be unique; if more than one document has the same name, then an error is returned.

Using query

It is possible to retrieve content in the form of a compressed file by using the Query mechanism detailed in Retrieving content using Query. Add the following information to the URL that you enter: Content?type=zip&query=<XPATH Query>&errorOnMultiple=false, where the errorOnMultiple parameter can be set to false or true.

Retrieving all attached documents

When you perform a GET to retrieve content, you can add &allDocuments=true to the end of the URL to additionally retrieve all attached documents. The resulting compressed (.zip) file will include any XML documents, policy documents, or binary documents that are attached to the service.

Example

To retrieve the content of a WSDL document, and all dependent documents, use a URL of the following form:
http[s]://hostname:port/WSRR/8.5/Content/bsruri?type=zip
where bsruri is the bsrURI of the WSDL document whose content and dependencies you want to retrieve.

If you have multiple instances of WSRR deployed, you must identify the instance by specifying its prefix, for example: http://hostname:port/prefixWSRR/8.5/Content/bsruri?type=zip, where prefix is the WSRR Instance Prefix that you specified when you created the instance.