LWN.net Logo

Perl gets work done - SOAP?

Perl gets work done - SOAP?

Posted Nov 9, 2009 15:20 UTC (Mon) by rfunk (subscriber, #4054)
In reply to: Perl gets work done by job
Parent article: Perl far from dead, more popular than you think (Royal Pingdom)

Hah, I've recently had to write some code that needed to talk to a server
through a complex SOAP interface (100+ pages of bare-bones documentation).
The vendor provided documentation and sample interface code using C# and
PHP, but was clueless about Perl. Our project is written in Perl.

I thought it would be easy to grab a SOAP interface package from CPAN and
run with it. I was wrong.

I went through three different Perl SOAP modules, discovering that they were
all incomplete in some essential way, before finally punting and making our
Perl call a PHP script via exec(), er, open('|-').

Someday I may revisit the problem, but it shouldn't have been that hard in
the first place.


(Log in to post comments)

Perl gets work done - SOAP?

Posted Nov 9, 2009 19:14 UTC (Mon) by mps (guest, #32594) [Link]

I had same problem with SOAP about two years ago.
Solutions was simple: carefully read documentation and look to the samples on the SOAP::Lite Yahoo group and little googling.

Well, I don't think that the Perl is best language in the world, but I like it because is one of the least restrictive of the interpreted ones which I know to program in. That could be because I'm coming from assembler/C/Forth world.

Perl gets work done - SOAP?

Posted Nov 10, 2009 0:53 UTC (Tue) by alankila (subscriber, #47141) [Link]

The reality is that Perl is pretty poor for "enterprisey" stuff.

- Want to generate PDF documents? Stuff like PDF::API2 is horrible (based on Text::PDF, which is even worse). I think that was the best module I could find and it is unreliable and slow. I wrote what patches I could to fix the performance issues, but I never got my PDF generator to work very well in production usage. The code is the usual sort of stuff, letters to be printed & mailed out by filling out forms mashed up from various source PDF documents and generates a cover letter from user-editable markuped text.

- Dealing with XML? libxml2 is nice, but don't do anything too weird with it or you it will segfault on you. I also hit issues with stringification of XML documents with encoding issues, which the author fixed after reporting them, but it's saying something that I immediately hit problems on the sort of things I needed to do with it.

- Need XML signatures? Better just fork xmlsec1 and use that to make them. I wrote my own XML Signature generation library but it turned out that XML canonicalization was not easy to get working, as it had only rather recently arrived in libxml2 and nothing else was available.

- Need to make SOAP requests? Indeed, the best way to do them is pretty much just make a normal HTTP Request with LWP, none of the modules I tried worked very well. SOAP::WSDL had probably the best support for reading a wsdl, but in practice it didn't work on many real WSDL files I had.

Every time I struggled with a problem like this, I knew I was dealing with a rather more dead language than what the popular impression is. Some blame certainly falls libxml2's way, but the truth is, Java is probably the best language all-around when dealing with this kind of problems.

In every case, problems such as I were having could have been solved by forking a tool that does the work instead of trying with a pure-perl solution. I think it's fair to expect that a language can do what you need it to, however. These days, I suspect Java's "CPAN" is actually better than Perl's CPAN. By the time you contemplate writing a java program in order to fork that from a Perl program, it's the end of times for Perl.

Perl gets work done - SOAP?

Posted Nov 10, 2009 1:25 UTC (Tue) by rfunk (subscriber, #4054) [Link]

Yes, that's consistent with my experience. Everything is there in Perl, but
not everything is implemented in a complete and well-done way. Meanwhile the
Java people have spent the past decade or so writing industrial-strength
libraries.

Luckily, these days a lot of Java people are migrating to Ruby and are busy
writing Ruby libraries like what they had in Java. Well, that or just using
the Java libraries from their Ruby programs, using JRuby. (Which I did on a
project at another company.)

Perl gets work done - SOAP?

Posted Nov 10, 2009 1:39 UTC (Tue) by alankila (subscriber, #47141) [Link]

I can't wait for the One True Bytecode to rule over them all. Perhaps this ceaseless, profitless activity of "rewrite $x in $y" eventually ends.

one true bytecode

Posted Nov 10, 2009 11:57 UTC (Tue) by rfunk (subscriber, #4054) [Link]

That's why I'm excited about all the activity going on these days putting
non-Java languages on top of the JVM and making them run fast. I'm not a fan
of Java, but the JVM has become something interesting and useful on its own.

Perl gets work done - SOAP?

Posted Nov 10, 2009 8:33 UTC (Tue) by niner (subscriber, #26151) [Link]

Well, one could just use these same Java libraries in Perl using Inline::Java. There's
also Inline::Python which works pretty well.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds