I'm a java developer that is tasked with creating some scripts that will handle large xml document file transfers by hitting some web service api's from windows xp client machines. There may be other document formats involved like .pdf, .doc, .xls or .txt, but I'm not sure on that at this point.

I've looked into powershell, groovy, perl, but I'm not sure which one would be the best to use as I've not done work with any of those and there may be a better alternative than these three I've listed.

So for security, ease of deployment, and maintenance for the script (not overly complicated to write or large), what would fit the best for these requirements?

  • Is there a reason it has to be a script and not a Java program (since you already know Java, I assume that would be easiest)? – FrustratedWithFormsDesigner Nov 1 '11 at 14:17
  • I don't believe they want the overhead of the java runtimes and jars. Maybe not size perse, but keeping deployments down to a minimum by using scripts. They want to keep the client machines free from that. I think that is why the manager was leaning towards powershell as it comes with windows. I guess not overly complicated really isn't a requirement, unless getting some huge perl script to do the task wouldn't be good from a maintenance standpoint. Although I don't think perl would be that large for this type of script. – user39741 Nov 1 '11 at 14:25
  • You want to send the files to webservices from within the XP client machines? – Ivo Nov 1 '11 at 14:27
  • @jamesDrinkard: Perl scripts would require a Perl interpreter and any modules the script needs. Maybe less overhead than a JVM but still something that has to be installed (unless the workstations already have Perl for some other reason). In this case, Poweshell or VBS might be better ways. – FrustratedWithFormsDesigner Nov 1 '11 at 14:36
  • 1
    I believe that the requirement will be for the script on a client machine to hit some web service api's that will do the document handling from a document repository. I think not having any extra runtimes or libraries installed on the clients may be a key determining factor, but I have to check on that. I guess the answer to that question that will direct me to the best solution. – user39741 Nov 1 '11 at 14:37

If can put an interpreter of your choice on the client computer then I would go with Groovy as it would be easiest for you as an experienced Java developer to use.

BUT I see in your responses that you may not have the option to load your interpreter on to the computer as groovy requires a JVM to run. Perl is not on an XP system by default and if you can't load a JVM you more then likely can not install Strawberry or Active State Perl. So this may limit you to Microsoft technologies that do not include Powershell (As Powershell is an add on for XP - you are not guarantied that it is there - and assuming you can not make the client down load it) This leaves Window Script Host - and JScript or VBScript (and for your sanity do not consider VBScirpt at all) or a native application.

If Powershell is available and you can insure the security is set to run scripts I would go with Powershell as my second choice. Followed by Windows Script Host as Windows Script Host gives access to a number of COM objects that can download and process XML but will have a learning curve from where you are coming from.

I would recommend in order Groovy Powershell then Windows Script Host

| improve this answer | |
  • Yes, as I was answering the questions with comments I realized I was voicing the constraints from the manager. I don't believe groovy is an option, but powershell actually doesn't look bad. I just did some work with vbscript/WSH, but without WMI it can't handle the remote file handling and powershell can. – user39741 Nov 1 '11 at 15:18

It looks like PowerShell has some cmdlets to efficiently handle transferring files. I think that's what I'd use in your case. Not much to install, and you are building on a supplied service, so performance should be good. I don't like PowerShell personally, but given your situation it looks like the most reasonable approach. Hopefully you won't find it as klunky as I do...

| improve this answer | |

You might find Jython interesting.

I find it really powerful being able to run Jython scripts from inside my Java programs, and instantiate Java classes inside my Python scripts. It's also nice to be able to re-factor a Jython class into a Java class for speed and then retest it using the unit tests you developed your Jython class with.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy