FileService.svc methods and messages

UploadFile

This service allows uploading single file into content import temporary storage area. It returns unique identifier which can be used within AddMessage service to refer to the uploaded file for further processing.

We separate the upload of files from the creation of migrated content as the same file often appears in multiple areas of itslearning. Files can be created in multiple sections of itslearning, but only need be uploaded once.

Files are retained in the temporary area for 14 days and are then removed. They can be re-uploaded if required.

This is a synchronous message.

Please note that files are limited to 50 MB in size.

Following file extensions are denied for upload:

  • empty file extension

  • .exe

  • .com

  • .vb

  • .vbs

  • .vbe

  • .cmd

  • .bat

  • .ws

  • .wsf

  • .src

  • .shs

  • .pif

  • .hta

  • .jar

  • .js

  • .jse

  • .lnk

Input parameters

Name

Description

Type

Mandatory/Optional

SiteId

Site where action will be executed.

Integer

Optional

Content

File content.

Binary

Mandatory

Name

File name.

Text

Mandatory


Sample request with MTOM enabled:

Sample request (MTOM enabled)
<soapenv:Envelope xmlns:its="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Services.Entities" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header><wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:UsernameToken wsu:Id="UsernameToken-47" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:Username>be1dec1e-ee20-4d96-9aaa-54c0a312b2d5</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">d4d65856-309f-4a97-9ce0-0f4e26f457b9</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">Gh4/u3mveBCddW9OaEfMcA==</wsse:Nonce><wsu:Created>2012-04-12T11:16:12.414Z</wsu:Created></wsse:UsernameToken></wsse:Security></soapenv:Header>
<soapenv:Body>
<tem:UploadFile>
<!--Optional:-->
<tem:fileMessage>
<!--Optional:-->
<its:Content><inc:Include href="cid:http://www.soapui.org/19115972647367" xmlns:inc="http://www.w3.org/2004/08/xop/include"/></its:Content>
<!--Optional:-->
<its:Name>1.log</its:Name>
</tem:fileMessage>
</tem:UploadFile>
</soapenv:Body>
</soapenv:Envelope>
[RAW BYTES TO BE ADDED HERE}

Sample request with MTOM disabled:

Sample request (MTOM disabled)
<soapenv:Envelope xmlns:its="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Services.Entities" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header><wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:UsernameToken wsu:Id="UsernameToken-51" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:Username>be1dec1e-ee20-4d96-9aaa-54c0a312b2d5</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">d4d65856-309f-4a97-9ce0-0f4e26f457b9</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">DqDgbY/+WFlKwa8U3U8Sbg==</wsse:Nonce><wsu:Created>2012-04-12T11:38:40.731Z</wsu:Created></wsse:UsernameToken></wsse:Security></soapenv:Header>
<soapenv:Body>
<tem:UploadFile>
<!--Optional:-->
<tem:fileMessage>
<!--Optional:--> <its:Content>OC0yNS0yMDExLCAxNDoyNDoyOTogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KOC0yNS0yMDExLCAxNDoyNDoyOTogU1QgTWljcm9lbGVjdHJvbmljcyBGcmVlIEZhbGwg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zMw0KOC0yNS0yMDExLCAxNDoyNjozNzogQ29udGludWluZyB3aXRoIGluc3RhbGxhdGlvbi4uLg0KOC0yNS0yMDExLCAxNDoyNjozNzogRG9uZQ0KOC0yNS0yMDExLCAxNDoyNjozNzogUmV0dXJuQ29kZTogMA0K</its:Content>
<!--Optional:-->
<its:Name>1.log</its:Name>
</tem:fileMessage>
</tem:UploadFile>
</soapenv:Body>
</soapenv:Envelope>

Note it is possible to upload a file by adding its full path to <its:Content> as shown below:

Sample request (not recommended)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:its="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Services.Entities">
<soapenv:Header/>
<soapenv:Body>
<tem:UploadFile>
<tem:fileMessage>
<its:Content>C:\Users\someuser\Documents\bongo.jpg</its:Content>
<its:Name>bongo.jpg</its:Name>
</tem:fileMessage>
</tem:UploadFile>
</soapenv:Body>
</soapenv:Envelope>

This can fail when uploading ZIP files (e.g. IMS packages to add to courses), leaving them corrupt. Instead you should add the file to the Attachments tab in SoapUI and the correct reference in <its:Content>, as shown below:

Sample request (recommended)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:its="http://schemas.datacontract.org/2004/07/Itslearning.Integration.ContentImport.Services.Entities">
<soapenv:Header/>
<soapenv:Body>
<tem:UploadFile>
<tem:fileMessage>
<its:Content>cid:bongo.jpg</its:Content>
<its:Name>bongo.jpg</its:Name>
</tem:fileMessage>
</tem:UploadFile>
</soapenv:Body>
</soapenv:Envelope>