Microsoft Office Tutorials and References
In Depth Information
Web Service API Methods
Return Value
A string is returned that contains the version information for ECS. The return value of the
GetSessionInformation method call shown next returns the string “Excel Calculation
Services (12.0)” .
Calling GetSessionInformation
The following example makes an OpenWorkbook call and then the GetSessionInformation method
is called. The uiCulture and the dataCulture used for the OpenWorkbook call were en-US and
de-DE , respectively.
try
{
string xlSessionId, uiCultureUsed, dataCultureUsed, sessionInfo;
Status[] xlStatus;
xlSessionId = xlEcsApi.OpenWorkbook(
@”http://theexcelserver/testsite/Shared Documents/workbook.xlsb”,
@”en-US”,
@”de-DE”,
out xlStatus);
sessionInfo = xlEcsApi.GetSessionInformation(
xlSessionId,
out uiCultureUsed,
out dataCultureUsed,
out xlStatus);
Console.WriteLine(“Session Information: {0}”, sessionInfo);
Console.WriteLine(“UI Culture Used: {0}”, uiCultureUsed);
Console.WriteLine(“Data Culture Used: {0}”, dataCultureUsed);
}
This code writes the following information to the console, which shows the uiCulture and the
dataCulture properties that were set on the session:
Session Information: Excel Calculation Services (12.0)
UI Culture Used: en-US
Data Culture Used: de-DE
CloseWorkbook
The CloseWorkbook method of the Excel Services web service closes the session. Closing the session
allows any cached data associated with the session to be released. Every OpenWorkbook call should have
a corresponding CloseWorkbook call. The declaration for the CloseWorkbook method looks like this:
public Status[] CloseWorkbook(string sessionId)
Search JabSto ::




Custom Search