Programmer's Guide
Contents
Please note: the example code snippets in this guide are written in Visual C# .NET syntax.
This is the latest generation of Web Service interface,
for accessing the newest IRESS systems. This version is a Document/Literal
style web service, designed for modern SOAP toolkits, such as .NET and Java 6.
Use this version to access:
-
IRESS
-
IPS
-
IOSPlus
-
FIXPlus
This version of Web Services also provides a much richer suite of functionality
over the previous version, including:
-
Watching for Updates
-
Paging
-
Executing Asynchronously
There are two different options for accessing Web Services 4:
1. Desktop Web Services
The IRESS front-end can host Web Services 4. This will replace the older
style COM Automation API. This solution does not require "Web Services" to
be enabled at the Group level in IRESS Web Administrator, rather it will use the
client's existing IRESS license.
2. Server Side
Either via our central Web Servers, or via Web Services setup "locally" in the
client's data centre. It offers a platform independent, scalable, and
redundant server based solution without the need of running the IRESS front-end
software. Server side Web Services requires users to be permissioned with
"Web Services" at the Group level in IRESS Web Administration. Our central
Web Servers would only be offered for solutions involving a limited number of
users and/or calling frequency. It would not be used in solutions
requiring the watching of updates. The advantage of local Web Services
installs in the client's data centre is performance, as well as the ability to
watch for updates.
When you begin a new project, use the following steps as a rough guide.
-
Add Web Reference
-
Create an IRESS Session
-
Create a Service Session if calling methods against IOSPlus, IPS or FIXPlus services
-
Call desired methods
-
Process response or handle error for each method
-
End the Service Session (if calling IOSPlus, IPS or FIXPlus) and end the IRESS Session
These steps will be explained in detail in the
following sections.
The first thing you need to do is add a reference
to the web service from your client application.
Desktop Web Services
The WSDL URL can be constructed under Options | Settings | Desktop Web Services
in the IRESS front-end.
You will have to provide:
-
Service you wish to use [IRESS, IOSPlus, IPS, FIXPlus]
-
The name of the server you wish to connect to (for IOSPlus, IPS and FIXPlus services
only). Please ensure you are logged in to this server in the respective “Status” command.
Server Side Web Services
Navigate to the web service URL you are provided with to get the WSDL form.
You will have to provide:
-
Service you wish to use [IRESS, IOSPlus, IPS, FIXPlus]
-
The name of the server you wish to connect to (for IOSPlus, IPS and FIXPlus
services only)
-
IRESS User Name
-
IRESS Company Name
-
IRESS Password
There are two different authentication modes: HTTP Basic, and Form and URL.
HTTP Basic Authentication
Uses basic access authentication to send the credentials to the server. In
this mode, the IRESS User Name and IRESS Company Name should be provided in the
format username@company.

Form and URL Authentication
Uses query string to send the credentials to the server. In this mode, the
IRESS User Name and IRESS Company Name are provided in separate edit controls.

