pp108 : Download

Download

This Web service operation is used to download a file.

SOAP Request

<download xmlns="http://schemas.cordys.com/1.0/ftp">
    <server>ftp.microsoft.com</server>
    <user>anonymous</user>
    <password>[email protected]</password>
    <portno>21</portno>
    <synchronous>true</synchronous>
    <notification-subject>FTP</notification-subject>
    <files type="bin">
        <file>
            <source>\Products\Windows\Windows95\CDRomExtras\FunStuff\clouds.exe</source>
            <target>C:\tempdocs\Windows_clouds.exe</target>
        </file>
    </files>
</download>

Request Parameters

Parameter

Description

server

Name of the FTP server from which the file must be downloaded.

user

Name of the FTP user.

password

Password for the FTP server.

portno

The port number used by the FTP server; this tag is optional.

notification-subject

Notification subject on which the user has to subscribe to the Event service, to obtain the status of the request.

files

The files to be downloaded.

file

Details of each file.
The type attribute here specifies the type of download (ASCII or binary).

source

The name of the file to be downloaded.

target

The path where the file is to be downloaded.
This tag is optional, and when specified, the file is downloaded to the target location specified in this tag.

synchronous

Specifies if the response must be intimated to the client. This can hold the following values:

  • true - The process will continue without any interruption and the FTP client would wait for the response.
  • false - The event handler will handle the response.

SOAP Response

<downloadResponse xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <server xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">ftp.microsoft.com</server>
    <user xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">anonymous</user>
    <portno xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">21</portno>
    <notification-subject xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">FTP</notification-subject>
    <files xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
        <file xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
            <source>\Products\Windows\Windows95\CDRomExtras\FunStuff\clouds.exe</source>
            <target>C:\tempdocs\Windows_clouds.exe</target>
            <statuscode xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">226</statuscode>
            <status xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">Transfer complete. </status>
        </file>
    </files>
</downloadResponse>

SOAP Request

Below are the SOAP request and response when the files type attribute is 'ascii'.

<download xmlns="http://schemas.cordys.com/1.0/ftp">
    <server>ftp.microsoft.com</server>
    <user>anonymous</user>
    <password>[email protected]</password>
    <portno>21</portno>
    <synchronous>true</synchronous>
    <notification-subject>FTP</notification-subject>
    <files type="ascii">
        <file>
            <source>\developr\readme.txt</source>
            <target>C:\tempdocs\dev_readme.txt</target>
        </file>
    </files>
</download>

SOAP Response

<downloadResponse xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <server xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">ftp.microsoft.com</server>
    <user xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">anonymous</user>
    <portno xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">21</portno>
    <notification-subject xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">FTP</notification-subject>
    <files xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
        <file xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
            <source>\developr\readme.txt</source>
            <target>C:\tempdocs\dev_readme.txt</target>
            <statuscode xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">226</statuscode>
            <status xmlns="http://schemas.cordys.com/1.0/ftp" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">Transfer complete. </status>
        </file>
    </files>
</downloadResponse>

Note:
The downloaded file is encoded and is received as part of the SOAP message. In the above example, the fileonserver1.doc file is encoded and the content is specified in the data tag of the SOAP message (with encode set to 'true').

Related tasks

Persisting Event Service Subscriptions

Related reference

Eventservice

Related information

Configuration Parameters for Application Connectors