jhyland87 has asked for the wisdom of the Perl Monks concerning the following question:
So I have a custom module setup, heres the subroutine within it
sub new { my ($self, $settings) = (@_); die('Server not set for connection settings') if(!$settings->{ +'server'}); die('Username not set for connection settings') if(!$settings->{'u +sername'}); die('Password not set for connection settings') if(!$settings->{'p +assword'}); $settings->{'protocol'} = ($settings->{'protocol'}) ? $setting +s->{'protocol'} : "https"; $settings->{'port'} = ($settings->{'port'}) ? $settings->{' +port'} : "443"; my $proxy_uri = sprintf("https://%s:%s@%s:443/iControl/iControlPor +tal.cgi", $settings->{'username'},$settings->{'password'},$settings-> +{'server'}); $self->debug("Connection Settings:\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +>>>>>>>>>>\n". Dumper($settings)."<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +<<<<<"); $self->debug("Connection URI: $proxy_uri"); $soap = SOAP::Lite->proxy($proxy_uri); if($soap->fault) { print "\nSoap Fault: ".$soap->faultcode." ".$soap->faultstring +." ".$soap->faultdetail."\n\n"; } return $soap; }
Pretty basic right? Just makes a soap authentication request. Heres the weird part. Notice I didnt make it die() if $soap->fault;, I just let it try to continue. Well, it throws an error, but it actually returns the expected data! Here it is:
Soap Fault: 1 1 1 Members in first pool: $VAR1 = bless( { 'address' => '1.2.3.4', 'port' => '80' }, 'Common::IPPortDefinition' );
So the code, string and detail are all just "1".... not much detail right? Now when I actually do a Data::Dumper on the faultcode, it shows a ton of data, and I found this in it.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode> <faultstring xsi:type="xsd:string">Unknown method "{Unspecified}:faultcode +"</faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Soooo the fault code, is unknown method: faultcode?... Someone make it make sense, lol
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SOAP::Lite fault seems faulty
by Anonymous Monk on Jan 05, 2012 at 19:48 UTC |