我如何为位于Mule ESB文档上的这个示例工作?:
<http:request-config name="HTTP_Request_Configuration" host="example.com" port="8081" doc:name="HTTP_Request_Configuration"/>
<flow name="test_flow">
<set-variable variableName="customMap" value="#[{'k2':'new', 'k3':'v3'}]" /
<http:request request-config="HTTP_Request_Configuration" path="test" method="GET">
<http:request-builder>
<http:query-params expression="#[flowVars.custonMap]" />
</http:request-builder>
</http:request>
</flow>
我给了我这个错误!
- 消息:null(java.lang.NullPointerException)。信息 有效载荷的类型为:
- 字符串代码:MULE_ERROR - 2
异常堆栈是:
- null(java.lang.NullPointerException)org.mule.module.http.internal.HttpMapParam:41(null)
- null(java.lang.NullPointerException)。消息有效内容的类型为:String(org.mule.api.MessagingException)
醇>
org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
答案 0 :(得分:0)
错字:
<set-variable variableName="customMap"
随后用作 custonMap 而不是 customMap :
expression="#[flowVars.custonMap]"
答案 1 :(得分:0)
以下代码段可以帮助您解决问题
<set-variable variableName="customMap" value="Data" doc:name="Variable" />
<expression-component doc:name="Expression">
<![CDATA[flowVars.customMap]]></expression-component>