IMSCSAuthManager::GetURL
Use this method to generate an encoded Uniform Resource Locator (URL) string.
Definition
HRESULT IMSCSAuthManager::GetURL(BSTRFileName,BOOLfCookie,BOOLfSecure,VARIANT*pVarURLParameters,VARIANT*pVarURLValues,BSTR*pbstrRet);
Parameters
FileName
[in] A BSTR that contains the file name to reference in the URL.
fCookie
[in] A BOOL that indicates whether the user allows cookies.
fSecure
[in] A BOOL that indicates whether the URL is secure (HTTPS versus HTTP).
pVarURLParameters
[in, optional, defaultvalue (NULL)] A pointer to a VARIANT containing a SAFEARRAY of parameter names to include in the URL.
pVarURLValues
[in, optional] A pointer to a VARIANT containing a SAFEARRAY of parameter values that correspond to the parameter names.
pbstrRet
[out, retval] A pointer to a BSTR used to return the encoded URL.
Return Values
This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.
Error Values
This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.
The following table shows the custom COM errors that this method can return.
Constant | Value | Description |
E_UPM_AUTHMANAGER_API_ASP_ONLY | 0xC1004C24 | This method should only be called within an ASP page. |
MSG_UPM_AUTH_SITE_NEEDED_ERROR | 0xC1004C10 | The Initialize method must be called with the installed site name before calling this method. |
Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.
Remarks
The encoded URL includes the host name (retrieved from the site configuration), the virtual directory in which the file is stored (determined by the scripting context), the name of the file, flags for cookie support and security, and optional custom name/value pairs (for example, the name "SKU" and the stock-keeping unit (SKU) value for an item in a shopping cart).
If cookies are not allowed, the cookie flag is set to False and the ticket is appended to the URL.
Note
- When a cached HTML segment that contains a URL with an appended ticket is retrieved, the ticket needs to be replaced with the correct one (for the current user context).
The secure flag is set to True if the referenced host is secure.
Use the URLArgs or URLShopperArgs methods to encode a URL query string out of name/value pairs.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.
The pbstrRet parameter contains valid data only if the method completes successfully.