mulesoft Module 6 quiz 解析
- 1. A web service implements an API to handle requests to http://acme.com/customers/{state}
- 2. A Mule application has a flow named parentFlow. The parentFlow contains an HTTP Request operation at the end of the flow. The parentFlow also contains a Set Variable operation right before the HTTP Request operation.
- 3. A Mule application has two flows named parentFlow and childFlow. The childFlow begins with an HTTP Listener.
- 4. Refer to the exhibit. What is the correct DataWeave expression for accessing the city Cleveland from the JSON payload?
- 5. A flow contains an HTTP Listener as the event source. What is the DataWeave expression to log the Content-Type header
- 6. What happens to the attirbutes of a Mule event in a flow after an outbound HTTP Request is made?
- 7. A Set Variable component saves the current payload to a variable with the name images.
- 8. What is NOT part of a Mule 4 event?
1. A web service implements an API to handle requests to http://acme.com/customers/{state}
A web client makes a request to this API implementation at http://acme.com/customers/CA
What is the correct DataWeave expression to retrieve the value CA?
A #[message.inboundProperties.‘http.uri.params’.state]
B #[message.payload.inboundProperties.‘http.uri.params’.state]
C #[attributes.‘http.uri.params’.state]
D #[state]
E #[attributes.uriParams.state]
答案:E,这章需区分message,attributes,variables,payload这几个组件
2. A Mule application has a flow named parentFlow. The parentFlow contains an HTTP Request operation at the end of the flow. The parentFlow also contains a Set Variable operation right before the HTTP Request operation.
What is the scope of the variable to the server receiving the HTTP Request from parentFlow?
A The variable is accessible in the server, can be changed, but changes are NOT seen back in parentFlow
B The variable is accessible in the server, can be changed, and changes are seen back in parentFlow
C The variable is NOT accessble in the server
D The variable is accessible in the server but is immutable
答案:C,只能access parentFlow的payload
3. A Mule application has two flows named parentFlow and childFlow. The childFlow begins with an HTTP Listener.
A variable is defined in parentFlow, then an HTTP Request is made to childFlow’s HTTP Listener with some headers set.
What is the scope of the variable and attributes in the parentFlow after childFlow returns a response?
A The variable is NOT accessible.All the attributes passed to childFlow are preserved
B The variable is accessible. All the attributes passed to childFlow are preserved
C The variable is NOT accessible. All the attributes passed to childFlow are removed or replaced.
D The variable is accessible. All the attributes passed to childFlow are removed or replaced
答案:D
4. Refer to the exhibit. What is the correct DataWeave expression for accessing the city Cleveland from the JSON payload?
A #[payload[1].city]
B #[payload.city[1]]
C #[payload.city[2]]
D #[payload[2].city]
答案:A
5. A flow contains an HTTP Listener as the event source. What is the DataWeave expression to log the Content-Type header
using a Logger component?
A #[“Content-Type:” + headers.‘content-type’]
B #[“Content-Type:” ++ attributes.headers.‘content-type’]
C #[“Content-Type:” + attributes.headers.‘content-type’]
D #[“Content-Type:” ++ headers.‘content-type’]
答案:B
6. What happens to the attirbutes of a Mule event in a flow after an outbound HTTP Request is made?
A New attributes may be added from the HTTP response headers, but no headers are ever removed
B Attributes are replaced with new attributes from the HTTP Request response(which might be null)
C New attributes may be added from the HTTP response, but previous attributes are passed through unchanged
D Attributes do not change
答案:B
7. A Set Variable component saves the current payload to a variable with the name images.
What is the DataWeave expression to access the images variable?
A #[flowVars.images]
B #[images]
C #[payload.images]
D #[vars.images]
答案:D
8. What is NOT part of a Mule 4 event?
A variables
B payload
C outboundProperties
D attributes
E message
答案:C