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

I keep gettng the error:
document/literal support is EXPERIMENTAL in SOAP::Lite at /Library/Per +l/5.8.6/SOAP/Lite.pm line 2818. Can't call method "name" without a package or object reference at /Lib +rary/Perl/5.8.6/SOAP/Lite.pm line 2980.
With the following Soap function:
sub soapGet(){ my $service = SOAP::Lite -> service('http://ip/Info.asmx?WSDL'); $service -> GetHospitalInfo(); my $som = $service -> call; if ($som->fault) { print "SOAP FAULT:\n"; print Dumper $som; exit; }
This code runs great on one box running Perl 5.8.1 and Soap Lite .60, and on the other I keep getting the above error with Perl 5.8.6 and Soap Lite .67.
I guess I could try to overwrite the soap_lite .67 with .60, but dunno how to do that, so if anyone else does please feel free to yell.
thanks

Replies are listed 'Best First'.
Re: Soap Lite Error
by jhourcle (Prior) on Mar 15, 2006 at 15:16 UTC

    SOAP::Lite was originally written with the expectation that _everything_ was rpc/encoded. I personally prefer document/literal or document/literal wrapped, myself, but it's a function of exactly what you're trying to do -- see What WSDL should I use? for more info.

    As to how to downgrade SOAP::Lite -- it's actually fairly easy -- you can either go to search.cpan.org, search for the package, then select from the little version pulldown to get an older version ... or, if you actually want to install through CPAN (and who doesn't, as you don't have to manually process the requirements), you just need to figure out the right package name:

    Note that I searched for 'SOAP-Lite' and not 'SOAP::Lite', so I got the names of tarballs.

    Update: it would've helped if I made a point about the SOAP encoding types -- SOAP::Lite can talk to non-RPC services, but it was designed in from the beginning ... they've been adding better handling for all of the edge cases, but because it now does special processing, it might accidentally break something ... if you continue to have problems, you might try the soaplite mailing list

    Update 2: okay, it wouldn't helped if I had bothered to read yesterday's soaplite messages, as it seems the question was asked there, too.

      Done.
      Downgraded to .60 and I'm good. Uninstalled the old lib through perl, installed the new lib by hand from teh soaplite site, where they say .60 is the latest stable release. Wonder why cpan grabbed me .67?
      Anyhow, thanks guys.
Re: Soap Lite Error
by chargrill (Parson) on Mar 15, 2006 at 13:27 UTC

    Hi again ecuguru. :)

    I should preface this by saying that I don't have SOAP::Lite installed nor the time to do so, but your syntax appears ... well, a little "hinky" to me. I'm not sure why you've got your -> surrounded by spaces when near the identifier service and NOT surrounded by spaces near the identifier som. What happens if you get rid of those spaces, such that:

    sub soapGet(){ my $service = SOAP::Lite->service('http://ip/Info.asmx?WSDL'); $service->GetHospitalInfo(); my $som = $service->call; if ($som->fault) { print "SOAP FAULT:\n"; print Dumper $som; exit; }



    --chargrill
    $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}
      Hi again Chargrill!
      U definitely helped me out on the spaces issue on the last post, but afriad this one isn't it.
      My code now looks like:
      sub soapGet(){ my $service = SOAP::Lite->service('http://server/Info.asmx?WSD +L'); $service->want_som(1); $service->GetHospitalInfo(); my $som = $service->call(); if ($som->fault) { print "SOAP FAULT:\n"; print Dumper $som; exit; }
      And I still get the same error:
      document/literal support is EXPERIMENTAL in SOAP::Lite at /Library/Per +l/5.8.6/SOAP/Lite.pm line 2818. Can't call method "name" without a package or object reference at /Lib +rary/Perl/5.8.6/SOAP/Lite.pm line 2980.
      Any other ideas appreciated, and in the meantime I'm going to go try to uninstall the new soap::lite and reinstall the old soap module. I've only done module installing via CPAN, so this'll be new.
      thanks!
Re: Soap Lite Error
by Herkum (Parson) on Mar 15, 2006 at 17:30 UTC
    SOAP Lite 0.67 has some significant differences from 0.60. If you are encountering errors with 0.67 then you might want to stick with just using 0.60.