We are generating xml using a web service(cobol code) in which we are doing an XML GENERATE to generate xml from a copybook. Now this generated XML consists of special characters like [·, Y, ¨] which show correctly in SOAP response. But when the same message is viewed in http logs, the characters get converted to HEX like below :
SOAP Response:
<StatusDesc>capital one bank Yusa¨ ,n.a</StatusDesc>
Http Log:
<StatusDesc>capital one bank [0xc3][0x9d]usa[0xc2][0xa8] ,n.a</StatusDesc>
Now to handle this we tried to do an XML GENERATE using the WITH ENCODING 1208 clause to support the UTF-8 encoding. This in turn generated the XML in unreadable format, and nothing was readable in SOAP response. So not sure if we are missing out on anything here or is this not how we should be handling the HEX characters in http log.
?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:mes="http://MessageView/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body>mes:???’_%??a???????????????a€1??a€??>??a€???a€??????a€???a?????>??a€????a????a€?>??a€|??a€????-???¨???£??????a€???????????a€???a€????????±>???’????±>??a€°???a??a€1????????????????/?????????a€1????????????/?????????a€1???¤???a???????????a€??????a?¢???????????/?????????a€1???¤???a?????????????????????????????????????
The question is that is there a way to handle these characters so that the hex characters in the http log get converted to their proper display. Should this be done in Cobol web service or do we need some kind of conversion to handle the http logs outside z/os.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…