Microsoft Office Tutorials and References
In Depth Information
Web Service API Methods
A string is returned that is the sessionId created by the ECS for this OpenWorkbook call. The sessionId
is a parameter for other Excel Services web service methods that may get called for this session.
The following OpenWorkbook method call is made to open a workbook from a SharePoint trusted file
location using English data and UI cultures. The xlSessionId variable holds the session ID for the
session created by the OpenWorkbook call.
ExcelService xlEcsApi = new ExcelService();
xlEcsApi.Url = “http://” + “TheExcelServer” + “/_vti_bin/ExcelService.asmx”;
xlEcsApi.Credentials = System.Net.CredentialCache.DefaultCredentials;
xlSessionId = xlEcsApi.OpenWorkbook(
The GetSessionInformation method of the Excel Services web service returns information about the
ECS session. The declaration for the GetSessionInformation method looks like this:
public string GetSessionInformation(string sessionId, out string uiCultureNameUsed,
out string dataCultureNameUsed, out Status status)
Following are the parameters for this method:
sessionId (in) — The sessionId string returned from a prior OpenWorkbook call. The
session must still be active at the time of the GetSessionInformation call. Making a
GetSessionInformation call using a sessionId that has timed out results in a SOAP
uiCultureNameUsed (out) — A string that represents the uiCulture that was set on this
session when the session was created using the OpenWorkbook method. See the “Cultures”
section, earlier in this chapter, for an explanation of this (out) parameter.
dataCultureNameUsed (out) — A string that represents the dataCulture that was set on
this session when the session was created using the OpenWorkbook method. See the “Cultures”
section, earlier in this chapter, for an explanation of this ( out ) parameter.
Status (out) — See the “Status Class,” section, earlier in this chapter, for an explanation of
this (out) parameter.