title: Mule is throwing error: No namespace on "someElement" element
body: <p>I provided snippet of my code that should work normally but it doesn't.</p>
  
  <p>In short, my flow is triggered by quartz, read some data from database, loop through results, on each loop do something and then finish.</p>
  
  <p>Everything works ok when result from service (http outbound) return that there is nothing to give back, but when choice (in flow) is not default it redirect to sub-flow where xslt perform and save file. File saves like it should (I checked with external tools if xml suits criteria) and logger prints out number 3 as proof that it is finished (couple of lines before error is thrown) but after that I get error given below. Anyone knows why? I am out of ideas.</p>
  
  <p>My flow:</p>
  
  <pre><code>&lt;flow name="msp2bassGettingContent" doc:name="Starter"&gt;
      &lt;quartz:inbound-endpoint responseTimeout="10000" doc:name="Quartz" jobName="Starter" repeatInterval="600000" startDelay="3000"&gt;
          &lt;quartz:event-generator-job groupName="Generator" jobGroupName="Generator"&gt;
              &lt;quartz:payload file="${prop.requestEvent}"/&gt;
          &lt;/quartz:event-generator-job&gt;
      &lt;/quartz:inbound-endpoint&gt;
      &lt;jdbc:outbound-endpoint exchange-pattern="request-response" queryKey="getUnreadedRoutes" queryTimeout="-1" connector-ref="JDBCConnector" doc:name="GetNulls"&gt;
          &lt;jdbc:query key="getUnreadedRoutes" value="SELECT routeid FROM kptemp WHERE readed IS NULL"/&gt;
      &lt;/jdbc:outbound-endpoint&gt;
      &lt;foreach collection="#[message.payload]" doc:name="For Each" counterVariableName="counter123"&gt;
          &lt;flow-ref name="msp2bass" doc:name="Flow Reference"/&gt;
      &lt;/foreach&gt;
  &lt;/flow&gt;
  
  &lt;sub-flow name="msp2bass" doc:name="msp2bassGetEvent"&gt;
      &lt;set-variable variableName="routeid" value="#[payload['routeid']]" doc:name="Variable"/&gt;
      &lt;set-payload value="&lt;a/&gt;;" doc:name="Set Payload"/&gt;
      &lt;mulexml:object-to-xml-transformer doc:name="Object to XML"/&gt;
      &lt;mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="${prop.createRequest}" doc:name="XSLT" ignoreBadInput="true"&gt;
          &lt;mulexml:context-property key="customerId" value="${prop.customerId}"/&gt;
          &lt;mulexml:context-property key="siteName" value="${prop.siteName}"/&gt;
          &lt;mulexml:context-property key="routeID" value="#[routeid]"/&gt;
      &lt;/mulexml:xslt-transformer&gt;
      &lt;cxf:proxy-client payload="body" doc:name="SOAP"&gt;
          &lt;cxf:outInterceptors&gt;
              &lt;spring:ref bean="WSS4JOutInterceptorBean"/&gt;
          &lt;/cxf:outInterceptors&gt;
      &lt;/cxf:proxy-client&gt;
      &lt;https:outbound-endpoint exchange-pattern="request-response" host="${prop.host}" port="${prop.port}" path="${prop.path}" method="POST" connector-ref="HTTP_HTTPS1" doc:name="HTTP"/&gt;
      &lt;byte-array-to-object-transformer doc:name="Byte Array to Object"/&gt;
      &lt;choice doc:name="Choice"&gt;
          &lt;when expression="#[xpath('boolean(//soap:Envelope/soap:Body/ns2:processComplexResponse/MSPResponse/serviceEvents/measurements/name)')]"&gt;
              &lt;flow-ref name="transform" doc:name="Flow Reference"/&gt;
          &lt;/when&gt;
          &lt;otherwise&gt;
              &lt;logger message="Not null: #[routeid]" level="INFO" doc:name="Logger"/&gt;
          &lt;/otherwise&gt;
      &lt;/choice&gt;
  &lt;/sub-flow&gt;
  
  &lt;sub-flow name="transform" doc:name="transform"&gt;
      &lt;logger message="Payload: #[payload]" level="INFO" doc:name="Logger"/&gt;
      &lt;mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="${prop.transformer}" doc:name="XSLT"/&gt;
      &lt;file:outbound-endpoint path="./work" outputPattern="#[routeid].xml" responseTimeout="10000" disableTransportTransformer="true" doc:name="File"/&gt;
      &lt;logger message="3" level="INFO" doc:name="3"/&gt;
  &lt;/sub-flow&gt;
  </code></pre>
  
  <p>Stack trace:</p>
  
  <pre><code>    INFO  2014-01-22 12:30:21,999 [[bass2msp].msp2bassGettingContent.stage1.02] org.mule.api.processor.LoggerMessageProcessor: Not null: IR_1389972193818
  INFO  2014-01-22 12:30:22,252 [[bass2msp].msp2bassGettingContent.stage1.02] org.mule.api.processor.LoggerMessageProcessor: Payload: SOME XML CONTENT
  INFO  2014-01-22 12:30:22,301 [[bass2msp].msp2bassGettingContent.stage1.02] org.mule.api.processor.LoggerMessageProcessor: 3
  WARN  2014-01-22 12:17:56,335 [[bass2msp].msp2bassGettingContent.stage1.04] org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://support.cxf.module.mule.org/}ProxyService#{http://support.cxf.module.mule.org/}invoke has thrown exception, unwinding now
    org.apache.cxf.binding.soap.SoapFault: No namespace on "rootNode" element.
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:109)
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:141)
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:799)
    at org.mule.module.cxf.transport.MuleUniversalConduit.dispatchMuleMessage(MuleUniversalConduit.java:280)
    at org.mule.module.cxf.transport.MuleUniversalConduit$2.handleMessage(MuleUniversalConduit.java:194)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:533)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:375)
    at org.mule.module.cxf.CxfOutboundMessageProcessor.doSendWithClient(CxfOutboundMessageProcessor.java:235)
    at org.mule.module.cxf.CxfOutboundMessageProcessor.process(CxfOutboundMessageProcessor.java:125)
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:95)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:54)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:26)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:70)
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:65)
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
    at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:106)
    at org.mule.routing.outbound.AbstractMessageSequenceSplitter.processParts(AbstractMessageSequenceSplitter.java:133)
    at org.mule.routing.outbound.AbstractMessageSequenceSplitter.process(AbstractMessageSequenceSplitter.java:63)
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:95)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:54)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:26)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:70)
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:65)
    at org.mule.routing.Foreach.process(Foreach.java:95)
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:95)
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
    at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:106)
    at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)
    at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:122)
    at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:192)
    at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:185)
    at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:20)
    at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:34)
    at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:18)
    at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:58)
    at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:48)
    at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:54)
    at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:44)
    at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:44)
    at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:52)
    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:32)
    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:17)
    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:113)
    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:34)
    at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:184)
    at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:43)
    at org.mule.work.WorkerContext.run(WorkerContext.java:311)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:679)
  ERROR 2014-01-22 12:17:56,340 [[bass2msp].msp2bassGettingContent.stage1.04] org.mule.exception.DefaultMessagingExceptionStrategy: 
  ********************************************************************************
  Message               : No namespace on "rootNode" element.. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: PostMethod
  Code                  : MULE_ERROR--2
  --------------------------------------------------------------------------------
  Exception stack is:
  1. No namespace on "rootNode" element. (org.apache.cxf.binding.soap.SoapFault)
    org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor:109 (null)
  2. No namespace on "rootNode" element.. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: PostMethod (org.mule.api.transport.DispatchException)
    org.mule.module.cxf.CxfOutboundMessageProcessor:144 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
  --------------------------------------------------------------------------------
  Root Exception stack trace:
  org.apache.cxf.binding.soap.SoapFault: No namespace on "rootNode" element.
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:109)
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:141)
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
  ********************************************************************************
  </code></pre>
  
  <p>Any help is appreciated! Thank you!</p>
  
  <h2>EDIT.1</h2>
  
  <p>I did some more research and I found out that problem is when call to subflow in my loop (for each) end. I have put logger after flow-ref and it printed ok till that error (file at the end of flow is generated but logger is quiet). So, is this known/unknown bug or something? Or do I somehow rewrite collection that is looping here: message.payload so that looper cannot read next value? But then, why logger after flow-ref doesn't get triggered inside loop at the end?</p>