I'm trying to create a flow in Mule ESB (Enterprise Edition) that receives a message from a queue in WMQ 7.5 (xml payload), transforms it with DataWeave (for my purposes here, to a new xml file that is the same as the old one), and then puts it back on another queue. My flow is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd">
<wmq:connector (MQ configuration is here, it is not the problem) />
<flow name="dataweaveFlow">
<wmq:inbound-endpoint queue="I0" connector-ref="WMQ" doc:name="WMQ">
<wmq:transaction action="ALWAYS_BEGIN"/>
</wmq:inbound-endpoint>
<set-variable variableName="MULE_REPLYTO_STOP" value="true" doc:name="Variable"/>
<dw:transform-message doc:name="Transform Message">
<dw:input-payload doc:sample="empty_1.xml"/>
<dw:set-payload><![CDATA[%dw 1.0
%input payload application/xml
%output application/xml
---
payload]]></dw:set-payload>
</dw:transform-message>
<wmq:outbound-endpoint queue="O0" connector-ref="WMQ" doc:name="WMQ">
<wmq:transaction action="ALWAYS_JOIN"/>
</wmq:outbound-endpoint>
</flow>
</mule>
And my DataWeave configuration looks like this: Input:
<?xml version='1.0' encoding='windows-1252'?>
<empty/>
Transformation:
%dw 1.0
%input payload application/xml
%output application/xml
---
payload
Now, when I run this flow, and I put a message on the queue, Mule can't process the message and continually throws exceptions, saying: "Invalid mime type application/xml", and the exception stack is 1. Invalid mime type application/xml (com.mulesoft.weave.mule.exception.InvalidMimeTypeException) com.mulesoft.weave.mule.WeaveMessageProcessor:165 (null) 2. Invalid mime type application/xml (com.mulesoft.weave.mule.exception.InvalidMimeTypeException). Message payload is of type: String (org.mule.api.MessagingException) org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
Anyway, I'm fairly new to Mule (and certainly DataWeave), and help would be appreciated! Let me know if any more details are needed.