Subversion Repositories XServices

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
64 brianR 1
<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ExecuteServices</title><link href="corpstyle.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL-NS Stylesheets V1.76.1" name="generator"><link rel="home" href="index.html" title="Brutex XServices Documentation"><link rel="up" href="services.html" title="Chapter&nbsp;2.&nbsp;Available Services"><link rel="prev" href="services.html" title="Chapter&nbsp;2.&nbsp;Available Services"><link rel="next" href="fileservices.html" title="FileServices"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">ExecuteServices</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="services.html">Prev</a>&nbsp;</td><th align="center" width="60%">Chapter&nbsp;2.&nbsp;Available Services</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="fileservices.html">Next</a></td></tr></table><hr></div><div class="breadcrumbs"><span class="breadcrumb-link"><a href="index.html">Brutex XServices Documentation</a></span> &gt; <span class="breadcrumb-link"><a href="services.html">Available Services</a></span> &gt; <span class="breadcrumb-node">ExecuteServices</span></div><div class="section" title="ExecuteServices"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="executeservices"></a>ExecuteServices</h2></div></div></div><p>The ExecuteService bundles local and remote command
2
		execution operations. Its WSDL is located at
3
		http://server:port/XServices/ExecuteService?wsdl</p><div class="section" title="rExec"><div class="titlepage"><div><div><h3 class="title"><a name="N10089"></a>rExec
4
	</h3></div></div></div><p>provides remote execution facilities with authentication based on
5
		user names and passwords.</p><div class="section" title="Input parameters"><div class="titlepage"><div><div><h4 class="title"><a name="N10092"></a>Input parameters
6
		</h4></div></div></div><p></p><div class="table"><a name="N10096"></a><p class="title"><b>Table&nbsp;2.1.&nbsp;rExec
7
				input parameters
8
			</b></p><div class="table-contents"><table summary="rExec
9
				input parameters
10
			" border="1"><colgroup><col class="parameter"><col class="type"><col class="required"><col class="description"></colgroup><thead><tr><th>parameter</th><th>type</th><th>required</th><th>description</th></tr></thead><tbody><tr><td>host</td><td>HostConnection</td><td>Yes</td><td>
11
							Host where to execute the command. See
12
							<a class="link" href="xmltypes.html#hostconnection" title="HostConnection type">HostConnection</a>
13
							.
14
						</td></tr><tr><td>command</td><td>String</td><td>No</td><td>Any command including arguments</td></tr><tr><td>timeout</td><td>Long</td><td>Yes</td><td>Timeout in milliseconds. The command is forcefully terminated when timeout is reached.</td></tr></tbody></table></div></div><br class="table-break"><p></p></div><div class="section" title="Output parameters"><div class="titlepage"><div><div><h4 class="title"><a name="N100D4"></a>Output parameters
15
		</h4></div></div></div><div class="section" title="ReturnCode type"><div class="titlepage"><div><div><h5 class="title"><a name="N100D7"></a>ReturnCode type</h5></div></div></div><p>
16
		The ReturnCode type is used as the generic answer type for most of the
17
		<span class="application">BruteXservices</span>
18
		operations.
19
	</p><p>
20
		The defining Java class is
21
		<a class="ulink" href="javadoc/net/brutex/xservices/types/ReturnCode.html" target="_top">
22
			<code class="classname">net.brutex.xservices.types.ReturnCode</code>
23
		</a>
24
		.
25
	</p><h4><a name="N100ED"></a>Schema definition</h4><pre class="programlisting">
26
&lt;xs:complexType name="ReturnCodeType"&gt;
27
    &lt;xs:sequence&gt;
28
        &lt;xs:element name="returnCode" type="xs:int"/&gt;
29
        &lt;xs:element minOccurs="0" name="stdOut" type="xs:string"/&gt;
30
        &lt;xs:element minOccurs="0" name="stdErr" type="xs:string"/&gt;
