我需要發送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