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

I am trying to connect to a webservice using SOAP::Lite and am receiving an error stating that I can't call method "METHODNAME" on unblessed reference. Can anyone give me a hand?
my $soap_response = new SOAP::Lite -> service('file:FILE.WSDL') -> uri('http://URI.URL') -> proxy =>[ 'HTTPS Proxy URL', credentials => [ '$username' => '$password' ] ] -> METHODNAME($post) -> METHODNAME('string');

Replies are listed 'Best First'.
Re: SOAP::Lite - POOP problem
by Fletch (Bishop) on Jun 04, 2007 at 15:08 UTC

    Because of the missing parens on the proxy call you're attempting to call METHODNAME on something thats an unblessed reference (namely the vanilla arrayref you're trying to pass proxy).

    ( ( my $soap_response = 'SOAP::Lite' ->new->service('file:FILE.WSDL')->uri('http://URI.URL')->pro +xy ), [ 'HTTPS Proxy URL', 'credentials', [ '$username', '$password' ] ] ->METHODNAME($post)->METHODNAME('string') );

    perl -MO=Deparse,-p,-q is your friend.

Re: SOAP::Lite - POOP problem
by ForgotPasswordAgain (Vicar) on Jun 04, 2007 at 15:32 UTC
    I know SOAP::Lite enjoys chaining method calls, but try it over without chaining them.