PutContext

Sets the value for the given name in the context properties. If there is an existing value present for the entity identified by the name, it is replaced. Context properties include the following constants: account ID, account password, service name, service key, and request ID.

Syntax

ASCII Version
void putContext(const char* name, const char* value) 
Unicode Version
void putContext(const UnicodeString name, const UnicodeString value) 

Parameters

  • Name with which the specified value is to be associated.
  • Value to be associated with the specified name

Example

ASCII Version
message->putContext(Message.CONTEXT_ACCOUNT_ID, "user1"); 
Unicode Version

Same as ASCII or:

UnicodeString account="user1" ;// Or input unicode string
message->putContext(Message.CONTEXT_ACCOUNT_ID, account);