2014-02-06 7 views
0

Мне нужно создать поток Mule с файлом xml в качестве входа в очередь JMS. Однажды в очереди он будет поднят, чтобы попасть в веб-службу SOAP. Ниже приведен код.mule Missing ContentType

 <jms:activemq-connector name="Active_MQ" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ"/> 
<flow name="jmsFlow2" doc:name="jmsFlow2"> 
    <file:inbound-endpoint responseTimeout="10000" doc:name="File" path="D:\Input"/> 
    <byte-array-to-string-transformer doc:name="Byte Array to String"/> 
    <jms:outbound-endpoint queue="DimQueue" connector-ref="Active_MQ" doc:name="JMS" mimeType="text/plain"/> 
</flow> 
<flow name="jmsFlow1" doc:name="jmsFlow1"> 

    <jms:inbound-endpoint queue="DimQueue" connector-ref="Active_MQ" doc:name="JMS"/> 
    <jms:jmsmessage-to-object-transformer doc:name="JMSMessage to Object"/> 
    <logger message="#[message.payload]" level="INFO" doc:name="Logger"/> 
    <!-- <mulexml:object-to-xml-transformer doc:name="Object to XML"/> --> 
    <logger message="#[message.payload]" level="INFO" doc:name="Logger"/> 
    <set-property propertyName="Content-Type" value="application/soap+xml" doc:name="Property"/> 
    <logger message="#[message.outboundProperties]-------#[header:Content-Type]" level="INFO" doc:name="Logger"/> 
    <cxf:jaxws-service serviceClass="com.org.ProcessImpl" doc:name="SOAP" enableMuleSoapHeaders="false" mtomEnabled="true"> 
    </cxf:jaxws-service> 
    <http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="9090" method="POST" doc:name="HTTP"> 
    </http:outbound-endpoint> 
</flow> 

Это дает следующие ошибки:

WARN 2014-02-06 15:27:23,145 [[jms].jmsFlow1.stage1.02]org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://com.capgemini/cif/dim}ProcessActivityService has thrown exception, unwinding now 
    org.apache.cxf.binding.soap.SoapFault: Missing ContentType. 
at org.apache.cxf.binding.soap.jms.interceptor.SoapFaultFactory.createSoap11Fault(SoapFaultFactory.java:58) 
at org.apache.cxf.binding.soap.jms.interceptor.SoapFaultFactory.createFault(SoapFaultFactory.java:48) 
at org.apache.cxf.binding.soap.jms.interceptor.SoapJMSInInterceptor.createFault(SoapJMSInInterceptor.java:226) 
at org.apache.cxf.binding.soap.jms.interceptor.SoapJMSInInterceptor.checkContentType(SoapJMSInInterceptor.java:191) 
at org.apache.cxf.binding.soap.jms.interceptor.SoapJMSInInterceptor.handleMessage(SoapJMSInInterceptor.java:49) 
at org.apache.cxf.binding.soap.jms.interceptor.SoapJMSInInterceptor.handleMessage(SoapJMSInInterceptor.java:38) 
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) 
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) 
at org.mule.module.cxf.CxfInboundMessageProcessor.sendToDestination(CxfInboundMessageProcessor.java:320) 
at org.mule.module.cxf.CxfInboundMessageProcessor.process(CxfInboundMessageProcessor.java:142) 
at org.mule.module.cxf.config.FlowConfiguringMessageProcessor.process(FlowConfiguringMessageProcessor.java:52) 
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(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
at java.lang.Thread.run(Unknown Source) 
    Caused by: org.apache.cxf.binding.soap.jms.interceptor.JMSFault: Missing ContentType. 
at org.apache.cxf.binding.soap.jms.interceptor.JMSFaultFactory.createFault(JMSFaultFactory.java:111) 
at org.apache.cxf.binding.soap.jms.interceptor.JMSFaultFactory.createMissingContentTypeFault(JMSFaultFactory.java:72) 
at org.apache.cxf.binding.soap.jms.interceptor.SoapJMSInInterceptor.checkContentType(SoapJMSInInterceptor.java:188) 
... 38 more 

Регистраторы в коде дать правильный Content-Type, но все еще ошибка сохраняется.

Может ли кто-нибудь помочь?

Заранее спасибо

ответ

0

Ваш вопрос с Content-Type может быть из-за старой версии, так как я не могу воспроизвести его.

Однако, если вы хотите использовать XML-данные для вызова веб-службы SOAP, я думаю, что ваш подход неверен. Вместо этого вы должны использовать прокси-клиент. Что-то вроде этого:

<jms:inbound-endpoint queue="DimQueue" connector-ref="Active_MQ" doc:name="JMS"/> 
<set-property propertyName="Content-Type" value="application/soap+xml" doc:name="Property"/> 
<set-property propertyName="SOAPAction" value="urn:#myMethod" doc:name="Property"/> 
<cxf:proxy-client payload="envelope" doc:name="SOAP"/> 
<http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="9090" method="POST" doc:name="HTTP"> 
</http:outbound-endpoint> 
Смежные вопросы