Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE concept
PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-A88F4A4E-49D7-4F92-8047-CA287C54B964" xml:lang="en"><title>Transaction
Properties</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>Transaction properties are accessed using the <xref href="GUID-2E673024-239B-3965-8880-C47B7CC24EF6.dita#GUID-2E673024-239B-3965-8880-C47B7CC24EF6/GUID-88CFB38B-9E3F-389A-B020-F2E62A09998F"><apiname>RHTTPTransaction::PropertySet()</apiname></xref> method,
which returns an <xref href="GUID-C23D0EDB-E024-35AD-97E9-88FB6DC0EC7E.dita"><apiname>RHTTPTransactionPropertySet</apiname></xref> handle. They
are used to store information related to a transaction that is required to
persist during the transaction lifetime. Such information is not transmitted;
the mechanism only provides an association, mainly used by Symbian developers
for filter. </p>
<p>The two pre-defined properties that can be set by the client are <xref href="GUID-7BB3CFA5-4697-305D-B4FD-D8747BB56E04.dita#GUID-7BB3CFA5-4697-305D-B4FD-D8747BB56E04/GUID-C9F345D9-C713-3C99-AFEE-1292D1EB61D9"><apiname>HTTP::EUsername</apiname></xref> and <xref href="GUID-7BB3CFA5-4697-305D-B4FD-D8747BB56E04.dita#GUID-7BB3CFA5-4697-305D-B4FD-D8747BB56E04/GUID-A803D500-6EED-35BE-B0CB-B01B2150B1CC"><apiname>HTTP::EPassword</apiname></xref>.
Their use is described in <xref href="GUID-AA2A730E-A7C9-5647-AD42-11C3BAF4C38D.dita#GUID-AA2A730E-A7C9-5647-AD42-11C3BAF4C38D/GUID-8DB0C8B3-4ED6-59D6-A796-F4EA2DE5DC5B">Validation
filter</xref>. </p>
<p>An example of properties in use is taken from the Redirection filter, where
a count is maintained of the number of redirections made in response to 300-series
HTTP status codes: </p>
<codeblock id="GUID-4B3457B6-9B5C-551A-B830-4D839E01BACE" xml:space="preserve">// see if this transaction has been redirected before
THTTPHdrVal redirectCountProperty;
if (aTransaction.PropertySet().Property(p.StringF(HTTP::ERedirectCount,RHTTPSession::GetTable()),
redirectCountProperty))
{
__ASSERT_DEBUG(redirectCountProperty.Type() == THTTPHdrVal::KTIntVal, HTTPPanic::Panic(HTTPPanic::EHeaderInvalidType));
redirectCount = redirectCountProperty.Int();
__ASSERT_DEBUG(redirectCount > 0, HTTPPanic::Panic(HTTPPanic::EHeaderInvalidType));
}
// Only redirect a certain number of times, and update the redirect count property of the transaction
if (++redirectCount < KRedirectLimit)
aTransaction.PropertySet().SetPropertyL(p.StringF(HTTP::ERedirectCount,RHTTPSession::GetTable()), redirectCount);</codeblock>
</conbody></concept>