Wenn ich versuchte, den Data Mapper Mediator zu verwenden, erhalte ich immer einen Fehler. Ich habe versucht, die JSON-Antwort auf XML zu mappen.Wso2 Data Mapper fehlgeschlagen
[2016-07-14 14:05:26,684] ERROR - omdbapi DataMapper mediator : mapping failed
XML not well-formed. Error occurred while processing start element event
at org.wso2.carbon.mediator.datamapper.engine.input.readers.XMLReader.read(XMLReader.java:97)
at org.wso2.carbon.mediator.datamapper.engine.input.InputModelBuilder.buildInputModel(InputModelBuilder.java:52)
at org.wso2.carbon.mediator.datamapper.engine.core.mapper.MappingHandler.doMap(MappingHandler.java:59)
at org.wso2.carbon.mediator.datamapper.DataMapperMediator.transform(DataMapperMediator.java:244)
at org.wso2.carbon.mediator.datamapper.DataMapperMediator.mediate(DataMapperMediator.java:209)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:83)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:49)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:160)
at org.apache.synapse.rest.Resource.process(Resource.java:320)
at org.apache.synapse.rest.API.process(API.java:336)
at org.apache.synapse.rest.RESTRequestHandler.apiProcess(RESTRequestHandler.java:120)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:100)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:55)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:304)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:541)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:179)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:252)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Hier ist meine API. Ich benutze nur die omdbapi, um ein Beispiel zu geben.
<?xml version="1.0" encoding="UTF-8"?>
<api context="/omdbapi" name="omdbapi" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" uri-template="/*">
<inSequence>
<send>
<endpoint>
<address trace="disable" uri="http://www.omdbapi.com/"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<datamapper config="gov:datamapper/omdbapiConfig.dmc" inputSchema="gov:datamapper/omdbapiConfig_inputSchema.json" inputType="XML" outputSchema="gov:datamapper/omdbapiConfig_outputSchema.json" outputType="XML"/>
<respond/>
</outSequence>
<faultSequence/>
</resource>
</api>
Nun, ich habe dieses Problem behoben, aber ich kann immer noch nicht die gemappte Ausgabe bekommen. hier ist mein heraus ' outSequence> ' –
Was ist der Fehler, den Sie haben? – Palle
Können Sie die von Ihnen gesendete Eingabenachricht und die Eingabeschema-Datei angeben. – Palle