31
        &lt;xs:element maxOccurs="unbounded" minOccurs="0" name="propertyList" nillable="true" type="<a class="link" href="">tns:antProperty</a>"/&gt;
32
    &lt;/xs:sequence&gt;
33
&lt;/xs:complexType&gt;
34
	</pre><h4><a name="N100F7"></a>Example XML</h4><pre class="programlisting">
35
		&lt;ReturnCode
36
		xmlns:ns2="http://ws.xservices.brutex.net"&gt;
37
		&lt;returnCode&gt;0&lt;/returnCode&gt;
38
		&lt;stdOut/&gt;
39
		&lt;stdErr/&gt;
40
		&lt;propertyList&gt;
41
		<em class="lineannotation"><span class="lineannotation">
42
			See
43
			<a class="link" href="">tns:antProperty</a>
44
			for details about the &lt;propertyList&gt; elements.
45
		</span></em>
46
		&lt;name&gt;key1&lt;/name&gt;
47
		&lt;value&gt;value1&lt;/value&gt;
48
		&lt;/propertyList&gt;
49
		&lt;propertyList&gt;
50
		&lt;name&gt;key2&lt;/name&gt;
51
		&lt;value&gt;value2&lt;/value&gt;
52
		&lt;/propertyList&gt;
53
		&lt;/ReturnCode&gt;
54
	</pre></div></div></div><div class="section" title="runCommand"><div class="titlepage"><div><div><h3 class="title"><a name="N10104"></a>runCommand</h3></div></div></div><p>Run an executable with arguments on the server providing the web
55
		service. The command is run within the environment and under the user
56
		privileges of the user who is running the Tomcat Server.</p><div class="section" title="Input parameters"><div class="titlepage"><div><div><h4 class="title"><a name="N1010D"></a>Input parameters
57
		</h4></div></div></div><p></p><div class="table"><a name="N10111"></a><p class="title"><b>Table&nbsp;2.2.&nbsp;runCommand input parameters</b></p><div class="table-contents"><table summary="runCommand input parameters" border="1"><colgroup><col class="parameter"><col class="type"><col class="required"><col class="description"></colgroup><thead><tr><th>parameter</th><th>type</th><th>required</th><th>description</th></tr></thead><tbody><tr><td>executable</td><td>String</td><td>Yes</td><td>Command to be run. The command may be specified with full
58
							path using forward slash "/" as path separator.</td></tr><tr><td>argline</td><td>String</td><td>No</td><td>Any command line arguments</td></tr><tr><td>timeout</td><td>Long</td><td>Yes</td><td>Timeout in milliseconds. The command is forcefully terminated when timeout is reached.</td></tr></tbody></table></div></div><br class="table-break"><p></p></div><div class="section" title="Output parameters"><div class="titlepage"><div><div><h4 class="title"><a name="N1014B"></a>Output parameters
59
		</h4></div></div></div><div class="section" title="ReturnCode type"><div class="titlepage"><div><div><h5 class="title"><a name="N1014E"></a>ReturnCode type</h5></div></div></div><p>
60
		The ReturnCode type is used as the generic answer type for most of the
61
		<span class="application">BruteXservices</span>
62
		operations.
63
	</p><p>
64
		The defining Java class is
65
		<a class="ulink" href="javadoc/net/brutex/xservices/types/ReturnCode.html" target="_top">
66
			<code class="classname">net.brutex.xservices.types.ReturnCode</code>
67
		</a>
68
		.
69
	</p><h4><a name="N10164"></a>Schema definition</h4><pre class="programlisting">
70
&lt;xs:complexType name="ReturnCodeType"&gt;
71
    &lt;xs:sequence&gt;
72
        &lt;xs:element name="returnCode" type="xs:int"/&gt;
73
        &lt;xs:element minOccurs="0" name="stdOut" type="xs:string"/&gt;
74
        &lt;xs:element minOccurs="0" name="stdErr" type="xs:string"/&gt;
