Transaction/SetFile
This method uploads a file to a transaction by using the transaction ID, file name, and file extension. A page object is not added to the page file.
To run rules, the following resource must be uploaded: a page file, such as scan.xml, containing references to page objects, if there are any.
If files are referenced in the page file and will be used by rules, those files must also be uploaded by using SetFile.
This method can be used to update a page file, for example, verify.xml. Files can be uploaded by streaming the file or by using the multipart/form-data content type. If you are streaming the file, specify the content type as the file type of the file that is being uploaded.
Files can be transferred as a binary string or by using Base64 encoding. When Base64 encoding is used, you must add Content-Transfer-Encoding: base64 to the header when you are streaming, or as the last property in the message part before the file if you are using multipart/form-data. The SetFile request can accept a byte stream as the message body or can have the message body use the multipart/form-data format where the file byte stream is contained in each part.
If you specify a header field file name, then it is used as the file name for the uploaded file. If you do not specify a header field file name, then the {fileName} in the SetFile URI is used as the file name for the uploaded file.
You can adjust the value of the maxAllowedContentLength and maxRequestLength settings in the web.config file. The maximum size message that can be uploaded depends on your web server, proxy server, and client.
URI
http://{IP address}:{Port}/ServicewTM.svc/Transaction/SetFile/{transactionID}/{fileName}/{fileExtension}
| Name | Type | Required? | Description |
|---|---|---|---|
| {transactionId} | String | Yes | The transaction ID for which the file is to be uploaded. |
| {fileName} | String | Yes | The name of the file that is to be uploaded. Note: The {fileName} must not have a dot such as verify.1 or a plus sign such as batch+profiler.
|
| {fileExtension} | String | Yes | The file name extension of the file that is to be returned, such as exe. Do not include the file name path, set.xml. |
Request content
The request content contains file that is to be uploaded.
Response content
The response for this method contains no content.
| Response Code | Description |
|---|---|
| 201 Created | The request was successful. |
| 400 Bad Request | The request was not understood by the service because of malformed syntax. |
| 401 Unauthorized | The request requires user authentication. If the request included valid credentials, the 401 response indicates that authorization was refused for those credentials. |
| 405 Method Not Allowed | The method that is specified in the Request-Line is not allowed for the resource that is identified by the Request-URI. The response must include an Allow header that contains a list of valid methods for the requested resource. |
| 411 Length Required | The service refuses to accept the request without a defined Content-Length. The client can repeat the request if it adds a valid Content-Length header field that contains the length of the message body in the request message. |
| 500 Internal Error | An unexpected condition was encountered that prevented the service from fulfilling the request. |