3.1.4.56 ProcessRestRequest

This operation performs different operations on the workbook depending on the type of the RestRequest object received and returns a corresponding RestResult.

The following is the WSDL port type specification of the ProcessRestRequest WSDL operation.

 <wsdl:operation name="ProcessRestRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <wsdl:input wsaw:Action="http://schemas.microsoft.com/office/Excel/Server/WebServices/ExcelServerInternalService/ExcelServiceSoap/ProcessRestRequest" message="tns:ExcelServiceSoap_ProcessRestRequest_InputMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:output wsaw:Action="http://schemas.microsoft.com/office/Excel/Server/WebServices/ExcelServerInternalService/ExcelServiceSoap/ProcessRestRequestResponse" message="tns:ExcelServiceSoap_ProcessRestRequest_OutputMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:fault wsaw:Action="http://schemas.microsoft.com/office/Excel/Server/WebServices/ExcelServerInternalService/ExcelServiceSoap/ProcessRestRequestExcelServerMessageFault" name="ExcelServerMessageFault" message="tns:ExcelServiceSoap_ProcessRestRequest_ExcelServerMessageFault_FaultMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
 </wsdl:operation>

The protocol client sends an ExcelServiceSoap_ProcessRestRequest_InputMessage request message, and the protocol server responds with an ExcelServiceSoap_ProcessRestRequest_OutputMessage response, message as follows:

