ExecuteServices

The ExecuteService bundles local and remote command execution operations. Its WSDL is located at http://server:port/XServices/ExecuteService?wsdl

rExec

provides remote execution facilities with authentication based on user names and passwords.

Input parameters

Table 2.1. rExec input parameters

parametertyperequireddescription
hostHostConnectionYes Host where to execute the command. See HostConnection .
commandStringNoAny command including arguments
timeoutLongYesTimeout in milliseconds. The command is forcefully terminated when timeout is reached.

Output parameters

ReturnCode type

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 .

Schema definition

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

Example XML

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

runCommand

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.

Input parameters

Table 2.2. runCommand input parameters

parametertyperequireddescription
executableStringYesCommand to be run. The command may be specified with full path using forward slash "/" as path separator.
arglineStringNoAny command line arguments
timeoutLongYesTimeout in milliseconds. The command is forcefully terminated when timeout is reached.

Output parameters

ReturnCode type

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 .

Schema definition

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

Example XML

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

runCommandWithSSH

Executes a command through a SSH session.

Input parameters

Table 2.3. runCommandWithSSH input parameters

parametertyperequireddescription
hostHostConnectionYes Host to connect to (see: tns:HostConnection )
commandStringNoThe command to execute.
timeoutLongYesTimeout in milliseconds. The command is forcefully terminated when timeout is reached.

Output parameters

ReturnCode type

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 .

Schema definition

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

Example XML

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

	
      <ws:runCommandWithSSH>
         <host>
            <hostname>ssh.brutex.net</hostname>
            <port>22</port>
            <user>roger</user>
            <password>xxx</password>
         </host>
         <command>ls /etc/</command>
         <timeout>30000</timeout>
      </ws:runCommandWithSSH>
	

telnet

Runs a telnet session with an "expect shell" like behaviour.

Input parameters

Table 2.4. telnet input parameters

parametertyperequireddescription
hostHostConnectionYesHost to connect to (see: tns:HostConnection)
promptStringNoThe prompt string to expect after login. This is used to recognize when the session is open.
commandStringNoThe command to execute.
expectStringNoThe prompt to expect after the command has been executed successfully.
timeoutLongYesTimeout in milliseconds. The command is forcefully terminated when timeout is reached.

Output parameters

ReturnCode type

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 .

Schema definition

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

Example XML

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

	
	 <ws:telnet>
         <host>
            <hostname>localhost</hostname>
            <port>23</port>
            <user>brosenberger</user>
            <password></password>
         </host>
         <prompt>C:\Users\brosenberger&gt;</prompt>
         <command>dir c:\temp</command>
         <expect>enberger&gt;</expect>
         <timeout>60000</timeout>
      </ws:telnet>