IMSCSAuthManager2::URLShopperArgs Method
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
Use this method to generate an encoded Uniform Resource Locator (URL) query string of name/value pairs and append the ticket to the query string if a ticket is set.
HRESULT IMSCSAuthManager::URLShopperArgs(
VARIANT* pVarURLParameters,
VARIANT* pVarURLValues,
BSTR* pbstrRet
);
Function URLShopperArgs(
pVarURLParameters As Variant,
pVarURLValues As Variant
) As String
Parameters
pVarURLParameters
[C++][in] A pointer to a VARIANT containing a SAFEARRAY of parameter names.
[Visual Basic]
[in] A SafeArray that contains the parameter names.
pVarURLValues
[C++][in] A pointer to a VARIANT containing a SAFEARRAY of parameter values corresponding to the parameter names.
[Visual Basic]
[in] A SafeArray that contains the values corresponding to the parameter names.
pbstrRet
[C++][out, retval] A pointer to a BSTR that contains the resulting encoded-URL query string.
[Visual Basic]
Not applicable.
Return Value
[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.
[Visual Basic] If this method completes successfully, it returns a String that contains the encoded-URL string.
Error Values
[C++] This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.
[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.
The following table shows the custom COM error that this method can return.
Constant |
Value |
Description |
---|---|---|
E_UPM_AUTHMANAGER_API_ASP_ONLY |
[C++] 0xC1004C24 [Visual Basic] &HC1004C24 |
This method should only be called within an ASP page. |
MSG_UPM_AUTH_SITE_NEEDED_ERROR |
[C++] 0xC1004C10 [Visual Basic] &HC1004C10 |
The Initialize method must be called with the installed site name before calling this method. |
[C++] 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.
[Visual Basic] Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.
Remarks
[C++] The pbstrRet parameter contains valid data only if the method completes successfully.
This method concatenates the parameter name/value pairs into a URL-encoded string and appends the ticket. This is useful for shopping support without cookies. This method will fail if the two arrays containing the parameters and values are not the same size.
If both types of tickets exist, the MSCSAuth ticket takes precedence.
Use the URLArgs method to perform URL encoding of parameter/value pairs without appending the ticket.
Example
' saParameterNames and saParameterValues are SafeArrays.
' sURLShopArg is a string.
' oAuthManager is a AuthManager object.
saParameterNames(0) = "sku1"
saParameterNames(1) = "sku3"
saParameterValues(0) = "12345"
saParameterValues(1) = "98765"
sURLShopArg = oAuthManager.URLShopperArgs(saParameterNames, saParameterValues)
' sURLShopArg =
' "?sku1=12345&sku3=98765&MSCSAuth=Q0H4SE915ASH2KC000Q79QB1E".