Microsoft Office Tutorials and References
In Depth Information
Web Service API Methods
Return Value
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.
Calling OpenWorkbook
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();
Status[] xlStatus;
string xlSessionId;
xlEcsApi.Url = “http://” + “TheExcelServer” + “/_vti_bin/ExcelService.asmx”;
xlEcsApi.Credentials = System.Net.CredentialCache.DefaultCredentials;
try
{
xlSessionId = xlEcsApi.OpenWorkbook(
@”http://TheExcelServer/testsite/Shared Documents/workbook.xlsb”,
@”en-US”,
@”en-US”,
out xlStatus);
}
GetSessionInformation
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)
Parameters
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
exception.
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.
Search JabSto ::




Custom Search