2015-05-12 115 views
1

我需要ShipmentProcessImpl類或MuleEventContext對象內的有效負載值。如何在webservice類mule中獲取有效內容

<flow name="soaptest_rFlow1" doc:name="soaptest_rFlow1"> 
<http:inbound-endpoint exchange-pattern="request-response" 
host="${host}" port="${port}" doc:name="HTTP" path="${deliveryUpdatePath}" /> 
<byte-array-to-string-transformer 
doc:name="Byte Array to String" /> 
<logger category="ProTSP Listener Logger" level="INFO" message="#[payload]" 
doc:name="Logger" /> 

<cxf:jaxws-service serviceClass="org.tempuri.ShipmentProcess" 
doc:name="CXF" /> 
<component class="org.tempuri.ShipmentProcessImpl" doc:name="Java" /> 
</flow> 

我能夠使用@Lookup註釋獲得MuleContext類的對象,但我無法使用mulecontext對象得到有效載荷。

可以通過任何其他方式在webservice類中獲取有效內容。

回答

2

MuleContext是正在運行的Mule應用程序的活動上下文,它與流處理的當前MuleEvent無關。

您需要通過靜態調用org.mule.RequestContext.getEventContext()來獲得MuleEventContext的保留。

是的,它已經過時,但它仍然有效,並坦率地說,我不知道對服務類的實現替代的......

+1

仍然存在於3.7 – eebbesen