locked_user sundialsvc4 has asked for the wisdom of the Perl Monks concerning the following question:

I have a (naturally) very-urgent requirement to succeed in making a SOAP routine. I've discovered and glommed onto the new SOAP::WSDL package from CPAN and I am pointing it to the service-description that I need to latch on to... with apparent success, that far.

The service description is at:   http://contentcafe2.btol.com/ContentCafe/ContentCafe.asmx?WSDL

But... what next?

Oh, I can see how this service-description (when read from the bottom to the top) very-edantically describes the service that I want to use, and the port (ContentCafeSoap), and the function (XmlClass .. RequestItems) ... then it gets down to an immensely-complicated structure beginning ContentCafeXML ... and there (even with the knowledge that Perl has grokked the WSDL and knows what this service is “about”), I become utterly lost due to the lack of current, and completely-finished examples to refer to.

I know that I am spinning my wheels here, and that it's time to pull-over to the side of the roadway, stop, and ask directions.

Could the Monks therefore give me a detailed shove in the right direction? Given this WSDL, how would I go about constructing, in Perl, a valid RequestItems call?

#define FLAME ON!
Also, is there anywhere on this great Internet any current, substantial, complete example which uses SOAP::WSDL and attempts something more challenging than “a hypothetical ‘MSFT’ stock-quote” or “a call to an parameter-less function called hi()?”
#undef FLAME   (sigh...)

Replies are listed 'Best First'.
Re: SOAP suds
by Khen1950fx (Canon) on Feb 22, 2008 at 02:50 UTC
    This isn't a "complete example". I finally decided to call it quits for the day and head for the aspirin:-). Maybe this will help.

    #!/usr/bin/perl use strict; use warnings; use diagnostics; use SOAP::Lite; use SOAP::WSDL; use Data::Dumper; $Data::Dumper::Terse = 1; $Data::Dumper::Indent = 1; BEGIN { warn "Started...\n" } my $soap = SOAP::WSDL->new( wsdl => 'http://contentcafe2.btol.com/ContentCafe/InventoryAvailability. +asmx?WSDL' ); $soap->wsdlinit( caching => 1, cache_directory => '/tmp' ); $soap->servicename('InventoryAvailability'); $soap->portname('InventoryAvailabilitySoap'); my $som = $soap->call('CheckInventory'); warn "Loaded...\n"; print Dumper($som);

Re: SOAP suds
by polettix (Vicar) on Feb 21, 2008 at 23:46 UTC
    Just for curiosity, which version of SOAP::WSDL are you looking at? The developer release SOAP-WSDL-2.00_32 seems to have a lot of stuff, including some promising "Manual" docs and a teasing wsdl2perl.pl to "create perl bindings for SOAP webservices."

    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Io ho capito... ma tu che hai detto?

      By all means, please elaborate! Point me in the right direction (by means of this thread...) because I know that obviously I am overlooking something. Tell me, here in this thread, exactly where to find what I am looking for. (Where are “developer releases” if not in search.cpan.org, for example?)

      Like I said, I know that there is a piece missing ... (awright, no wisecracks from the peanut-gallery...) ... and it must be out there and I haven't stumbled-upon it yet. I have no desire to waste time “stumbling.”

      AtDhVaAnNkCsE   = “thanks in advance!”

        :-/

        Duh.

        I wasn't paying attention to the words “developer release.” And so, I was continually re-fetching the previous version of the code. Which doesn't have all these nice new goodies.

        Finally ... the little light ... blinked on ... and I re-read the last few lines of what is ... quite ... clearly ... spelled-out here:

        http://www.perl.com/doc/manual/html/lib/CPAN.html#The_four_C_CPAN_Classes_Aut

        and did this, to install the latest (development...) version:

        install MKUTTER/SOAP-WSDL-2.00_32.tar.gz

        So what I was reading about on http://search.cpan.org, versus what I was installing on my box, was not the same thing.

        “Doh!   :-)   Me bad.” Oh well, I don't mind “fessin' up” here, because maybe somebody else out there is scratchin' his head too, or soon would have.

        When I get to a success on this little effort, I'll be sure to come back to summarize it here.

Re: SOAP suds ... well THAT was quick...
by locked_user sundialsvc4 (Abbot) on Feb 22, 2008 at 18:21 UTC

    “Well, that was quick!”   :-(

    After downloading the development version and trying to use wsdl2perl.pl, the script immediately died with:
    XML Schema element <enumeration> is not implemented yet

    The script produced no output at all.

    So I seem to be pretty much “dead in the water” on this one. I can only hope that Martin Kutter won't release the new version with this crucial-to-me omission:   “it's not finished yet...”

    It seems that, without it, I cannot practically use Perl to access this service. If there is a practical way to issue the necessary Perl calls without this, I can't see my way clear to find it. Furthermore, I must conclude that it the schema-parser omits this feature, it won't work properly even if (as it seemed to be...) wsdlinit() “completed without error.”

    As far as I can tell, to get this job done I'm going to have to bludgeon XML-strings and pick the information that I need to get out of it. In other words, “brute force.” How very disappointing to be forced to use a cudgel when a delicate key should have worked.

      The problem isn't a Perl problem. First, Baker & Taylor requires that you open an account, then they will give you a username and password. Your script won't work without them. Second, you'll need an account to access the documentation on the allowed methods. Have you checked the documentation? Third, post some code...good luck!