2015-05-27 48 views
0

我有一个基本的骡子流程:从URL获取XML与骡子

<?xml version="1.0" encoding="UTF-8"?> 

<mule xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" 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" version="EE-3.5.2" 
    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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd 
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd 
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd"> 
    <flow name="flow_test" doc:name="flow_test"> 
     <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8089" doc:name="HTTP"/> 
     <logger level="INFO" doc:name="Logger"/> 
     <logger message="#[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/> 

    </flow> 
</mule> 

我使用logger使用这个值由控制台显示一条消息:

#[message.payloadAs(java.lang.String)] 

的问题是,只有我得到这样的信息:

INFO 2015年5月27日12:36:42659 [[测试] .connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor:/

其中“/”值将是XML。我需要做什么来显示XML?

更新:问题是http.method INBOUND是GET并且它将POST以显示数据。我可以将GET转换为POST吗?

谢谢。

回答

0

你不需要在HTTP入站端点序变换任何事情来得到数据......如果你帖子中的某些数据使用REST客户端邮递员该流程中,您将自动获得在你的数据流量并可以在记录器中打印。

你只需将数据发布由外而这种流动正如我提到的使用REST客户端邮递员 ..你将自动获得在流中的数据