Setting AdditionalServers in Pyscan

33 views
Skip to first unread message

Jeff

unread,
May 21, 2007, 1:50:50 PM5/21/07
to AXF - General Discussion
Hello

I am encountering problems in the configuration of AdditionalServers
in Pyscan, eg

additionalServers = "test.wisc.edu;test2.wisc.edu"

iList = additionalServers.split(';')

appScanConfig = appScan.Scan.ScanData.Config

# the below fails
appScanConfig.set_AdditionalServers(iList)

Any thoughts? Thank you!

Watchfire AXF

unread,
May 22, 2007, 3:50:27 AM5/22/07
to axf-general...@googlegroups.com
Hi Jeff,

Python lists are not automatically converted to .Net Lists. However, Python
string is automatically converted to .Net string, so you can set the
additional-servers list one by one pretty quickly in the following way:

appScanConfig.AdditionalServers.Clear()
for additionalServer in iList:
appScanConfig.AdditionalServers.Add(additionalServer)

BTW[1] - you should use the SDK documentation to find the real method names,
instead of the methods that you see in Python (when using dir()), for
example, instead of using appScanConfig.set_AdditionalServers(iList), you
should use the method shown above -
appScanConfig.AdditionalServers.Add(additionalServer).

BTW[2] - in most cases, when you see a method that starts with set_ , you
can probably just set the value using =, for example:

Instead of calling set_X(value), you can just use X = value

Hope this clears things up,
-Ory

Jeffrey Savoy

unread,
May 23, 2007, 4:19:37 PM5/23/07
to axf-general...@googlegroups.com
Hello Ory

In terms of the SDK documentation, are you referring to appScanSDK.chm within the AppScan Docs folder?  This doc seems to contain examples in .net but not for Pyscan/Python?  For example, I do not find appScanConfig.AdditionalServers.Add() listed.  I am looking at the correct document/place?

Thank you!

-Jeffrey


Jeffrey Savoy, CISSP EnCE GCIA
Informaiton Security Officer
University of Wisconsin-Madison



On May 22, 2007, at 2:50 AM, Watchfire AXF wrote:


BTW[1] - you should use the SDK documentation to find the real method names,
instead of the methods that you see in Python (when using dir()), for
example, instead of using appScanConfig.set_AdditionalServers(iList), you
should use the method shown above -
appScanConfig.AdditionalServers.Add(additionalServer).


-Ory


Watchfire AXF

unread,
May 23, 2007, 4:32:36 PM5/23/07
to axf-general...@googlegroups.com
Hi Jeffrey,
 
Yes, you are referring to the right document. AppScan's SDK is .NET, and Pyscan is an integration of Python with the .NET SDK. That's why I suggested using the AppScanSDK help file to find out the method names.
 
With regards to the appScanConfig.AdditionalServers.Add() not being listed, I believe it's because the property appScanConfig.AdditionalServers, is a .NET String IList object. For some reason the IList documentation is missing (will be fixed), but most .NET lists have an Add() method, so this is probably why the Add() method exists for the AdditionalServers property.
 
Hope this helps,
-Ory
 
  


From: axf-general...@googlegroups.com [mailto:axf-general...@googlegroups.com] On Behalf Of Jeffrey Savoy
Sent: Wednesday, May 23, 2007 11:20 PM
To: axf-general...@googlegroups.com
Subject: {axf-general} Re: Setting AdditionalServers in Pyscan

Reply all
Reply to author
Forward
0 new messages