Пример #1
0
StringBuffer& CLogThread::serializeRequest(IEspContext& context,IInterface& logInfo, StringBuffer& returnStr)
{
    IRpcSerializable* rpcreq = dynamic_cast<IRpcSerializable*>(&logInfo);
    if(rpcreq==NULL)
        throw MakeStringException(500,"Issue serializing log information");

    // We want to serialize anything here for logging purpose: e.g., internal user fields: CompanyId
    // rpcreq->serialize(&context,returnStr, "LogData");
    // rpcreq->serialize(NULL,returnStr, "LogData");

    //BUG#26047
    //logInfo function parameter is instance of the incoming request object of the service.
    //instance objects of context and request are dependent upon the protocol binding.
    //Request parameters are relevent for HTTP protocol but are not relevent for protocolX.
    //Since request parameters pointer is not initilized in processing protocolX request it remains NULL
    //and causing this crash.
    IProperties* params = context.queryRequestParameters();
    if(params!=NULL)
    {
        bool notInternal = !params->hasProp("internal");
        if (notInternal)
            params->setProp("internal","1");
        rpcreq->serialize(&context,returnStr, "LogData");
        if (notInternal)
            params->removeProp("internal");
    }else{
        rpcreq->serialize(NULL,returnStr, "LogData");
    }

    return returnStr;
}
Пример #2
0
/* return false if the name is already defined. */
bool CXmlScope::declareValue(const char *name)
{
    if (locals && locals->hasProp(name))
        return false;
    
    if (!locals)
        locals = createProperties(true);
    locals->setProp(name, "");

    return true;
};