75
        &lt;xs:element maxOccurs="unbounded" minOccurs="0" name="propertyList" nillable="true" type="<a class="link" href="">tns:antProperty</a>"/&gt;
76
    &lt;/xs:sequence&gt;
77
&lt;/xs:complexType&gt;
78
	</pre><h4><a name="N1016E"></a>Example XML</h4><pre class="programlisting">
79
		&lt;ReturnCode
80
		xmlns:ns2="http://ws.xservices.brutex.net"&gt;
81
		&lt;returnCode&gt;0&lt;/returnCode&gt;
82
		&lt;stdOut/&gt;
83
		&lt;stdErr/&gt;
84
		&lt;propertyList&gt;
85
		<em class="lineannotation"><span class="lineannotation">
86
			See
87
			<a class="link" href="">tns:antProperty</a>
88
			for details about the &lt;propertyList&gt; elements.
89
		</span></em>
90
		&lt;name&gt;key1&lt;/name&gt;
91
		&lt;value&gt;value1&lt;/value&gt;
92
		&lt;/propertyList&gt;
93
		&lt;propertyList&gt;
94
		&lt;name&gt;key2&lt;/name&gt;
95
		&lt;value&gt;value2&lt;/value&gt;
96
		&lt;/propertyList&gt;
97
		&lt;/ReturnCode&gt;
98
	</pre></div></div></div><div class="section" title="runCommandWithSSH"><div class="titlepage"><div><div><h3 class="title"><a name="N1017B"></a>runCommandWithSSH</h3></div></div></div><p>Executes a command through a SSH session.</p><div class="section" title="Input parameters"><div class="titlepage"><div><div><h4 class="title"><a name="N10184"></a>Input parameters
99
		</h4></div></div></div><p></p><div class="table"><a name="N10188"></a><p class="title"><b>Table&nbsp;2.3.&nbsp;runCommandWithSSH input parameters</b></p><div class="table-contents"><table summary="runCommandWithSSH input parameters" border="1"><colgroup><col class="parameter"><col class="type"><col class="required"><col class="description"></colgroup><thead><tr><th>parameter</th><th>type</th><th>required</th><th>description</th></tr></thead><tbody><tr><td>host</td><td>HostConnection</td><td>Yes</td><td>
100
							Host to connect to (see:
101
							<a class="link" href="xmltypes.html#hostconnection" title="HostConnection type">tns:HostConnection</a>
102
							)
103
						</td></tr><tr><td>command</td><td>String</td><td>No</td><td>The command to execute.</td></tr><tr><td>timeout</td><td>Long</td><td>Yes</td><td>Timeout in milliseconds. The command is forcefully terminated when timeout is reached.</td></tr></tbody></table></div></div><br class="table-break"><p></p></div><div class="section" title="Output parameters"><div class="titlepage"><div><div><h4 class="title"><a name="N101C6"></a>Output parameters
104
		</h4></div></div></div><div class="section" title="ReturnCode type"><div class="titlepage"><div><div><h5 class="title"><a name="N101C9"></a>ReturnCode type</h5></div></div></div><p>
105
		The ReturnCode type is used as the generic answer type for most of the
106
		<span class="application">BruteXservices</span>
107
		operations.
108
	</p><p>
109
		The defining Java class is
110
		<a class="ulink" href="javadoc/net/brutex/xservices/types/ReturnCode.html" target="_top">
111
			<code class="classname">net.brutex.xservices.types.ReturnCode</code>
112
		</a>
113
		.
114
	</p><h4><a name="N101DF"></a>Schema definition</h4><pre class="programlisting">
115
&lt;xs:complexType name="ReturnCodeType"&gt;
116
    &lt;xs:sequence&gt;
117
        &lt;xs:element name="returnCode" type="xs:int"/&gt;
118
        &lt;xs:element minOccurs="0" name="stdOut" type="xs:string"/&gt;
