2015-10-06 65 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。