Hi, I use Http service to get json content to config our test param, I have geted the content from our system. But I can not parse the content. this is my STAX script:
This is the log from STAX Monitor:
20180315-10:08:07 Info HttpTaskSearch RC=0, STAFResult={u'headers': None, u'statusMessage': u'', u'content': u'{"taskInstance":{"id":1,"inventory":{"id":1},"macAddress":null,"serialNo":"12345678","status":"primary","tests":[{"id":1}],"uuid":"1db3883b-3bb0-43a6-aaca-daf57c4d3c40"}}', 'staf-map-class-name': u'STAF/Service/HTTP/HttpResult', u'statusCode': u'200'}
20180315-10:08:07 Info content : {"taskInstance":{"id":1,"inventory":{"id":1},"macAddress":null,"serialNo":"12345678","status":"primary","tests":[{"id":1}],"uuid":"1db3883b-3bb0-43a6-aaca-daf57c4d3c40"}}
Since the content returned from the http service is unicode, I call encode('UTF8') , I use STAFMarshalling.isMarshalledData which return is false, I can not unmarshall the content. so my question is how to parse the content? Thanks very much!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I use Http service to get json content to config our test param, I have geted the content from our system. But I can not parse the content. this is my STAX script:
This is the log from STAX Monitor:
20180315-10:08:07 Info HttpTaskSearch RC=0, STAFResult={u'headers': None, u'statusMessage': u'', u'content': u'{"taskInstance":{"id":1,"inventory":{"id":1},"macAddress":null,"serialNo":"12345678","status":"primary","tests":[{"id":1}],"uuid":"1db3883b-3bb0-43a6-aaca-daf57c4d3c40"}}', 'staf-map-class-name': u'STAF/Service/HTTP/HttpResult', u'statusCode': u'200'}
20180315-10:08:07 Info content : {"taskInstance":{"id":1,"inventory":{"id":1},"macAddress":null,"serialNo":"12345678","status":"primary","tests":[{"id":1}],"uuid":"1db3883b-3bb0-43a6-aaca-daf57c4d3c40"}}
Since the content returned from the http service is unicode, I call
encode('UTF8')
, I useSTAFMarshalling.isMarshalledData
which return is false, I can not unmarshall the content. so my question is how to parse the content? Thanks very much!