how can I create a class and decode/encode as json?

robertchen117 at gmail.com robertchen117 at gmail.com
Tue Jan 13 17:17:18 CET 2015


I want to send Message to rabbitmq and receive from rabbitmq, message format is below. 

how can I create a class and decode/encode as json? 

{
   "message":{
      "dateCreated": "1417713299",
      "sourceApplication": "ID",
	"destinationApplication": "Name",
      "messageUUID": "sdafdasdfas",
      "response-type":"queue",
      "response-type-details":"queue-name",
      "messageType":"request",
      "operations":[
         {
            "sequence":0,
            "operation":"add",
            "version":1,
            "data-type":"json",
            "data-schema":"a.json",
            "data-encoding":"base64",
            "data-encryption":"BLOWFISH",
            "data-encryption-keyname":"psk-name",
            "data":"<base64 data>"
         },
         {
            "sequence":1,
            "operation":"otherOperation",
            "version":2.1,
            "response-type":"topic",
            "response-type-details":"topic-name",
            "data-type":"XML",
            "data-schema":"ddd.xsd",
            "data-encoding":"string",
            "data-encryption":"NONE",
            "data":"<xml></xml>"
         }
      ]
   }
}

thanks.



More information about the Python-list mailing list