我需要发送XML格式的JSON里面我REST OSB 12C代理如下:在JSON字符串中是否允许换行符?
{
"login": "jstein",
"identityContext": "jazn.com",
"taskId": "string",
"payload": {
"any_0": {
"any_01": "<afastamento xmlns:ns1='http: //www.tjsc.jus.br/soa/schemas/comagis/AfastamentoMagistrado' xsi:type='def: AfastamentoMagistradoType' xmlns:xsi='http: //www.w3.org/2001/XMLSchema-instance' xmlns='http: //xmlns.oracle.com/bpel/workflow/task'>
<ns1:Magistrado>719</ns1:Magistrado>
<ns1:Status>Inicial</ns1:Status>
<ns1:Vaga>8770</ns1:Vaga>
<ns1:Tipo>Licenca Nojo</ns1:Tipo>
<ns1:PeriodoReferencia/>
<ns1:DataInicialSolicitada>2015-10-10</ns1:DataInicialSolicitada>
<ns1:DataFinalSolicitada>2015-11-05</ns1:DataFinalSolicitada>
</afastamento>"
}
},
"outcome": "Start"
}
的OSB 12C送我回的错误:
"errorMessage" : "ORABPEL-15235\n\nTranslation Failure.\nFailed to translate JSON to XML. org.codehaus.jackson.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: [email protected]; line: 7, column: 619]\nThe incoming data does not conform to the NXSD schema. Please correct the problem.\n"
我在JSONLint测试我的JSON请求,它总是给我的错误约开始的字符串与<
:
Parse error on line 7: "any_01": "<afastamento xmlns: -----------^ Expecting 'STRING, 'NUMBER, 'NULL', 'TRUE', FALSE', '{', '['
请仔细阅读[*我该怎么办时,有人回答我的问题?](http://stackoverflow.com/help/someone-answers)和[**接受**](http://meta.stackoverflow.com/q/5234/234215)答案如果你已经得到了帮助。谢谢。 – kjhughes