MathDiLS v.1.1

Last updated September 3, 2007

Developer's Guide

MathDiLS has been developed on the .NET platform. Database Management system is SQL Server 2000 SP4. Web services have been implemented in C# language.

The rest of the document gives a detailed description of web services provided by MathDiLS. Web services are being presented as functions. All input arguments (variables) are case-sensitive. Description of these functions is made through providing the input arguments and return values for these functions. Moreover, a short description of the expected behavior of these functions is given. Please note that in our approach we adopt the usage of common data types like string, integer etc, which is not what WSDL file includes. For a brief overview of our data types, a mapping to WSDL types and the data type limitations, see table below:

MathDiLS data types
Corresponding WSDL data types
MathDiLS data type limitations
string
string
Variable-length non-Unicode character data with length of 200 bytes. One exception is on parameters named "desc" which have length 1024 bytes. Another exception is on "overloaded" methods (i.e. ending with 2) where attribute file is a base64 encoded string of maximum length 231 bytes.
integer
int
Integer (whole number) data from -231 (-2,147,483,648) through 231 - 1 (2,147,483,647).
byte []
base64Binary
Variable-length binary data from 0 through 231-1 (2,147,483,647) bytes
boolean
boolean
no limitation

 

One more limitation concerning the usage of MathDiLS is that web server hosting the web services is limited to accept HTTP SOAP and POST requests with max size of 100Mbytes (104,857,600 bytes). So, we could say that the maximum size of DDAfiles that MathDiLS supports is about 99Mbytes.

Contents

 

Authentication

In order to authenticate, you will to need to include a SOAP header at every HTTP request. In every SOAP object you have to declare a SOAP header, containing 2 fields (string): Username and password. The values of these fields are the same for the ReMath portal. A user will first have to register to the ReMath portal, register a username and password and then use them in the Web Services. The XML Schema of this header is the following:

<s:element name="AuthHeader" type="tns:AuthHeader"/>
<s:complexType name="AuthHeader">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Username" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
</s:sequence>

top

Return Values & Exception Handling

Exception handling takes place in every web service being executed. Each object being returned inherits object MathDiLSException, which contain 2 fields: _errorId and _errorMessage. The XML Schema for the exception object is the following:

<s:complexType name="MathDiLSException">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="_errorId" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="_errorMessage" type="s:string"/>
</s:sequence>

The following table describes the list of possible errorIds and errorMessages:

ERRORID ErrorMessage
200 OK
0 no Error
-7 connection to Database lost
-8 Login failed
-19 User has no read privileges to category
-20 Invalid category or user has no write privileges to category
-21 User has no delete privileges to category
-43 invalid DDAFile ID
-48 invalid DDA Category ID
-49 DDA Category must be empty
-52 duplicate Category Ids declared
-53 indicating category has subcategories
-54 you are not allowed to set this level
-55 invalid user id
-56 invalid user name
-57 DDAFile not valid (DDAID)
-58 DDAFile not valid (file)
-59 MathDiLS is NULL
-60 DDAFile not valid (author)
-61 DDAFile not valid (title)
-62 DDAFile not valid (level)
-63 DDAFile not valid (no category declared)
-64 DDAFile not valid (ID)
-65 Category not existing
-66 Language not existing
-68 DDA Files are identical
-69 Indicating DDA File not found
-70 Failed to update the translation field
-71 Failed to delete the DDA File
-72 DDAFile not valid (DDAID)
-73 DDAFile not valid (Filename is null)
-74 DDAFile not valid (MIMEType)
-75 Translation already existing for this DDA File
-80 DDA Category has no name
-81 DDA Category has no parent
-82 DDA Category has illegal parent
-83 DDA Category has no language
-84 DDA Category is not valid
-85 Failed to delete the DDA Category
-86 DDA Category not found
-87 Failed to move DDA file
-88 Translation already existing for this DDA Category
-89 Cannot delete translation Category, you have to delete the whole category
-90 translation Category not found
-91 DDA File translation already existing
-92 user cannot remove his own category access
-99 you must insert some input arguments
-110 Attribute author in DDAFile exceeds file limit (200 bytes)
-111 Attribute filename in DDAFile exceeds file limit (200 bytes)
-112 Attribute MIMEType in DDAFile exceeds file limit (200 bytes)
-113 Attribute title in DDAFile exceeds file limit (200 bytes)
-114 Attribute description in DDAFile exceeds file limit (1024 bytes)
-120 Attribute name in MathDiLSDDACategory exceeds file limit (200 bytes)
-121 Attribute description in MathDiLSDDACategory exceeds file limit (1024 bytes)
-130 Error during base64 decode, check your input data
-667 <a custom error Message is reported>
other negative Unknown error

 

