The ExecuteService bundles local and remote command execution operations. Its WSDL is located at http://server:port/XServices/ExecuteService?wsdl
provides remote execution facilities with authentication based on user names and passwords.
Table 2.1. rExec input parameters
parameter | type | required | description |
---|---|---|---|
host | HostConnection | Yes | Host where to execute the command. See HostConnection . |
command | String | No | Any command including arguments |
timeout | Long | Yes | Timeout in milliseconds. The command is forcefully terminated when timeout is reached. |
The ReturnCode type is used as the generic answer type for most of the BruteXservices operations.
The defining Java class is
net.brutex.xservices.types.ReturnCode
.
<xs:complexType name="ReturnCodeType"> <xs:sequence> <xs:element name="returnCode" type="xs:int"/> <xs:element minOccurs="0" name="stdOut" type="xs:string"/> <xs:element minOccurs="0" name="stdErr" type="xs:string"/> <xs:element maxOccurs="unbounded" minOccurs="0" name="propertyList" nillable="true" type="tns:antProperty"/> </xs:sequence> </xs:complexType>
<ReturnCode xmlns:ns2="http://ws.xservices.brutex.net"> <returnCode>0</returnCode> <stdOut/> <stdErr/> <propertyList> See tns:antProperty for details about the <propertyList> elements. <name>key1</name> <value>value1</value> </propertyList> <propertyList> <name>key2</name> <value>value2</value> </propertyList> </ReturnCode>
Run an executable with arguments on the server providing the web service. The command is run within the environment and under the user privileges of the user who is running the Tomcat Server.
Table 2.2. runCommand input parameters
parameter | type | required | description |
---|---|---|---|
executable | String | Yes | Command to be run. The command may be specified with full path using forward slash "/" as path separator. |
argline | String | No | Any command line arguments |
timeout | Long | Yes | Timeout in milliseconds. The command is forcefully terminated when timeout is reached. |
The ReturnCode type is used as the generic answer type for most of the BruteXservices operations.
The defining Java class is
net.brutex.xservices.types.ReturnCode
.
<xs:complexType name="ReturnCodeType"> <xs:sequence> <xs:element name="returnCode" type="xs:int"/> <xs:element minOccurs="0" name="stdOut" type="xs:string"/> <xs:element minOccurs="0" name="stdErr" type="xs:string"/> <xs:element maxOccurs="unbounded" minOccurs="0" name="propertyList" nillable="true" type="tns:antProperty"/> </xs:sequence> </xs:complexType>
<ReturnCode xmlns:ns2="http://ws.xservices.brutex.net"> <returnCode>0</returnCode> <stdOut/> <stdErr/> <propertyList> See tns:antProperty for details about the <propertyList> elements. <name>key1</name> <value>value1</value> </propertyList> <propertyList> <name>key2</name> <value>value2</value> </propertyList> </ReturnCode>
Sample request: Start Windows Command Interpreter and print "Hello World" to STDOUT.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net"> <soapenv:Header/> <soapenv:Body> <ws:runCommand> <executable>c:/windows/system32/cmd.exe</executable> <argline>/C "echo Hallo Welt!"</argline> <timeout>3000</timeout> </ws:runCommand> </soapenv:Body> </soapenv:Envelope>
Sample response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:runCommandResponse xmlns:ns2="http://ws.xservices.brutex.net"> <return> <returnCode>0</returnCode> <stdOut/> <stdErr/> <propertyList> <name>ExecuteService.result</name> <value>0</value> </propertyList> <propertyList> <name>ExecuteService.stdout</name> <value>Hallo Welt!</value> </propertyList> <propertyList> <name>ExecuteService.stderr</name> <value/> </propertyList> </return> </ns2:runCommandResponse> </soap:Body> </soap:Envelope>
Sample request: Start notepad.exe and close it after 15 seconds.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net"> <soapenv:Header/> <soapenv:Body> <ws:runCommand> <executable>c:/windows/system32/notepad.exe</executable> <argline></argline> <timeout>15000</timeout> </ws:runCommand> </soapenv:Body> </soapenv:Envelope>
Executes a command through a SSH session.
Table 2.3. runCommandWithSSH input parameters
parameter | type | required | description |
---|---|---|---|
host | HostConnection | Yes | Host to connect to (see: tns:HostConnection ) |
command | String | No | The command to execute. |
timeout | Long | Yes | Timeout in milliseconds. The command is forcefully terminated when timeout is reached. |
The ReturnCode type is used as the generic answer type for most of the BruteXservices operations.
The defining Java class is
net.brutex.xservices.types.ReturnCode
.
<xs:complexType name="ReturnCodeType"> <xs:sequence> <xs:element name="returnCode" type="xs:int"/> <xs:element minOccurs="0" name="stdOut" type="xs:string"/> <xs:element minOccurs="0" name="stdErr" type="xs:string"/> <xs:element maxOccurs="unbounded" minOccurs="0" name="propertyList" nillable="true" type="tns:antProperty"/> </xs:sequence> </xs:complexType>
<ReturnCode xmlns:ns2="http://ws.xservices.brutex.net"> <returnCode>0</returnCode> <stdOut/> <stdErr/> <propertyList> See tns:antProperty for details about the <propertyList> elements. <name>key1</name> <value>value1</value> </propertyList> <propertyList> <name>key2</name> <value>value2</value> </propertyList> </ReturnCode>
Runs a telnet session with an "expect shell" like behaviour.
Table 2.4. telnet input parameters
parameter | type | required | description |
---|---|---|---|
host | HostConnection | Yes | Host to connect to (see: tns:HostConnection) |
prompt | String | No | The prompt string to expect after login. This is used to recognize when the session is open. |
command | String | No | The command to execute. |
expect | String | No | The prompt to expect after the command has been executed successfully. |
timeout | Long | Yes | Timeout in milliseconds. The command is forcefully terminated when timeout is reached. |
The ReturnCode type is used as the generic answer type for most of the BruteXservices operations.
The defining Java class is
net.brutex.xservices.types.ReturnCode
.
<xs:complexType name="ReturnCodeType"> <xs:sequence> <xs:element name="returnCode" type="xs:int"/> <xs:element minOccurs="0" name="stdOut" type="xs:string"/> <xs:element minOccurs="0" name="stdErr" type="xs:string"/> <xs:element maxOccurs="unbounded" minOccurs="0" name="propertyList" nillable="true" type="tns:antProperty"/> </xs:sequence> </xs:complexType>
<ReturnCode xmlns:ns2="http://ws.xservices.brutex.net"> <returnCode>0</returnCode> <stdOut/> <stdErr/> <propertyList> See tns:antProperty for details about the <propertyList> elements. <name>key1</name> <value>value1</value> </propertyList> <propertyList> <name>key2</name> <value>value2</value> </propertyList> </ReturnCode>