119
        &lt;xs:element minOccurs="0" name="stdErr" type="xs:string"/&gt;
120
        &lt;xs:element maxOccurs="unbounded" minOccurs="0" name="propertyList" nillable="true" type="<a class="link" href="">tns:antProperty</a>"/&gt;
121
    &lt;/xs:sequence&gt;
122
&lt;/xs:complexType&gt;
123
	</pre><h4><a name="N101E9"></a>Example XML</h4><pre class="programlisting">
124
		&lt;ReturnCode
125
		xmlns:ns2="http://ws.xservices.brutex.net"&gt;
126
		&lt;returnCode&gt;0&lt;/returnCode&gt;
127
		&lt;stdOut/&gt;
128
		&lt;stdErr/&gt;
129
		&lt;propertyList&gt;
130
		<em class="lineannotation"><span class="lineannotation">
131
			See
132
			<a class="link" href="">tns:antProperty</a>
133
			for details about the &lt;propertyList&gt; elements.
134
		</span></em>
135
		&lt;name&gt;key1&lt;/name&gt;
136
		&lt;value&gt;value1&lt;/value&gt;
137
		&lt;/propertyList&gt;
138
		&lt;propertyList&gt;
139
		&lt;name&gt;key2&lt;/name&gt;
140
		&lt;value&gt;value2&lt;/value&gt;
141
		&lt;/propertyList&gt;
142
		&lt;/ReturnCode&gt;
143
	</pre></div></div><div class="section" title="Sample Request:"><div class="titlepage"><div><div><h4 class="title"><a name="N101F6"></a>Sample Request:</h4></div></div></div><pre class="programlisting">
144
 
145
      &lt;ws:runCommandWithSSH&gt;
146
         &lt;host&gt;
147
            &lt;hostname&gt;ssh.brutex.net&lt;/hostname&gt;
148
            &lt;port&gt;22&lt;/port&gt;
149
            &lt;user&gt;roger&lt;/user&gt;
150
            &lt;password&gt;xxx&lt;/password&gt;
151
         &lt;/host&gt;
152
         &lt;command&gt;ls /etc/&lt;/command&gt;
153
         &lt;timeout&gt;30000&lt;/timeout&gt;
154
      &lt;/ws:runCommandWithSSH&gt;
155
	</pre></div></div><div class="section" title="telnet"><div class="titlepage"><div><div><h3 class="title"><a name="N101FC"></a>telnet</h3></div></div></div><p>Runs a telnet session with an "expect shell" like behaviour.</p><div class="section" title="Input parameters"><div class="titlepage"><div><div><h4 class="title"><a name="N10205"></a>Input parameters
156
		</h4></div></div></div><p></p><div class="table"><a name="N10209"></a><p class="title"><b>Table&nbsp;2.4.&nbsp;telnet input parameters</b></p><div class="table-contents"><table summary="telnet input parameters" border="1"><colgroup><col class="parameter"><col class="type"><col class="required"><col class="description"></colgroup><thead><tr><th>parameter</th><th>type</th><th>required</th><th>description</th></tr></thead><tbody><tr><td>host</td><td>HostConnection</td><td>Yes</td><td>Host to connect to (see: <a class="link" href="xmltypes.html#hostconnection" title="HostConnection type">tns:HostConnection</a>)</td></tr><tr><td>prompt</td><td>String</td><td>No</td><td>The prompt string to expect after login. This is used to recognize when
157
						 the session is open.</td></tr><tr><td>command</td><td>String</td><td>No</td><td>The command to execute.</td></tr><tr><td>expect</td><td>String</td><td>No</td><td>The prompt to expect after the command has been executed successfully.</td></tr><tr><td>timeout</td><td>Long</td><td>Yes</td><td>Timeout in milliseconds. The command is forcefully terminated when timeout is reached.</td></tr></tbody></table></div></div><br class="table-break"><p></p></div><div class="section" title="Output parameters"><div class="titlepage"><div><div><h4 class="title"><a name="N10259"></a>Output parameters</h4></div></div></div><div class="section" title="ReturnCode type"><div class="titlepage"><div><div><h5 class="title"><a name="N1025C"></a>ReturnCode type</h5></div></div></div><p>
