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

I have just written a package that call's SOAP::Lite and allows the user to override the uri & proxy values if required... otherwise it uses the defaults ('xxxx')

SOAP::Lite->new( uri => ($uri || 'xxxx'), proxy => ($proxy || 'xxxx'));


I dosen't use the $uri & $proxy... I am stumped as to why this wont work... any help is much appreciated... THANKS IN ADVANCE!

20031116 Edit by Corion: Fixed code formatting

Replies are listed 'Best First'.
Re: SOAP::Lite OO style with passed variables
by Roger (Parson) on Nov 16, 2003 at 12:02 UTC
    Can you please describe in more detail what kind of error you are getting. I have tried the following code, which gave exactly the behaviour you wanted. So I suspect the problem could be with the values of your $uri and $proxy. Perhaps they are empty. You could insert a print statement before your object creation and check the value of $uri and $proxy. The following code is what I used to test your object creation, which worked perfectly.

    use strict; use SOAP::Lite; use Data::Dumper; my $uri = "Optional URI"; my $proxy = "HTTPS:"; # <== insert print statement here to inspect $uri and $proxy print "URI = [$uri], PROXY = [$proxy]\n"; my $soap = SOAP::Lite->new( uri => ($uri || 'Some URI'), proxy => ($proxy || 'HTTP:') ); print Dumper($soap);
      Thanks heaps... Yeah I printed them out and the data in them is correct... I found what the problem was... I was trying to "bless" the SOAP::Lite Thanks for your help I really appreciate it.