2015-10-06 37 views
0

我需要在URL中發送數組。我試過不同的方式,如如何在mule esb中的url中發送數組?

http://localhost:8081/?RedundedItems[]=[00,11] 
http://localhost:8081/?RedundedItems[]=00,11 
http://localhost:8081/?RedundedItems=00&RedundedItems=11 
http://localhost:8081/?RedundedItems[]=00&RedundedItems[]=11 

請幫助我。

+0

你使用什麼樣的mule版本?你會得到什麼結果?第三個選項應該允許你從屬性'''http.query.params'''中檢索值。 – afelisatti

回答

0

很抱歉,但我真的不認爲這是可能的,或者即使出現奇蹟是這樣,我不認爲這是現實...

一個解決辦法是把你的數據作爲普通,也許它加工成通過數據映射器的數組?

希望我有一些幫助。

JB

0

使用你的第三個選項的以下工作:

<flow name="request-testFlow"> 
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/> 
    <set-payload value="#[message.inboundProperties.'http.query.params'.getAll('RedundedItems')]" doc:name="Set Payload"/> 
    <object-to-string-transformer doc:name="Object to String"/> 
</flow> 

所以打http://localhost:8081/?RedundedItems=00&RedundedItems=11輸出爲:[00,11]。

HTH。