saveSession
Synopsis
string saveSession(SessionId sessionId,
string uri,
SaveSessionOptions* options)
throws SessionServiceFault;
See also: SessionId, SaveSessionOptions, SessionServiceFault
The saveSession operation saves the state of the current session into a pCon.basket compatible project (OBK) file. If the uri argument is an empty string, the project file is written to the working directory of the current session, and the operation returns an HTTP URL that can be used by the client to download the project file. The URL may be passed to the loadSession operation to load the project into the same session. If the project file is no longer needed, the client may use an HTTP DELETE request to delete the project file on the server.
If the uri argument is set to a FILE URL, the Online Configurator treats the URL’s path as a path into its local file system, and attempts to save the project file under this path. The egr.eai.server.file_access property of the session or server configuration file must be properly configured for this to work (§Allowed File Access).
URI schemes other than “file” are currently not supported.
The suffix option is ignored if an URI is specified.
A SessionServiceFault is returned if one of the following conditions occurs:
-
The
sessionIdparameter is not a valid string representation of an UUID or does not represent an open session. -
The
uriargument is not empty and the syntax of the URI is invalid. -
The
suffixoption is specified (and theuriargument is empty), and the suffix contains a character not allowed in file names, or would result in an otherwise invalid file name (like a file name whose length exceeds the maximum length of file names supported by the underlying file system). -
The
uriargument is not an empty string and the URI uses a scheme other than “file”. -
The FILE URL can not be converted into a path name.
-
The server has not been configured to be allowed access to the file referenced by the FILE URL.
-
The file already exists and the
overwriteoption has not been set totrue. -
legacyCalculationNameis not empty and does not specify the name of a calculation added to the project -
legacyCalculationNamespecifies a calculation added to the project, but the underlying pricing procedure is not considered eligible for export as a legacy calculation. -
legacyCalculationNameis empty, the project contains at least one calculation, and the operation is unable to identify a single calculation that is eligible for export as a legacy calculation (eligibility of multiple calculations is reason for failure). -
The Online Configurator encountered some other problem while saving the project file (input/output error, file system full, inconsistent session state, …).
For a pricing procedure to be considered eligible for export, all of the following conditions must be met:
-
The line tags
GROSS_SALES_PRICE(preferred) orPD_SALES_PRICEandNET_VALUEidentify a usable range of lines. -
None one of the line tags
GROSS_PURCHASE_PRICE,PD_PURCHASE_PRICEandPURCHASE_VALUEidentifies a line, or the identify a usable range of lines (GROSS_PURCHASE_PRICEis preferred overPD_PURCHASE_PRICE). -
The lines identified by the aforementioned tags must be subtotal lines, or price conditions with line insert mode
Always. -
The lines between the first and last line of the ranges specified above must be subtotal or text lines (both will be ignored by the export), or condition lines with condition classes
PriceorPriceModifier. (Condition classTaxand line typeCalculationBreakcause an error.)
All conditions are exported as item discounts, and the rounding of item discounts is disabled that the total net value of the exported legacy calculation is equal to the net value of the original calculation. For taxes this can not be guaranteed due to limitations of the legacy calculation scheme.