Volviendo a probar el ejemplo de esta entrada posteada hace ya un tiempo en el blog me topo con el siguiente error en la consola del ESB versión 4.9.0:
[2015-09-18 10:52:14,424] INFO - LogMediator To: /services/JsonToXMLProxy, MessageID: urn:uuid:c1847f1d-b755-486d-bf5b-13d2b3ac2494, Direction: request, TEMPERATURA_ENTRADA = 200 [2015-09-18 10:52:14,793] ERROR - RelayUtils Error while building Passthrough stream org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296) at org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:109) at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:570) at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:566) at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:149) at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:133) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:98) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:72) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:297) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:529) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:247) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) Caused by: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:36) at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681) at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214) ... 18 more [2015-09-18 10:52:14,796] ERROR - SequenceMediator Error while building message org.apache.axis2.AxisFault: Error while building Passthrough stream at org.apache.synapse.transport.passthru.util.RelayUtils.handleException(RelayUtils.java:283) at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:142) at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:98) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:72) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:297) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:529) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:247) at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) Caused by: org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296) at org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:109) at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:570) at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:566) at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:149) at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:133) ... 13 more Caused by: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:36) at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681) at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214) ... 18 more [2015-09-18 10:52:14,805] INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:fc858888-2316-4c5f-b210-b0d59c711ed5, Direction: response, MESSAGE = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = Error while building message, Envelope: <?xml version='1.0' encoding='utf-8'?><soap env:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope>Ummm, que extraño, esto no pasaba antes. :-D
Veamos que puede ser!!!!
Así mirando el log no dice mucho, por lo que rapidamente levanté el TCPMON e hice un ajuste en mi endpoint, dejandolo así:
NOTA: En otra entrada mostraré como habilitar WIRE en el ESB para no tener que usar el TCPMON.
<address uri="http://localhost:5555/webservices/tempconvert.asmx" format="soap11"/>
De esta manera puedo ver que es lo que va pasando por HTTP. El error aparece al momento:
HTTP/1.1 411 Length Required Via: 1.1 FWSOAINT Connection: Keep-Alive Proxy-Connection: Keep-Alive Content-Length: 357 Date: Fri, 18 Sep 2015 14:55:19 GMT Content-Type: text/html Server: ECSF (mia/176E) <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>411 - Length Required</title> </head> <body> <h1>411 - Length Required</h1> </body> </html>
El problema ocurre porque no se soporta la versión 1.1 de HTTP así que tenemos 2 variantes, obligamos al ESB a interactuar usando HTTP 1.0 o desabilitamos los chunkings.
La solución es la siguiente:
Si queremos forzar al ESB a usar HTTP 1.0 debemos agregar la siguiente propiedad en la sencuencia de entrada.
<property name="FORCE_HTTP_1.0" value="true" scope="axis2"/>
Si queremos desabilitar los chunkings debemos agregar la siguiente propiedad en la secuencia de entrada.
<property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
Y eso es todo.Ya el servicio vuelve a funcionar de nuevo.
Thank you very much! you saved me!
ResponderEliminar