Downloading Application Package from APS Catalog

The download-package operation is used to download an application package from an APS Catalog.

If the operation succeeds, a download task is created.

Note: Operation succeeds not only in cases when an actual download starts. Whether the actual download succeeded or not, should be checked using the get-download-status operation.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet that downloads an application package from an APS Catalog includes the download-package operation node:

<packet>
<aps>
   <download-package>
...
   </download-package>
</aps>
</packet>

The download-package node is structured as follows:

APSPackageDownloadInputType

Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.

 

Response Packet Structure

The download-package node of the output XML packet is structured as follows:

APSPackageDownloadOutputType

 

Samples

Installing an application package from a particular APS catalog

This packet installs an application package of particular version, release, vendor and publisher, and from a particular APS catalog (most probably, different from the default one).

<packet version="1.6.2.0">
  <aps>
    <download-package>
      <package>
        <name>BlogEngine.NET</name>
        <version>1.4.5</version>
        <release>2</release>
        <vendor>www.dotnetblogengine.net</vendor>
        <packager>www.glowtouch.com</packager>
      </package>
      <aps-catalog-url>http://apscatalog.com/</aps-catalog-url>
    </download-package>
  </aps>
</packet>

 

Response:

<packet version="1.6.2.0">
  <aps>
    <download-package>
      <result>
        <status>ok</status>
        <task-id>4</task-id>
      </result>
    </download-package>
  </aps>
</packet>

Downloading several packages with blog applications from the default APS Catalog

This package downloads several packages with blog applications from the default APS Catalog. It is supposed that the freshest in the Catalog packages of each application will be downloaded.

<packet version="1.6.2.0">
<aps>
  <download-package>
      <package>
        <name>BlogEngine.NET</name>
      </package>
    </download-package>
    <download-package>
      <package>
        <name>WordPress</name>
      </package>
    </download-package>
    <download-package>
      <package>
        <name>geeklog</name>
      </package>
    </download-package>
  </aps>
</packet>

Response:

<packet version="1.6.2.0">
  <aps>
    <download-package>
      <result>
        <status>ok</status>
        <task-id>4</task-id>
      </result>
    </download-package>
  </aps>
</packet>

Such response is received in case the APS Catalog URL defined by the request is not listed in the APS Catalogs configuration file. It also covers the cases when the URL in request differs from the URL in the configuration file in the smallest details. For example, request misses the URL trailing slash while it is defined in the APS Catalogs configuration.

<packet version="1.6.2.0">
  <aps>
    <download-package>
      <result>
        <status>error</status>
        <errcode>1013</errcode>
        <errtext>Catalog with URL "http://apscatalog.com" does not exist</errtext>
      </result>
    </download-package>
  </aps>
</packet>

 

Such negative response is received if the requested APS Catalog URL cannot be resolved:

<packet version="1.6.2.0">
  <aps>
    <download-package>
      <result>
        <status>error</status>
        <errcode>1023</errcode>
        <errtext>Could not resolve host: apscatalog.co; No data record of requested type</errtext>
      </result>
    </download-package>
  </aps>
</packet>

 

Such negative response is received when an APS Catalogs configuration file has improper format:

<packet version="1.6.2.0">
  <aps>
    <download-package>
      <result>
        <status>error</status>
        <errcode>1023</errcode>
        <errtext>APS Catalog configuration file is broken</errtext>
      </result>
    </download-package>
  </aps>
</packet>