Microsoft Office Tutorials and References
In Depth Information
Web Service API Methods
Parameter
The parameter for this method is sessionId (in) . This is the sessionId string that was returned
from a prior OpenWorkbook call. The session must still be active at the time of the CloseWorkbook call.
Making a CloseWorkbook call using a sessionId that has timed out results in a SOAP exception.
Return Value
A status object is returned by default with a value of null . See the “Status Class” section, earlier in this
chapter, for an explanation of this return type.
Calling CloseWorkbook
The following code makes an OpenWorkbook call and assigns the returned sessionId . The sessionId
is a parameter when CloseWorkbook is called.
try
{
string xlSessionId;
Status[] xlStatus;
xlSessionId = xlEcsApi.OpenWorkbook(
@”http://theexcelserver/testsite/Shared Documents/workbook.xlsb”,
@”en-US”,
@”de-DE”,
out xlStatus);
xlStatus = xlEcsApi.CloseWorkbook(xlSessionId);
}
CancelRequest
The CancelRequest method of the Excel Services web service attempts to cancel any active request that
is using the session. The CancelRequest method call is considered successful if there is no active request
to cancel. The declaration for the CancelRequest method looks like this:
public Status[] CancelRequest(string sessionId)
Parameter
The parameter for this method is sessionId (in) . This is the sessionId string that was returned
from a prior OpenWorkbook call. The session must still be active at the time of the CancelRequest call.
Making a CancelRequest call using a sessionId that has timed out results in a SOAP exception.
Return Value
A status object is returned by default with a value of null . See the “Status Class” section, earlier in this
chapter, for an explanation of this return type.
Search JabSto ::




Custom Search