2014-02-06 77 views
0

我需要用xml文件設計一個Mule流作爲JMS隊列的輸入。一旦進入隊列,它將被選中以訪問SOAP Web服務。以下是一個代碼。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 

代碼記錄儀給正確的內容類型,但仍繼續發生錯誤。

任何人都可以幫忙嗎?

在此先感謝

回答

0

您的問題與內容類型可能是由於老版本,因爲我不能複製。

但是,如果您想使用xml數據來調用SOAP Web服務,我認爲您的方法是不正確的。相反,您應該使用代理客戶端。類似這樣的:

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