#!/usr/local/bin/perl
use strict;
use warnings;
use SOAP::WSDL +trace => 'all';
use Data::Dumper;
Main: {
my $soap=SOAP::WSDL->new( wsdl => 'http://some_ip/wsdl/myServiceName.wsdl' );
$soap->proxy('http://some_ip:port/some/path/myServiceLocation');
$soap->servicename('myServiceName');
$soap->wsdlinit( caching => 1);
my $response;
eval { # this one worked with no troubles
$response = $soap->call( 'queryItem' ,
id => 'blah' ,
pwd => 'bleh',
itemId => '9015');
};
if ($@) {
print "SOAP call failed: $@\n";
exit;
}
eval { # this one fails with the "error processing WSDL" message
$response = SOAP_add_Item($soap);
};
if ($@) {
print "SOAP call failed: $@\n";
exit;
}
if ($response->fault) {
print Dumper($response->faultdetail), "\n";
}
else {
my $body = $response->result;
unless ($body == 0) {
print "SOAP Message: ", Dumper($body);
}
}
}
sub SOAP_add_Item {
my $soap = shift;
my $response = $soap->call('addItem',
'id' => 'blah',
'pwd' => 'bleh',
'itemId' => '1234',
'itemName' => 'Test Item',
'Ranges' => [
{ 'min' => '8605118310',
'max' => '8605118319' } ] );
return $response;
}
# 'Ranges' => [
# bless( {
# 'min' => '8605118310',
# 'max' => '8605118319'
# }, 'SoapTypeRange' ) ] );
####
SOAP call failed: Error processing WSDL: './/xsd:element' not found at /usr/local/lib/perl5/site_perl/5.8.6/SOAP/WSDL.pm line 504.
####