All MathDiLS web services return objects which inherit from MathDiLSException, i.e. web services that are supposed to return a single value (e.g. insertDDAFile, deleteDDAFile) return an object of type MathDiLSResponse. MathDiLSResponse inherits from MathDiLSException and contains one attribute: val which is a variable of type integer. The XML Schema for this object is the following:

<s:complexType name="MathDiLSResponse">
<s:complexContent mixed="false">
<s:extension base="tns:MathDiLSException">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="val" type="s:int"/>
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>

Other web services (e.g. DDAFileRead) return more complex objects.

top

List of MathDiLS web services

DDA FILE MANAGEMENT

DDAs will mainly echange with MathDiLS DDA application files. DDA application files are also accompanied with some attributes. For this purpose an object name "DDAFile" has been defined, which includes the DDA application file as well as its attributes. The data members of DDAFile are the following:

DDA Files are files being handled by DDAs. DDA files are considered placeholders for handling (currently) binary objects. A DDA File is described through several meta-data, which are the following:

Please note that DDAFile inherits object MathDiLSException (and so web services which return this object, may also include errorId and errorMessage). The XML Schema for the DDA File is the following:

DDAFile

<s:complexType name="DDAFile">
<s:complexContent mixed="false">
<s:extension base="tns:MathDiLSException">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="author" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="DDAID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="filename" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="MIMEType" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="title" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="desc" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="cnt" type="s:base64Binary"/>
<s:element minOccurs="1" maxOccurs="1" name="level" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="catIds" type="tns:ArrayOfInt"/>
<s:element minOccurs="0" maxOccurs="1" name="language" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="DDAFiles_m" type="tns:ArrayOfAnyType"/>
</s:sequence>
</s:extension>
</s:complexContent>

top

DDAFile_s

top

DDA CATEGORY MANAGEMENT

DDA Files reside in DDA Categories. Each DDA Category may contain either DDA Categories or (exclusively) DDA Files. This means that the hierarchical organization of DDA Files resembles to a b+ tree. A DDA Category is an object which is described through several attributes:

(Notice: Unlike DDA Files, translations for DDA Categories are not identified uniquely through their ID. In order to specify (at the maximum) one DDA Category, you must specify both ID and language. Moreover, navigation over the categories is free as long as users provide their credentials).

Please note that MathDiLSDDACategory inherits object MathDiLSException (and so web services which return this objectm, may alose include errorId and errorMessage). The XML Schema for the DDA Category is the following:

<s:complexType name="MathDiLSDDACategory">
<s:complexContent mixed="false">
<s:extension base="tns:MathDiLSException">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="name" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="parentID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="desc" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="lang" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="DDACategories_m" type="tns:ArrayOfAnyType"/>
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>

top
top
top
top
top

USER MANAGEMENT

MathDiLS shares the same userbase with Remath Portal. Users are allowed to manage content the same way they do in the portal. A notion used here is the category author. A category may have multiple authors. A category author is the only user who may insert a DDA file in the category, update and delete the category, define more authors in the category as well as create a child category.

top

GENERAL INFORMATION

This section contain several web services which provide general information about MathDiLS. These services are supportive to the rest of the web services presented here.

DDA is a MathDiLS object comprising of 3 attributes:

The XML Schema for the DDA is the following:

<s:complexType name="MathDiLSDDA">
<s:complexContent mixed="false">
<s:extension base="tns:MathDiLSException">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="DDAID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="name" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="description" type="s:string"/>
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>

MathDiLSUser is a MathDiLS object (inherits MathDiLSException) comprising of 3 attributes:

The XML Schema for MathDiLSUser is the following:

<s:complexType name="MathDiLSUser">
<s:complexContent mixed="false">
<s:extension base="tns:MathDiLSException">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="fname" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="lname" type="s:string"/>
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>
top

MULTILINGUAL SERVICES

MathDiLS is designed to act as multilingual content repository. DDA Categories may have their names and descriptions in various languages and the same DDA Application Files may appear with some of their attributes in different languages. Of course the files themselves may have "translations" in the corresponding languages. It is not mandatory, of course for the users to exploit the multilingual services, but they are available for those who wish to do so. The services described below provide the desired functionality.

top
top

E-learning sector CTI