Mohammad Irfan
Mohammad Irfan

Reputation: 89

wso2esb DOCTYPE declaration; expected a space between public and system

I have created an API that accepts a .xlsx file as POST input. Code is mentioned below:

<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>

When I send request via POSTMAN and attach xlsx file then I get the below error:

[2016-03-02 17:32:13,332] ERROR - Error while building Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils} org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space be tween public and system identifiers at [row,col {unknown-source}]: [1,50] 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.rest.Resource.process(Resource.java:297)

Kindly guide me how can I solve this issue.

Upvotes: 0

Views: 1789

Answers (1)

krishan
krishan

Reputation: 579

Make sure that the right message builder is enabled in the axis2.xml file, for the Content type of the ESB inbound request.

Also try removing the <log level="full"/> in inSequence.

Upvotes: 0

Related Questions