arc:script

Version 24.1.8906


arc:script

Version 24.1.8906


The arc:script keyword can be used to create script blocks that respond to REST methods.

Parameters

  • method: The HTTP method (GET, POST, PUT/PATCH/MERGE, or and DELETE) used to invoke the script. Specify multiple methods in a comma-separated list. This can be used to create REST-like services in ArcScript.

Control Attributes

None

Example

The following script defines the GetTransmissionDetails service. The script is executed only when GetTransmissionDetails is accessed using the POST method. The input parameters are defined in the body of the HTTP request.

<arc:script xmlns:arc="http://www.arcesb.com/ns/ArcScript/2">
  
  <arc:restrict user="admin" role="Administrators"/>
  
  <arc:info title="GetTransmissionDetails" description="Retrieves the transmission details of the application.">
    <input name="ConnectorId"          desc="The id of the connector." required="true"/>
    <input name="MessageId"       desc="The message Id." required="true"/>
    <input name="Direction"       desc="The direction of the transmission." values="Incoming,Outgoing" required="true"/>
    <output name="LogTimeCreated" desc="The time the log file was created."/>
    <output name="LogType"        desc="The type of the log file." />
    <output name="LogFile"        desc="The name of the log file." />
    <output name="LogPath"        desc="The path of the log file." />
  </arc:info>

  <arc:script method="POST">
    <arc:push op="portGetTransmissionDetails" />
  </arc:script>
</arc:script>