wso2esb DOCTYPE声明;期望公共和系统之间的空间

时间:2016-03-02 12:45:06

标签: wso2esb

我创建了一个接受.xlsx文件作为POST输入的API。 代码如下:

<api xmlns="http://ws.apache.org/ns/synapse" name="classroomcourse" context="/classroomcourse">
<resource methods="POST">
  <inSequence>
     <log level="full"/>
     <property name="messageType" value="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" scope="axis2"/>
     <send>
        <endpoint>
           <http uri-template="http://qa-aaa.ggg.com/xyz/api/importCourses"/>
        </endpoint>
     </send>
  </inSequence>
  <outSequence>
     <log level="full"/>
     <property name="messageType" value="application/json" scope="axis2"/>
     <send/>
  </outSequence>

当我通过POSTMAN发送请求并附加xlsx文件时,我收到以下错误:

  

[2016-03-02 17:32:13,332]错误 - 构建直通流时出错{org.apache.synapse.transport.passthru.util.RelayUtils}   org.apache.axiom.om.OMException:com.ctc.wstx.exc.WstxUnexpectedCharException:意外字符&#39;&#34;&#39; (代码34)在DOCTYPE声明中;期待一个空间   公共和系统标识符之间的补间    在[row,col {unknown-source}]:[1,50]           在org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)           在org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:109)           在org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:570)           在org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:566)           在org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:149)           在org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:133)           在org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:98)           在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)           在org.apache.synapse.rest.Resource.process(Resource.java:297)

请指导我如何解决这个问题。

1 个答案:

答案 0 :(得分:0)

确保在axis2.xml文件中为ESB入站请求的内容类型启用了正确的消息构建器。

同时尝试删除inSequence中的<log level="full"/>