158
		The ReturnCode type is used as the generic answer type for most of the
159
		<span class="application">BruteXservices</span>
160
		operations.
161
	</p><p>
162
		The defining Java class is
163
		<a class="ulink" href="javadoc/net/brutex/xservices/types/ReturnCode.html" target="_top">
164
			<code class="classname">net.brutex.xservices.types.ReturnCode</code>
165
		</a>
166
		.
167
	</p><h4><a name="N10272"></a>Schema definition</h4><pre class="programlisting">
168
&lt;xs:complexType name="ReturnCodeType"&gt;
169
    &lt;xs:sequence&gt;
170
        &lt;xs:element name="returnCode" type="xs:int"/&gt;
171
        &lt;xs:element minOccurs="0" name="stdOut" type="xs:string"/&gt;
172
        &lt;xs:element minOccurs="0" name="stdErr" type="xs:string"/&gt;
173
        &lt;xs:element maxOccurs="unbounded" minOccurs="0" name="propertyList" nillable="true" type="<a class="link" href="">tns:antProperty</a>"/&gt;
174
    &lt;/xs:sequence&gt;
175
&lt;/xs:complexType&gt;
176
	</pre><h4><a name="N1027C"></a>Example XML</h4><pre class="programlisting">
177
		&lt;ReturnCode
178
		xmlns:ns2="http://ws.xservices.brutex.net"&gt;
179
		&lt;returnCode&gt;0&lt;/returnCode&gt;
180
		&lt;stdOut/&gt;
181
		&lt;stdErr/&gt;
182
		&lt;propertyList&gt;
183
		<em class="lineannotation"><span class="lineannotation">
184
			See
185
			<a class="link" href="">tns:antProperty</a>
186
			for details about the &lt;propertyList&gt; elements.
187
		</span></em>
188
		&lt;name&gt;key1&lt;/name&gt;
189
		&lt;value&gt;value1&lt;/value&gt;
190
		&lt;/propertyList&gt;
191
		&lt;propertyList&gt;
192
		&lt;name&gt;key2&lt;/name&gt;
193
		&lt;value&gt;value2&lt;/value&gt;
194
		&lt;/propertyList&gt;
195
		&lt;/ReturnCode&gt;
196
	</pre></div></div><div class="section" title="Sample Request:"><div class="titlepage"><div><div><h4 class="title"><a name="N10289"></a>Sample Request:</h4></div></div></div><pre class="programlisting">
197
 
198
	 &lt;ws:telnet&gt;
199
         &lt;host&gt;
200
            &lt;hostname&gt;localhost&lt;/hostname&gt;
201
            &lt;port&gt;23&lt;/port&gt;
202
            &lt;user&gt;brosenberger&lt;/user&gt;
203
            &lt;password&gt;&lt;/password&gt;
204
         &lt;/host&gt;
205
         &lt;prompt&gt;C:\Users\brosenberger&amp;gt;&lt;/prompt&gt;
206
         &lt;command&gt;dir c:\temp&lt;/command&gt;
207
         &lt;expect&gt;enberger&amp;gt;&lt;/expect&gt;
208
         &lt;timeout&gt;60000&lt;/timeout&gt;
209
      &lt;/ws:telnet&gt;
210
	</pre></div></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="services.html">Prev</a>&nbsp;</td><td align="center" width="20%"><a accesskey="u" href="services.html">Up</a></td><td align="right" width="40%">&nbsp;<a accesskey="n" href="fileservices.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">Chapter&nbsp;2.&nbsp;Available Services&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%">&nbsp;FileServices</td></tr></table></div></body></html>