0
votes

How I can do for this example, located on Mule ESB documentation, work ?:

<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>

I am giving me this error!

  • Message : null (java.lang.NullPointerException). Message payload is of type:
  • String Code : MULE_ERROR--2

Exception stack is:

  1. null (java.lang.NullPointerException) org.mule.module.http.internal.HttpMapParam:41 (null)
  2. null (java.lang.NullPointerException). Message payload is of type: String (org.mule.api.MessagingException)
    org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
2
I consider and replace the host and port HTTP_Request_Configuration for a service available on the web, which returns a JSON response, the same way the parameters that do not affect the service and make it return an empty JSON (tested in the browser) and not the error. Any help is appreciated.Carlos Laspina

2 Answers

0
votes

Typo:

<set-variable variableName="customMap"

is subsequently used as custonMap not customMap in:

expression="#[flowVars.custonMap]"
0
votes

The following snippet helps you out

<set-variable variableName="customMap" value="Data" doc:name="Variable" />
<expression-component doc:name="Expression">
<![CDATA[flowVars.customMap]]></expression-component>