ServerCallEx

The API itp.ServerCallEx provides the ability to call ITP/Server services that use the ITP/OnLine submission protocol, such as ITPOLSSuspendSession.

Stream ServerCallEx (Page page,
                     string service,
                     string sessionid,
                     Stream uploadableStream,
                     string uploadType,
                     out string downloadedStreamType,
                     out string newSessionId,
                     params string[] parameters)

Parameters:

The return value of the itp.ServerCallEx API is a Stream object for the file that was downloaded from ITP/Server, if any. The type of data that was downloaded is indicated by the output parameter downloadedStreamType.

The following example is based on the default implementation of the modelsuspend.aspx exit point. It calls the ITPOLSSuspendSession service on ITP/Server to suspend the current session, returning a file stream containing the information of the suspended session:

String downloadedStreamType;
String newSessionId;
String sessionid = Request.QueryString["sessionid"];

// Call ITP/Server service ITPOLSSuspendSession.
Stream s = itp.ServerCallEx (this,
                             "ITPOLSSuspendSession",
                             sessionid,
                             null,
                             "",
                             out downloadedStreamType,
                             out newSessionId,
                             "dummy parameter value");

// Make sure that we received a file with name "session".
if (s == null || downloadedStreamType != "session")
{
    throw new Exception("ITPOLSSuspendSession service sent" +
                   " no file or an unexpected file type \"" +
                                       downloadedStreamType +
                             "\", expecting type \"session\"");
}

In this example, the parameter value "dummy parameter value" is passed as a parameter to the ITPOLSSuspendSession service. Because the uploadableStream parameter is null, no file will be uploaded to ITP/Server in this call.