The protocol server runs several operations as described as follows.  For each of these, the CommandParameter (section 2.2.4.20) input is constructed as follows:

  • The ProtocolClientId field of the CommandParameter will be set to ms-rest.

  • The StateId field of the CommandParameter will be set to -1.

  • The RequestSiteId field of the CommandParameter will be set to the RequestSiteId property of the request parameter.

  • The WorkbookId field of the CommandParameter will be set as follows:

    • For the OpenWorkbook operation (described in step 1.a), it will not be set.

    • For all other operations it will be set to the stored session identifier, which is obtained in step 1.

  1. The protocol server will first obtain a session identifier as follows:

    1. If the OpenWorkbookInParameters field of the request parameter in the ProcessRestRequest input is specified:

      1. The protocol server will perform the OpenWorkbook operation as specified in section 3.1.4.30.

      2. The inParameters for the OpenWorkbook operation are specified by the OpenWorkbookInParameters of request parameter in the ProcessRestRequest input.

      3. The OpenWorkbookOutParameters field of the result in the ProcessRestRequestResponse will be set to the outParameters field of the OpenWorkbookResponse.

      4. The workbookId field of the OpenWorkbookResponse will be used as the WorkbookId field of all CommandParameter objects used in the steps following this one.

    2. If the OpenWorkbookInParameters field of the request parameter in the ProcessRestRequest input is not specified:

      1. The SessionId field of the request parameter in the ProcessRestRequest input MUST be a valid session identifier.  The protocol server will set the WorkbookId field of all CommandParameter objects used in the steps following this one to the value of the SessionId field of the request parameter in the ProcessRestRequest input.

  2. If the ListOfCellsToSet field of the request parameter in the ProcessRestRequest input is specified and its length is not zero, the protocol server will then perform the SetRangeA1 operation as specified in section 3.1.4.44 as follows:

    1. The parameter parameter of the SetRangeA1 input will be prepared as described previously.

    2. The setRangeRequests parameter of the SetRangeA1 input will be set specified as the ListOfCellsToSet field of the request parameter in the ProcessRestRequest input.

  3. The protocol server will then perform a different operation depending on the type of the request parameter in the ProcessRestRequest input as follows:

    1. RestRequest (section 3.1.4.56.3.1):

      1. The result field of the ProcessRestRequestResponse will be of type RestResult (section 3.1.4.56.3.2).

      2. The protocol server will not perform any additional operations in this step.

    2. RestChartPngRequest (section 2.2.4.54):

      1. The result field of the ProcessRestRequestResponse will be of type RestChartPngResult (section 2.2.4.55).

      2. The protocol server will perform the GetChart operation as specified in section 3.1.4.14

      3. The parameter parameter of the GetChart input will be prepared as described previously.

      4. The getChartInformation parameter of the GetChart input will be specified with Height as -1, Width as -1, and Name equal to the ChartName field of the request parameter in the ProcessRestRequest input.

      5. The result field of the ProcessRestRequestResponse will have the ImageFormatType field set to the imageFormatType field of the GetChartResponse and the ImageData field set to the binaryChartImage field of the GetChartResponse.

    3. RestRangePngRequest (section 2.2.4.61):

      1. The result field of the ProcessRestRequestResponse will be of type RestPngResult (section 2.2.4.58).

      2. The protocol server will perform the GetRangeImage operation as specified in section 3.1.4.54.

      3. The parameter parameter of the GetRangeImage input will be prepared as described previously.

      4. The getRangeImageInformation parameter of the GetRangeImage input will be specified with RangeId as the RangeName field in the request parameter in the ProcessRestRequest input.  ShowHeaders will be set to 1 if the Nov field of the request parameter in the ProcessRestRequest input is true and 0 otherwise.

      5. The result field of the ProcessRestRequestResponse will have the ImageFormatType field set to the imageFormatType field of the GetRangeImageResponse and the ImageData field set to the binaryRangeImage field of the GetRangeImageResponse.

    4. RestPublishedObjectsRequest (section 2.2.4.59):

      1. The result field of the ProcessRestRequestResponse will be of type RestPublishedObjectsResult (section 2.2.4.60).

      2. The protocol server will perform the GetPublishedObjects operation as specified in section 3.1.4.20.

      3. The parameter parameter of the GetPublishedObjects input will be prepared as described previously.

      4. The options parameter of the GetPublishedObjects input will be specified as the Options field in the request parameter in the ProcessRestRequest input.

      5. The result field of the ProcessRestRequestResponse will have the PublishedObjects field set to the publishedObjects field of the GetPublishedObjectsResult.

    5. RestRangeValuesRequest (section 2.2.4.62):

      1. The result field of the ProcessRestRequestResponse will be of type RestRangeValuesResult (section 2.2.4.63).

      2. The protocol server will perform the GetRangeValuesA1 operation as specified in section 3.1.4.24.

      3. The parameter parameter of the GetRangeValuesA1 input will be prepared as described previously.

      4. The rangeRequests parameter of the GetRangeValuesA1 input will be specified as an ArrayOfRangeValuesA1 containing a single RangeValuesA1 as follows:

        1. If the NamedObjectType field of the request parameter in the ProcessRestRequest input is specified, then the RangeName field of the RangeValuesA1 object will be set to the RangeReference corresponding to the published item with the name given by the Name field of the request parameter in the ProcessRestRequest input. 

        2. If the NamedObjectType field of the request parameter in the ProcessRestRequest input is not specified, then the RangeName field of the RangeValuesA1 object will be set to the Name field of the request parameter in the ProcessRestRequest input.  The Name field of the request parameter in the ProcessRestRequest input MUST follow the RangeReference specification, with the following exceptions: The protocol server MUST support the R1C1 notation. If the value is longer than 287 characters, then the protocol server MUST return an ExcelServerMessage as specified in section 2.2.4.24, with the value of the Id element of the ExcelServerMessage set to EcsInvalidNamedObject.

      5. The formatting parameter of the GetRangeValuesA1 input will be specified as CellDataFormat.Formatted, CellDataFormat.Unformatted, and CellDataFormat.Compound.

      6. The result field of the ProcessRestRequestResponse will have the Values field set to the Values field of the RangeValuesA1 object constructed previously, once the operation has been processed.

    6. RestRangeXmlRequest (section 2.2.4.64):

      1. The result field of the ProcessRestRequestResponse will be of type RestRangeXmlResult (section 2.2.4.65).

      2. The protocol server will perform the GetRange operation as specified in section 3.1.4.21.

      3. The parameter parameter of the GetRange input will be prepared as described previously and modified as follows:

        1. The StateId field of the CommandParameter will be set to the StateId field of the request parameter in the ProcessRestRequest input.

        2. The VisibleSheetRangeRequest field of the CommandParameter will be set as new VisibleSheetRange created as follows:

          1. The FirstRow, FirstColumn, VisibleRowsRequested, VisibleColumnsRequested, VisibleFirstRowOffset, and VisibleFirstColumnOffset fields will be set to 0.

          2. If the IsPrintRequest field of the request parameter in the ProcessRestRequest input is false:

            1. The RequestLimits field of the CommandParameter will be set to a RequestLimits object with the CellCount field set to the protocol server setting for the maximum number of cells returned in a REST request.

            2. If the NamedObjectView field of the request parameter in the ProcessRestRequest input is true:

              • The ObjectName field of the VisibleSheetRange will be set to the RangeName field of the request parameter in the ProcessRestRequest input.

              • The DisallowAutoNOV field of the VisibleSheetRange will be set to false.

            3. If the NamedObjectView field of the request parameter in the ProcessRestRequest input is false:

              • The ExcelRange field of the VisibleSheetRange will be set to the RangeName field of the request parameter in the ProcessRestRequest input.

              • The DisallowAutoNOV field of the VisibleSheetRange will be set to true.

          3. If the IsPrintRequest field of the request parameter in the ProcessRestRequest input is false:

            1. The RequestLimits field of the CommandParameter will be set to a RequestLimits object with the CellCount field set to the protocol server setting for the maximum number of cells that can be printed.

            2. The ObjectName field of the VisibleSheetRange will be set to the ObjectName field of the request parameter in the ProcessRestRequest input.

            3. The ExcelRange field of the VisibleSheetRange will be set to the RangeName field of the request parameter in the ProcessRestRequest input.

            4. The DisallowAutoNOV field of the VisibleSheetRange will be set to the DisallowAutoNOV field of the request parameter in the ProcessRestRequest input.

          4. The NeedAllBorderValues field of the VisibleSheetRange will be set to true.

      4. The result field of the ProcessRestRequestResponse will have the CommandResult field set to the result field of the GetRangeResponse and the IsChromeRtl field set to true if the UI culture of the session (2) associated with the ProcessRestRequest operation defaults to right-to-left text ordering.

    7. RestWorkbookRequest (section 2.2.4.66):

      1. The result field of the ProcessRestRequestResponse will be of type RestWorkbookResult (section 2.2.4.67).

      2. The protocol server will perform the GetWorkbook operation as specified in section 3.1.4.29.

      3. The parameter parameter of the GetWorkbook input will be prepared as described previously.

      4. The workbookType parameter of the GetWorkbook input will be the WorkbookType FullSnapshot unless the OpenWorkbook operation was run in step 1.a and the OpenWorkbookOutFlags returned included ViewOnly, in which case the WorkbookType PublishedItemsSnapshot will be used.

      5. The result field of the ProcessRestRequestResponse will have the WorkbookBits field set to the bits field of the GetWorkbookResponse.

    8. RestODataRequest: (section 2.2.4.56)

      1. The result field of the ProcessRestRequestResponse will be of type RestODataResult (section 2.2.4.57).

    9. RestOpenWorkbookRequest (section 2.2.4.75):

      1. The result field of the ProcessRestRequestResponse will be of type RestOpenWorkbookResult (section 2.2.4.76).

      2. The protocol server will not perform any additional operations in this step.

      3. The result field of the ProcessRestRequestResponse will have the SessionId field set to the session identifier determined in step 1.

  4. If the OpenWorkbook operation was invoked in step 1.a and the type of the request parameter in the ProcessRestRequest input is not RestOpenWorkbookRequest, the protocol server will perform the CloseWorkbook operation as specified in section 3.1.4.8 as follows:

    1. The parameter parameter of the CloseWorkbook input will be prepared as described previously.

    2. The forceSync parameter of the CloseWorkbook input will be set to false.

In the event of an application error on the protocol server during this operation, a SOAP fault is returned, as specified in section 2.2.2. The Id element of the ExcelServerMessage SHOULD<73> be one of the values specified in section 2.2.2.1 or any of the following values:

  • RestBiff8Unsuported

  • Any of the values supported by these operations:

    • OpenWorkbook (section 3.1.4.30)

    • SetRangeA1 (section 3.1.4.44)

    • GetChart (section 3.1.4.14)

    • GetRangeImage (section 3.1.4.54)

    • GetPublishedObjects (section 3.1.4.20)

    • GetRangeValuesA1 (section 3.1.4.24)

    • GetRange (section 3.1.4.21)

    • GetWorkbook (section 3.1.4.29)