When the WSDL is accessed the credentials provided will be validated. If
the validation succeeds, the WSDL will be dynamically generated.
After you add your
service/web reference, you can make a request.
There are two kinds of requests:
-
Data Request: This type of request allows you to retrieve
historical/snapshot based data or send data. They also allow you to
subscribe for updates if it is supported by the request.
When requesting for updates, the Data Request and the Updates Request are
"linked" by using the same RequestID in the Input header. In this
scenario, updates will only be filtered by the fields set in the data request
(but for the input parameters supported on the update request).
-
Updates Request: Allows you to subscribe for updates and retrieve those
updates.
The request Input has two components:
-
Header: This differs slightly between an IRESS session and a Service session (IOSPlus, IPS, FIXPlus).
-
SessionKey: They key you obtain from calling IRESSSessionStart method. (For IRESS requests)
-
ServiceSessionKey: They key you obtain from calling ServiceSessionStart method.
(For IOSPlus, IPS, FIXPlus)
-
WaitForResponse: Whether to wait for data to come back from the data server, or have the web server return an empty response
with StatusCode of 1 indicating there is more data available in which the user can
then poll the server for a response.
The default is true.
-
PageSize: The number of rows per page. It defaults to 1000 unless
overridden by the data server. The data server may impose a maximum page size
that is less than the value provided.
-
RequestID: The unique identifier of the request. This will be used for identifying
the request when paging or using updates. It is recommended that this be set to a globally
unique identifier (GUID).
-
Timeout: The time in seconds that the request waits to receive a reply
from the data server. The default is 25 seconds unless overridden by the data server. The data server may impose a shorter timeout than what is specified here.
-
Updates: Whether to start watching for updates. The default is false. If the method does not support updates, this parameter is ignored.
-
PagingBookmark: The bookmark field if the method supports server side paging.
-
PagingDirection: Whether to page forward (1) or backward (2) if the
method supports server side paging. The default is forward (1).
-
Parameters: Each method has its own set of parameters (if any).
If a request executes normally, you will receive an Output; otherwise, you will
receive a SOAP fault.
A response Output has the following components:
The very first thing you should do is obtain an IRESS
session key. This acts as a token that tells the system who you are and what
operations you are allowed to execute.
An IRESS session allows you to:
IRESS Session Lifetime
Desktop Web Services
Once an IRESS Session is established, it is valid for
the lifetime of the front-end user logon. If the front-end user is logged out
and logs back in again, any previous session will expire and cannot be used
anymore. Any pending data will be deleted. You will have to establish another
session if you want to make more requests.
Server Side Web Services
An IRESS Session by default will expire after two hours of
inactivity. The lifetime counter starts after your last request
finishes. It resets if you do another request through that session. When a
session expires, you can't use it anymore. Any pending data will be deleted. You
will have to establish another session if you want to make more requests.
Starting an IRESS Session
To establish an IRESS session and obtain a session key, you call the
IRESSSessionStart method. The method takes the following parameters:
-
UserName: IRESS User Name
This is currently ignored for Desktop Web Services.
-
CompanyName: IRESS Company Name
This is currently ignored for Desktop Web Services.
-
Password: IRESS Password
This is currently ignored for Desktop Web Services.
-
ApplicationID: A string that would allow you to resume an active session.
Desktop Web Services
Only a single IRESS session is supported and so the ApplicationID should be the
same across processes.
Server Side Web Services
Ideally this should be a unique string per process to provide the best
performance. For troubleshooting, it is suggested that the ApplicationID be
constructed from:
PCName + "-" + Application Instance Name + "-" + Thread Instance Number
-
ApplicationLabel: An optional string to describe your application
If the method is successful, you will get the
following:
Ending an IRESS Session
After you finish with using you session, you can
explicitly terminate the session and free your login count that the session was
using. Alternatively, you could let your session expire. Ending an IRESS session
will give you some statistics about your session.
To end an IRESS session you call the IRESSSessionEnd
web method. This method does not have any parameters, but you need to set the
IRESS session key in the header.
In order to request data from IOSPlus, IPS and FIXPlus, you need to
establish an active session with the server you wish to retrieve data from.
Starting a Service Session
To obtain a Service session key, you call the
ServiceSessionStart web method. The method takes the following parameters:
-
IRESSSessionKey: The key you obtained when you called the IRESSSessionStart method
-
Service: The service type, i.e. "IOSPlus", "IPS" or "FIXPlus"
-
Server: The name of the server to connect to, i.e. "IOSPLUSAPI"
If the method is successful, you will get the
following:
Service Session Lifetime
A service session does not expire.
Ending a Service Session
There are two ways to terminate a service session,
directly and indirectly.
To terminate the session directly, you call the
ServiceSessionEnd method. It does not take any parameters but you need to set
the service session key in the header.
To terminate the session indirectly, you can just
terminate the IRESS session.
When writing code to handle errors, clients should not write code to
handle specific error numbers rather they should only check for the error number being non-zero,
as error numbers may change in the future. This includes error numbers returned in SOAP exceptions
(in the IRESSFaultDetail structure), or errors returned in the response for a method call (i.e.
methods that include the ErrorNumber/ErrorMessage output columns).
If a web request does not execute properly, it will
return a SOAP Fault. Here is an example of what the SOAP fault may look
like: SoapFault.XML
If your client application can handle exceptions, you
can catch the following exceptions:
System.ServiceModel.FaultException<IRESSFaultDetail>: If you are using a service reference.
try
{
.
.
.
}
catch (System.ServiceModel.FaultException exIressFault)
{
// The error message
System.Diagnostics.Debug.WriteLine(exIressFault.Message);
// The XML input
System.Diagnostics.Debug.WriteLine(exIressFault.Detail.Input);
}
System.Web.Services.Protocols.SoapException: if you are using a web reference.
try
{
.
.
.
}
catch (System.Web.Services.Protocols.SoapException expSoap)
{
// The error message
System.Diagnostics.Debug.WriteLine(expSoap.Message);
// The XML input
System.Diagnostics.Debug.WriteLine(expSoap.Detail);
}
The Message (SOAP faultstring) property will contain the error
message returned by the server.
If you need more information about the error, the Detail property is an
XML blob that contains more information. You can parse it and get information
about the error number, context and server.
NOTE: Do not rely on the information you get in the Detail as it is subject to
change.
The new web services allow for the retrieval of data returned in pages.
You can specify how many rows of data each page will
contain. This is done by setting the Header.PageSize property of the
request. However, this number may not always be honoured, as the data server can
override it with a smaller value.
If there are more pages of data, the response
StatusCode will be 1 (more data available). Calling the same request
again with same request ID will return the next page. Once the last page is
received,
the response StatusCode will be 2.
Some methods will have an associated updating request.
The name of the method used to retrieve the updates will usually have the same
name as the Data method with "Updates" appended at the end.
There are two ways to subscribe to updates:
For either way that you choose you have to set the Header.Updates
property of the request to True.
A request will keep watching for updates until one of the following happens:
-
The request expires, which happens after 30 minutes of inactivity.
-
The queued updates exceed the updates queue limit of 10,000 updates.
-
The client terminates the session.
When raising a support query with IRESS, please ensure the following information is logged and provided:
Please send through the SOAP XML Request and Response if possible. If this information cannot be
provided, it may hinder or delay the ability for IRESS to troubleshoot.
Was this query previously working with different details? If so, please provide the above details.
The following walkthroughs were built using Visual Studio 2008.
Note: These Walkthroughs use a default Web Services URL end-point that points to
one of our central Server Side Web Servers. Please ensure you use the
correct URL when using Server Side or Desktop Web Services.
Other Samples