For this use case, the Mule flow executes remote command on AS/400

Mule code

Create Mule application that:

  1. listens for HTTP requests with AS400 command sent as query parameter (for example, http://localhost:8081/commandCall?command=CRTPF INFOVIEW/TSTMULE RCDLEN(10))

  2. Executes AS400 command

command_call_flow
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
	xmlns:as400="http://www.mulesoft.org/schema/mule/as400" xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.7.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/as400 http://www.mulesoft.org/schema/mule/as400/current/mule-as400.xsd">
    <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
    <as400:config name="AS400__Configuration_type_strategy" endpoint="*****" userid="*****" password="*****" doc:name="AS400: Configuration type strategy"/>
    <flow name="callAS400command">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/commandCall" doc:name="HTTP" responseStreamingMode="ALWAYS"/>
        <logger message="CommandCallDemo received message #[message]" level="INFO" doc:name="Logger"/>
        <set-variable variableName="command" value="#[message.inboundProperties.'http.query.params'.command]" doc:name="Set command"/>
        <as400:command-call config-ref="AS400__Configuration_type_strategy" cmd="#[flowVars.command]" doc:name="Command Call"/>
        <set-payload value="commandCall: #[flowVars.command] executed successfully" doc:name="Set Payload"/>
        <logger message="#[payload]" level="INFO" doc:name="Logger"/>
        <catch-exception-strategy doc:name="Catch Exception Strategy">
            <set-payload value="commandCall: #[flowVars.command] failed. Exception as follows #[exception.summaryMessage]" doc:name="Set Payload"/>
            <logger message="#[payload]" level="INFO" doc:name="Logger"/>
        </catch-exception-strategy>
    </flow>
</mule>