My files are:
Test.xml(On remote machine)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">
<stax>
<defaultcall function = "Main"/>
<function name = "Main">
<function-list-args>
<function-arg-def name="path" type="required"/>
</function-list-args>
<sequence>
<script>
import os
dirlist = os.listdir(path)
</script>
<return>dirlist</return>
</sequence>
</function>
</stax>
Mian.xml(on local machine):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">
<stax>
<defaultcall function = "Main"/>
<script>
remoteJob = 'C:/tests/listDir.xml'
remoteMachine = 'staf3a'
remotePath = '\'C:/tests\''
</script>
<function name = "Main">
<sequence>
<stafcmd>
<location>remoteMachine</location>
<service>'STAX'</service>
<request>'EXECUTE FILE %s MACHINE %s ARGS %s WAIT RETURNRESULT' %
(remoteJob, remoteMachine, remotePath) </request>
</stafcmd>
<log message="1">STAFMarshalling.formatObject(STAFResult)</log>
</sequence>
</function>
</stax>
Then when you submit the local job, the log would have the following (i.e.
the dir listing from the remote machine in the "result"):
20100525-15:40:38 {
result : ['cvsbackup.xml', 'listDir.xml', 'Scenario1.xml',
'stress.xml']
endTimestamp : 20100525-15:39:17
status : Normal
staf-map-class-name: STAF/Service/STAX/JobResult
testcaseTotals : {}
startTimestamp : 20100525-15:39:17
jobID : 21
}
Hi All,
Can u please answer my query.
>From the above mentioned o/p by running the script , i only need the *result
*part.
Also i need to have two lists,one for files and other for directories so
that when i am transferring,
These two lists will be returned so that the files present in the fileList
are transferred using *FS copy file * and directories in the dirList can be
transferred using *FS Copy Dir. *
Is there anyway to do this.
Also is there any way to do it without using STAX/FS service.
Do let me know your inputs.
Thanks,
Sunny
------------------------------------------------------------------------------
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users