Question

O{bTyp | S{WCS-STD}bUsr | S{Paul R Dunaway}bUid | S{1350}sCmd | S{}sId | A{}sNme | S{}sUrl     | S{}sLbl | S{}sCok | S{}mMsg | S{All Other Software}fAct | S{}fTyp | S{}fKey | S{}fVal | S{}bUserType | S{CUST}transType | S{}mTsp | S{2012-01-26 15:03:04}}|O{bTyp | S{WCS-STD}bUsr | S{system}bUid | I{-1}sCmd | S{}sId | A{}sNme | S{}sUrl | S{}sLbl | S{}sCok | S{}mMsg | S{[An agent will be with you shortly.]}fAct | S{}fTyp | S{}fKey | S{}fVal | S{}bUserType | S{SYSTEM}transType | S{}mTsp | S{2012-01-26 15:03:04}}

This is used by our webchat system(Cisco UCCE/eGain) to store transcripts. I am looking to access them via C#/SQL but I am finding this encoding to be a bit weird. the above is after I cleaned out all the URL encoding bits example below

O%7BbTyp%20%7C%20S%7BWCS-STD%7DbUsr%20%7C%20S%7BPaul%20R%20Dunaway%7DbUid%20%7C%20S%7B1350%7DsCmd%20%7C%20S%7B%7DsId%20%7C%20A%7B%7DsNme%20%7C%20S%7B%7DsUrl%20%7C%20S%7B%7DsL
Was it helpful?

Solution

It seems to make a little more sense reindented:

O{
    bTyp | S{WCS-STD}
    bUsr | S{Paul R Dunaway}
    bUid | S{1350}
    sCmd | S{}
    sId | A{}
    sNme | S{}
    sUrl     | S{}
    sLbl | S{}
    sCok | S{}
    mMsg | S{All Other Software}
    fAct | S{}
    fTyp | S{}
    fKey | S{}
    fVal | S{}
    bUserType | S{CUST}
    transType | S{}
    mTsp | S{2012-01-26 15:03:04}
}
|
O{
    bTyp | S{WCS-STD}
    bUsr | S{system}
    bUid | I{-1}
    sCmd | S{}
    sId | A{}
    sNme | S{}
    sUrl | S{}
    sLbl | S{}
    sCok | S{}
    mMsg | S{[An agent will be with you shortly.]}
    fAct | S{}
    fTyp | S{}
    fKey | S{}
    fVal | S{}
    bUserType | S{SYSTEM}
    transType | S{}
    mTsp | S{2012-01-26 15:03:04}
}

(Please excuse me if I'm just restating the obvious.) This doesn't look like any form of serialization I've seen before; I don't think it's outside the realm of possibility to think it's proprietary. Values, contained within braces, can be of one of four data types, indicated by the character immediately preceding the opening brace: S for string, I for integer, O for object (a collection of values as named properties), or A, presumably for array. Object properties are named based on the string preceding the value and separated from it with a pipe character.

Some questions still remain:

  • What does an array value look like?
  • Why does the data type for bUid change from one object to the next?
  • Why is the whitespace so inconsistent? (I would assume whitespace is ignored when not part of the value.)
  • Why is a pipe character used to separate the two top-level objects? Is this how the array notation works?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top